POW (Proof of work) Blockchain Configuration

This Blog provide the detailed steps of configuration and build of POW(Proof of work) Private Blockchain on

docker containers.


Blockchain POW(Proof of work)


Docker package should be installed on the host machine.

Steps for Configuration and build:

  1. Following docker file is being used to build docker image and eventually building the containers for Blockchain.


FROM ubuntu
MAINTAINER <name and email id of the maintainer” Deloitte>
RUN apt-get update && apt-get upgrade -q -y
RUN apt-get install -q -y git curl software-properties-common vim
RUN add-apt-repository ppa:ethereum/ethereum
RUN add-apt-repository ppa:ethereum/ethereum-dev
RUN apt-get update
RUN apt-get install -q -y geth
ADD ethereum /home/ubuntu/ethereum
WORKDIR /home/ubuntu/ethereum
VOLUME [“/home/ubuntu/ethereum/ethdata”]
EXPOSE <variable port “8545”>
EXPOSE <Variable port “30303”>


  1. Create a volume/s depending on the number of containers to be created.


docker volume create [OPTIONS] [VOLUME]
docker volume create test


  1. Create an image using the docker file created in Step 1.


docker build [OPTIONS] PATH | URL | –
docker build -t ethereum-docker


Verify if the image has been setup using

docker image

This will give a list of all the images created.



  1. Create the containers using the image.


docker run -d -it –net=host -v <volume path>:<mount directory in container> –name <container name> <image name>
docker run -d -it –net=host -v hello:/data –name etherum1 test /bin/bash


Use “docker ps” to check the containers that have been created.

Enter the container created using following command.

docker exec –it <container Id> bash

  1. Create a custom genesis file.

  Make a genesis file. A sample genesis file has been added below.

“config”: {
“chainId”: 15,
“homesteadBlock”: 0,
“eip155Block”: 0,
“eip158Block”: 0
“nonce”: “0x0000000000000042”,
“timestamp”: “0x00”,
“parentHash”: “0x0000000000000000000000000000000000000000000000000000000000000000”,
“extraData”: “0x00”,
“gasLimit”: “0x8000000”,
“difficulty”: “0x400”,
“mixhash”: “0x0000000000000000000000000000000000000000000000000000000000000000”,
“coinbase”: “0x3333333333333333333333333333333333333333”,
“alloc”: {

Initialize then geth using private genesis file with unique data directory.

geth init <name of genesis file> –datadir=”./<name of data directory>”
              geth init private-genesis.json –datadir=”./ethdata1″


  1. Start Geth and enter the console.

geth –datadir=./ethdata –rpccorsdomain “http://localhost:3000” –port <genericport> –rpc –rpcapi eth,net,web3,personal –rpcaddr “” –rpcport <genericport> –nodiscover –maxpeers 2 –fast –cache=1024 console 2>> ./Logs/GethLog.log
geth –datadir=./<datadirectory> –rpccorsdomain “http://localhost:3000” –port 54259 –rpc –rpcapi eth,net,web3,personal –rpcaddr “” –rpcport 8545 –nodiscover –maxpeers 2 –fast –cache=1024 console 2>> ./Logs/GethLog.log


  1. Create personal account in all the nodes.


Add and confirm the passphrase.

Save the unique allocation id to use it for further configuration.

  1. Edit the genesis file to add the allocation id and balance block.


The allocation id of all the accounts has to be added to all the genesis files of all the nodes.

This will be required for the peering of the nodes.


                                                  “alloc”: {
{“balance”: “20000000000000000000”},
{“balance”: “20000000000000000000”},
{“balance”: “20000000000000000000”}


  1. Node Peering for communication.


For node peering and to create a private cluster. All the nodes created should be able to listen to each other. Start the geth console to get the enode for respective node.

Run the following command on both nodes.



The sample output of this command will be the following for an instance.


Add the nodes as peers to each other by logging into each node and running the following command with the enode  of all the other nodes.



Reinitialize geth on all nodes.

Add allocation id for every node in genesis file and replicate the genesis file across the cluster.

Amrit Pal singh

Designing critical migration from legacy to cloud environments, extending devops approach into analytics, AI/ML to maximize the purpose of agile approach. We work to integrate compliance with risk, security and regulations, building seamless interfaces across multiple systems. I am fortunate to manage complex hierarchy of global portfolios, programs and projects and executive communication . Provide TCO analyses to low level architecture, design and implementation, readiness and building BCP/DR/HA, and around the clock monitoring & management using cloud tools relevant to our customer's situation and objectives.

Leave a Reply

Your email address will not be published.