0

I am new to ethereum.And could you please tell me the proper use of addpeer to connect two nodes in a single machine.?

1
  • do not forget to add --nodiscover flag and also --maxpeers = 2
    – Nulik
    Commented Mar 1, 2018 at 21:03

1 Answer 1

0

In the first terminal do the following command

 admin.nodeInfo.enode 

It returns the enode url.Its a unique id for nodes to communicate with each other.

In the second terminal do the addPeer command.

admin.addPeer(“enode_url_u_just_get_from_the_first_terminal”)

To check if the node is successfully added using the following command :-

  web3.net.peerCount

Not the answer you're looking for? Browse other questions tagged or ask your own question.