Ethereum, tokens & smart contracts.

Notes on getting started Part 2. web3.js

Keno Leon
5 min readSep 18, 2017

--

So once you have a wallet, are on a test net and have some ether ( read part 1. if any of this is not clear ) where to go next ?

Let’s start coding, web3.js and Solidity seem to be the entry points for interacting with the blockchain programmatically and making contracts & tokens, web3.js I think is a nice prequel to working with solidity, so let’s check it out first:

web3.js :

Docs

web3.js is the javascript API for interacting with the Ethereum blockchain, the easiest way to explain it is through a couple of basic examples. A cool and simple way to test some basic commands is via the parity/web3 console:

Let’s start by requesting my balance:

web3.eth.getBalance("0x001301AD1556fD419Cf8970B174fE9AF34267eB8")// 3000000000000000000

Importantly the balance is displayed in wei, not ether, but conveniently there is a function in the api that converts to ether (or other denominations)

web3.fromWei(web3.eth.getBalance("0x001…

--

--