Member-only story
Web3 .js Ethereum Javascript API
Published in
4 min readMar 9, 2019
web3.js is a collection of libraries which allow you to interact with a local or remote ethereum node, using a HTTP or IPC connection. The web3 JavaScript library interacts with the Ethereum blockchain. It can retrieve user accounts, send transactions, interact with smart contracts, and more.
Version : 1.0.0-beta.36
Web3.js API Type
- eth: Etherum blockchain related methods
- net: Node’s network status
- personal: Account functions and sending
- db: Get/put for local LevelDB
- shh: P2P messaging using Whisper
Install Web3.js
Node
npm install web3
CDN : https://cdn.jsdelivr.net/gh/ethereum/web3.js@1.0.0-beta.34/dist/
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js@1.0.0-beta.34/dist/web3.js"><script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js@1.0.0-beta.34/dist/web3.min.js">
Instantiating web3
// Modern dapp browsers...
if (window.ethereum) {
App.web3Provider = window.ethereum;
try {
// Request account access
await window.ethereum.enable();
} catch (error) {
//…