Skip to content

Instantly share code, notes, and snippets.

@JohannesBertens
Last active October 10, 2018 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohannesBertens/8ff38b0d94e6629b172d210e38772098 to your computer and use it in GitHub Desktop.
Save JohannesBertens/8ff38b0d94e6629b172d210e38772098 to your computer and use it in GitHub Desktop.
Start private Ethereum multi-node network
# Create network & volumes
docker network create geth
docker volume create datadir1
docker volume create datadir2
# Pull images
docker pull dapps/geth-init
docker pull dapps/geth-mine
# Create and init nodes
docker run -d --rm --mount source=datadir1,target=/root/.ethereum dapps/geth-init
docker run -d --rm --mount source=datadir2,target=/root/.ethereum dapps/geth-init
# Sleep works on mac and linux, timeout on windows
sleep 5
timeout 5
# Create and start miner nodes
docker run -d -it --mount source=datadir1,target=/root/.ethereum --name node1 dapps/geth-mine
docker network connect --ip 172.18.0.11 geth node1
docker run -d -it --mount source=datadir2,target=/root/.ethereum --name node2 dapps/geth-mine
docker network connect --ip 172.18.0.12 geth node2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment