Last active
October 10, 2018 12:42
-
-
Save JohannesBertens/8ff38b0d94e6629b172d210e38772098 to your computer and use it in GitHub Desktop.
Start private Ethereum multi-node network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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