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, 2019 in Blockchain by slayer
• 29,370 points
2,973 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, 2019 by Omkar
• 69,220 points

Related Questions In Blockchain

–1 vote
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 11, 2019 in Blockchain by Omkar
• 69,220 points
1,823 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,370 points
1,540 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, 2019 in Blockchain by Omkar
• 69,220 points
1,678 views
–1 vote
1 answer

How to import an account in private ethereum network?

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

answered Jan 9, 2019 in Blockchain by Omkar
• 69,220 points
1,568 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, 2019 in Blockchain by saeedi
• 120 points

edited Mar 6, 2019 by Omkar 2,476 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
1,923 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
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, 2019 in Blockchain by Omkar
• 69,220 points
1,560 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, 2019 in Blockchain by Omkar
• 69,220 points
3,108 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP