跳至主要内容

協助翻譯本頁面

🌏

由於尚未翻譯,本頁面內容以英文顯示。協助我們翻譯內容。

翻譯本頁面

這裡沒有漏洞!🐛

此頁面未翻譯,目前特意維持英文原文。

Ethereum for JavaScript developers

最後編輯: , Invalid DateTime
編輯頁面

JavaScript is among the most popular languages in the Ethereum ecosystem. In fact, there's a team dedicated to bringing as much of Ethereum to JavaScript as possible.

There are opportunities to write JavaScript (or something close) at all levels of the stack.

Interact with Ethereum

JavaScript API libraries

If you'd like to write JavaScript to query the blockchain, send transactions and more, the most convenient way to do this is using a JavaScript API library. These APIs allow developers to easily interact with the nodes in the Ethereum network.

You can use these libraries to interact with smart contracts on Ethereum so it's possible to build a dapp where you just use JavaScript to interact with pre-existing contracts.

Check out

  • Web3.js
  • Ethers.js – includes Ethereum wallet implementation and utilities in JavaScript and TypeScript.

Smart contracts

If you're a JavaScript developer and wanting to write your own smart contract, you may want to get familiar with Solidity. This is the most popular smart contract language and it's syntactically similar to JavaScript, which may make it easier to learn.

More on smart contracts.

Understand the protocol

The Ethereum virtual machine

There is a JavaScript implementation of Ethereum's virtual machine. It supports the latest fork rules. Fork rules refer to changes made to the EVM as a result of planned upgrades.

It's split out into various JavaScript packages that you can check out to better understand:

  • Accounts
  • Blocks
  • The blockchain itself
  • Transactions
  • And more...

This will help you understand things like "what's the data structure of an account?".

If you prefer to read code, this JavaScript could be a great alternative to reading through our docs.

Check out the monorepo
ethereumjs

Nodes and clients

There's an Ethereumjs client in development. This will let you dig into how Ethereum clients work in a language you understand.

Check out the client
ethereumjs-client

Other projects

There are also plenty of other things going on in the land of Ethereum JavaScript, including:

  • libraries of wallet utilities.
  • tools to generate, import, and export Ethereum keys.
  • an implementation of the merkle-patricia-tree – a data structure outlined in the Ethereum yellow paper.

Dig in to whatever interests you most over at the EthereumJS repo

Further reading

Know of a community resource that helped you? Edit this page and add it!

這篇文章對您有幫助嗎?

👈

上一頁

Java

下一頁

Python
👉
網站上次更新: 2022年9月26日

使用以太坊

  • 尋找錢包
  • 取得以太幣
  • 去中心化應用程式 (dapp)
  • 第二層
  • 執行節點
  • 穩定幣
  • Stake ETH

生態系統

  • 社群中心
  • 以太坊基金會
  • 以太坊基金會部落格
  • 生態系統支援計畫
  • 以太坊漏洞懸賞計畫
  • 生態系統獎助金計畫
  • 以太坊品牌資產
  • Devcon