Creating a local ethereum testing network

Setting up geth

geth is a node environment for interacting with the network, for making transactions, mining and creating contracts.

$ alias geth='docker run -w /src --rm -it -v `realpath .`:/src -v ${ETHEREUM_DATA_DIR}:/root/.ethereum ethereum/client-go:stable'

Setting up the network

To interact with the network we will first need to create it. This is done using geth init:

$ geth --datadir /root/.ethereum/test --networkid 123 --nodiscover --maxpeers 0 init genesis.json

Next we need to create an account for our miner:

$ geth --datadir /root/.ethereum/test --networkid 123 account new

Testing our setup

To make sure we have setup our chain correctly we will try and transfer some funds:

> eth.getBalance(eth.coinbase)
1.77e+21

And we are done!