June 28, 2026

How to setup your own private Ethereum network — Part 2

How to setup your own private Ethereum network — Part 2

How to setup your own private Ethereum network — Part 2

How to setup your own private Ethereum network — Part 2

How to setup your own private Ethereum network — Part 2

In this article we’ll look at connecting to other peers without using boot nodes. A continuation of

Nodes connect to other peers via a static configuration file in the data directory of each node.

The private network is now made up of 3 nodes (without boot nodes) comprising of

  1. One Miner Node
  2. Two Peer nodes

Each node is configured using a static json file containing the details of other peers, so you need to find the enode URLs of all the nodes.

  1. Find the enode url of each node
  2. Create a static json file detailing the other peers
  3. Start the nodes
  4. Attach to each node and find the peers count

Step 1: Find the enode url of each node

When you start up an Ethereum node it details an enode url. The enode URL is of the format enode://publickey@ip:port. Make a list of enode URLs of the 3 nodes.

startup
enode url

Step 2: Create a static json file detailing the other peers

The contents of each static-nodes.json file in the data directory is the enode url of other peers

Step 3: Start all the nodes

Start the miner node and 2 nodes with RPC APIs exposed

geth — datadir data/node3 — nodiscover — syncmode “full” -verbosity 6 — ipcdisable — port 3033 — networkid 9876 — gasprice 1 -unlock ‘0x219789a1844eF774Da4810e0437A105989b76332’ — password password.txt -mine

geth — datadir data/node1 — nodiscover — syncmode ‘full’ -verbosity 6 — ipcdisable — port 3031 — rpc — rpcaddr ‘localhost’ — rpcport 8101 — rpcapi admin,debug,eth,miner,net,personal,shh,txpool,web3 — networkid 9876

geth — datadir data/node2 — nodiscover — syncmode ‘full’ -verbosity 6 — ipcdisable — port 3032 — rpc — rpcaddr ‘localhost’ — rpcport 8102 — rpcapi admin,debug,eth,miner,net,personal,shh,txpool,web3 — networkid 9876

Step 4: Attach to each node and find the peer count

Attach to each node and check the peer count (2).

This article demonstrates creating a private Ethereum network using static configuration file to talk to peer nodes.

Published at Wed, 05 Feb 2020 12:58:05 +0000

{flickr|100|campaign}

Previous Article

Bitcoin is Going to Dump Hard, Prominent Analyst Warns

Next Article

Binance Launchpad shows the results of the WazirX sales

You might be interested in …