8

Is there a way to enable automatic peer discovery in a private network. As far as I know, the only way to connect to peers while operating on a private blockchain is to add them through addPeer() command. For a private network with many nodes, this process is not efficient. Is anything being implemented to automatically connect all the nodes running on the same networkid and having the same genesis block?

Having bootnodes is an option but I have to manually add any new nodes. I am looking for a simpler solution.

How are the connections generally managed in a private network? Did anyone work on an efficient solution to address this issue? Any pointers?

Related:

What are the peer discovery mechanisms involved in Ethereum?

Peer discovery not working on private network

2 Answers 2

8

No, there is no peer discovery methods other than modifying the boot nodes.

The IP addresses are configured in the source code of the clients. If the IP changes, the list of the last bootstrap node that it connected to will change (the old IP will be removed and when the node connects again the new IP will be stored in the list).

What are the peer discovery mechanisms involved in Ethereum? explains a lot.

4

In a private chain the discovery protocol didn't work. you have one of 2 options use --bootnodes or a static file /static-nodes.json where you store your nodes.

Idea : you could write a simple code which scan the network and add the nodes to the nodes json file.

read also : Peer discovery not working on private network

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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