跳至主要内容
Change page

Ethereum for JavaScript developers

最後編輯: @nhsz(opens in a new tab), 2023年8月15日

JavaScript is among the most popular languages in the Ethereum ecosystem. In fact, there's a team(opens in a new tab) 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

Smart contracts

If you're a JavaScript developer and want to write your own smart contract, you may want to get familiar with Solidity(opens in a new tab). 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(opens in a new tab)

Nodes and clients

An Ethereumjs client is in active development that lets you dig into how Ethereum clients work in a language you understand; JavaScript!

It used to be housed in a standalone repository(opens in a new tab), however, was later merged into the EthereumVM monorepo as a package.

Check out the client
ethereumjs-client(opens in a new tab)

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 into whatever interests you most over at the EthereumJS repo(opens in a new tab)

Further reading

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

這篇文章對你有幫助嗎?

網站上次更新: 2024年7月24日

學習

  • 學習中心
  • 什麼是以太坊?
  • 什麼是以太幣 (ETH)?
  • 以太坊錢包
  • 什麼是 Web3?
  • 智慧型合約
  • Gas fees
  • 執行節點
  • 以太坊安全及詐騙預防
  • 測驗中心
  • 以太坊詞彙表
(opens in a new tab)(opens in a new tab)(opens in a new tab)
  • 關於我們
  • 以太坊品牌資產
  • 行為守則
  • 工作機會
  • 隱私條款
  • 使用條款
  • Cookie 政策
  • 媒體聯絡方式(opens in a new tab)