You are on page 1of 1

4.

Sending Ether to other account


1. Getting Balance in Wei
>eth.getBalance(eth.coinbase)

2. Getting Balance in eth

>web3.fromWei(eth.getBalance(eth.coinbase), "ether")

3. check th balance in account1


>eth.getBalance(eth.accounts[1])

4. Print the list of accounts


>eth.accounts

5. Create transaction to send 4 ether from account_0 to account_1

>personal.unlockAccount(eth.accounts[0])
>eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(4,"ether")})
>eth.getBalance(eth.accounts[1])
>miner.start(4)
>miner.stop()
>eth.getBalance(eth.accounts[1])

You might also like