Brad Lucas

A blog mostly about programming
August 17, 2017

Send Eth From Geth Console

A log of a session showing how to check account balances and then send ETH. In this example I'm running a geth console on a local node and I want to send 10 ETH to two different accounts.

First, I list the accounts and then see how much ETH I have in the default account.

> personal.listAccounts
["0x634b8e79b0155e5ac1403c2fe4b1d30f2fc6b931"]


> web3.fromWei(eth.getBalance(eth.coinbase)); 
83.997039

Before attempting to send I need to unlock the account. This prompts you for your password.

> personal.unlockAccount(eth.coinbase)

Then I send 1 ETH to each account.

> eth.sendTransaction({from:eth.coinbase, to:"0xd60e64afb753583941e1ab42f836ced0d23af2db", value: web3.toWei(1, "ether")})
"0xbea0beb44688f49177c9e2bffa246ee4471d57a9290d5e42b9d959d3e0731d90"

> eth.sendTransaction({from:eth.coinbase, to:"0xf0c7452279d382dc41f7fb9fb59203bcb5a4239a", value: web3.toWei(1, "ether")})
"0xb118e0a48ed6acb6ae5a7a2f7c7b519b7544b1e7c5709833e5e73db48abba260"

Followed by another 9 to each account.

> eth.sendTransaction({from:eth.coinbase, to:"0xf0c7452279d382dc41f7fb9fb59203bcb5a4239a", value: web3.toWei(9, "ether")})
"0x61e7ee5629eec21be23147b0188e793daf77257d1863560cfd247212e5c671e4"
> eth.sendTransaction({from:eth.coinbase, to:"0xd60e64afb753583941e1ab42f836ced0d23af2db", value: web3.toWei(9, "ether")})
"0x4b3c20a3acb218047cfa09c96c0758fe6b55de74e8ea59d20d0e5848fef2d6cd"

You can use the transaction hash returned from each sendTransaction to verify the transaction over on Etherscan. If you developing and trying things out on the testnet use this Etherscan/Ropsten.


Tags: geth ethereum