Running private Ethereum on Docker

Ruben
2 min readJul 12, 2019

--

The Ethereum scene keeps growing with new technologies and tools built on top of it all the time.

Leveraging all those changes might be a hard task and the basics are quickly lost among the myriad of new acronyms and changes in the documentation.

This quick tutorial introduces eth-playground, a simple and straightforward project to run and monitor Ethereum nodes in a private Docker network.

The ultimate goal is not to mine Ether (which is really expensive nowadays) but to have your own DLT setup able to run smart contracts and experiments in an environment that aims to mimic a production Blockchain deployment.

Features

Eth-playground provides a handy CLI bash script (called cluster) to allow simple interaction with the nodes:

  1. Login to the running containers, e.g. eth2 node: cluster login eth2
  2. Geth console inside the running container, e.g. eth1: cluster geth eth1
  3. Build, stop cluster: ./build.sh, cluster stop

Check the network status: cluster info

This command returns the URL and port where netstat is displaying the status of the geth nodes (the IP of the netstat node):

Netstat reporting the status of 3 nodes
ETh-netstat reports the status of all the nodes

Architecture

The architecture is very simple, fully built on a Docker network and provides the following basic structure:

  • a set of Ethereum private nodes (currently 3) running geth on a private chainID.
  • a bootnode node that allows peer discovery in the network when a new node is added.
  • a netstat node displaying the nodes status (each node reports using eth-net-intelligence-api).

The nodes connect to the bootnode node when bootstrapping to discover new peers and each one of them reports automatically its status to the netstat node.

Install

The only requirement is a working Docker instance running on the local machine, refer to the installation steps on Github.

  1. git clone https://github.com/rubenafo/eth-playground
  2. cd eth-playground
  3. ./build.sh
  4. ./cluster deploy
  5. ./cluster info returns the URL to check the eth-netstat dashboard.

Once the nodes are running the environment is ready to run more interesting stuff like smart contracts.

TODO…

The list is quite long but includes things like:

  • Truffle support
  • switch to PoS instead of PoW
  • smart contracts

--

--

Ruben

Data analytics, data management in financial services . Solutions Architect @ AWS . http://rubenafo.com