Basically, web3.js is an Ethereum JavaScript API, which provides a collection of libraries for interacting with local or remote Ethereum networks. The connection between web3js and Ethereum is made by using the HTTP, WebSocket, or IPC protocol. In the following table, we will quickly review several important web3.js API concepts:
API reference |
Description |
Example |
web3-eth |
This package provides an API to interact with the Ethereum blockchain and smart contracts. |
getBalance, sendTransaction, coinbase, getBlockNumber, getAccounts |
web3-shh |
This package provides an API to interact with the Whisper protocol for broadcasting. |
web3.shh.post({ symKeyID: identities[0], topic: '0xffaadd11', payload: '0xffffffdddddd1122' }).then(h => console.log(`Message with hash ${h} was successfuly sent`)) |
web3-bzz |
This... |