How to add peer to ethereum private network?

0 votes
I have created an Ethereum private network on my Ubuntu VM and it is running all fine. Now, to create a scenario like a real-world scenario, I have created another VM and now want to add this to my already created Ethereum private network. How can I do this?
Jan 22 in Blockchain by slayer
• 29,050 points
110 views

1 answer to this question.

0 votes

To connect a node to already existing private network on a different VM, you have to setup Ethereum on the new VM and then connect. You have already setup Ethereum Private Network on one Ubuntu system (VM-1). Now, you must create an Ethereum Network on the new Ubuntu System (VM-2) using the same steps that you used to create the network on VM-1. While created the network on VM-2, make sure to satisfy the following conditions:

1.      VM-2 must have the same Genesis Block as that of VM-1

2.      The network for both the VMs must be NAT or Bridged network

3.      Port numbers on VM-1 and VM-2 mentioned in the geth command to start the Blockchain should be different.

Once you set up the system to meet the above-mentioned conditions, you and add the peer. On VM-2, run the following command in the geth console to get the enode:

admin.nodeInfo 

You will be displayed an enode URL.

Now in VM-1, in the geth console, run the following command by replacing the enode URL that you got on VM-2.

admin.addPeer("enode_URL")

Now, the peer will be added.

answered Jan 22 by Omkar
• 67,380 points

Related Questions In Blockchain

0 votes
1 answer

How to add a static node to private ethereum network?

There are two ways to do this. 1. Configuring ...READ MORE

answered Jan 10 in Blockchain by Omkar
• 67,380 points
33 views
0 votes
1 answer

How to monitor Ethereum private network?

geth should be started with --metrics. try the ...READ MORE

answered Jul 11, 2018 in Blockchain by slayer
• 29,050 points
135 views
0 votes
1 answer

How to get account with ethers by default in ethereum private network?

Have you created an account before allocating ...READ MORE

answered Jan 9 in Blockchain by Omkar
• 67,380 points
41 views
0 votes
1 answer

How to import an account in private ethereum network?

 When you create a new account, the ...READ MORE

answered Jan 9 in Blockchain by Omkar
• 67,380 points
24 views
0 votes
0 answers

Error: Unexpected token o in JSON at position 1

I have been working with Interacting a ...READ MORE

Mar 6 in Blockchain by saeedi
• 120 points

edited Mar 6 by Omkar 357 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
138 views
0 votes
1 answer
0 votes
1 answer

How to check peer connectivity in ethereum private network?

You can use the net module to check the ...READ MORE

answered Jan 10 in Blockchain by Omkar
• 67,380 points
23 views
0 votes
1 answer

How to get IP address of peer connected in private ethereum network?

To get these details, you can use ...READ MORE

answered Jan 10 in Blockchain by Omkar
• 67,380 points
43 views