Running a Parity Docker Container with Custom Configuration

Itay Podhajcer
2 min readDec 22, 2019

Running the Parity Ethereum Client as a Docker container with a custom configuration is a relatively simple task, that usually only requires mounting one or two files (depending whether a custom chain is also configured or not) to the container.

TL;DR

A GitHub repository with the complete example is available here:

To start, we’ll create two directories:

  • src: will contain the configuration files
  • eng: will contain the docker compose file

Generate Wallet

To generate a wallet, use whatever client you feel comfortable with, such as MyCrypto which has both an online and a desktop version.
You can also use something like Secure Password Generator to easily generate a password that meets the required complexity policy.

Chain Genesis File

Create a chain.json file inside the src directory. We won’t be using one of the predefined configurations (taken from here):

Instead, we’ll use the dev chain file found here and copy it’s content to our file, so we can customize it with the wallet address we generated.
Look for the accounts section and add an entry at the end with the address of the generated wallet:

Configuration File

Next we create a config.toml file, also inside the src directory. Our configuration file will be very simple, just the base directory and the path to the chain.json file:

For more complex configurations, considering using the Parity Config Generator, as it greatly simplifies the process of creating the configuration file by providing an explanation on the available options and possible values where relevant.

Docker Compose File

Our docker compose file (docker-compose.yml), which will be created in the eng directory, will have only one service defined for the purpose of this example, but can be extended with whichever container you may require. The service will be a Parity container (obviously) with the two configuration files mounted to the /home/parity/.local/share/io.parity.ethereum directory with the ports 8545, 8546, 30303 and 30303/udp exposed. The end result should look like this:

Running The Container

Now the only thing left to do to run the container is execute docker-compose up from the directory containing the YAML file, or docker-compose -f <path to YAML file> up from any other path.

Sign up to discover human stories that deepen your understanding of the world.

Written by Itay Podhajcer

Tech expert with 20+ years’ experience as CTO, Chief Architect, and Consultant. 3x Microsoft MVP award winner. Passionate blogger and open-source contributor

No responses yet

Write a response