January 23, 2026

Capitalizations Index – B ∞/21M

Running Your own Private Blockchain – Salman Dabbakuti –

Running Your own Private Blockchain – Salman Dabbakuti –

Blockchain Nodes

Pre-requisites

1.Geth 2.Code editor

Steps

  1. Make a new directory with a name of your choice. for this tutorial, lets say “chain” on your desktop.
  2. Copy and paste “myGenesis.json” file(create file with this code and with same name) and put it in your folder directory(chain).

3. Go to command prompt. in your directory, run the following command

geth --datadir ./node1 init myGenesis.json

It will start a private blockchain with Genesis state.

4. Provide network id by running this command

geth --datadir ./node1 --networkid 2019 console

it will take you to jS console.

5. Create new account that holds mining reward in the console

> personal.newAccount("password Here")

6. Set it as default account for mining reward

miner.setEtherbase(web3.eth.accounts[0])

This command should return true.

7. Start mining activity

> miner.start()

8. Adding Peers and connecting them together

a). Open another cmd prompt, initialize same genesis file with new data directory like below

geth --datadir ./node2 init myGenesis.json

b). Connect 2nd node with same network id as first node and use different port.

geth --datadir ./node2 --networkid 2019 --port 8081 --ipcdisable --nodiscover console

Above command will instantiate chain with networkid of 2019 and port of 8081. but node2 is still not connected to node1. to connect, run following commands.

** Repeat step 5, 6 and 7 to add accounts to node 2. **

c). In the first node console run this command

>admin.nodeInfo

Above command will return node info with different parameters. copy the enode value which is like this "enode://.....@" . it is an id of node1. this id is key to connect node2 with node1. we will do it in the next step.

d). In your node2 console,

>admin.addPeer("enode://.....@")

It will return true if, node successfully connected. make sure your "enode://...@" value is correct. to confirm if node is connected, run below command in the node 1 console

>admin.peers

It will show you connected node with port id, network id.. etc.

Boom… You have successfully initiated private blockchain with 2 nodes.

Published at Wed, 15 May 2019 12:29:30 +0000

Previous Article

Japan’s leading music and visual content company establishes a subsidiary to leverage cloud and blockchain technologies

Next Article

Free Markets and the Future of Blockchain

You might be interested in …

Bitcoin accumulation

Bitcoin Accumulation

bitcoin Accumulation Presenting a wyckoff accumulation for bitcoin The main area of focus on this chart is the JAC (jumping above creek) that we see near the bottom of the trading range. Price displayed a […]

Cf30 - flutter coin $flt

CF30 – Flutter Coin $FLT

CF30 – Flutter Coin $FLT Today we discuss the lovely $FLT Flutter Coin! Check out @cryptocashguy on Twitter – he is an IT, Staking, and Wallet WIZARD! And my partner in creating this channel and […]