So, I started 2 nodes on my private net using geth, with custom genesis file, different port numbers, all how it was supposed to be. In one instance I added the admin.nodeInfo.enode
of the other and two nodes were perfectly in sync. I mined on one and the second had the same block number as the first. Brilliant. However, after restart the nodes were not peers anymore and I had to type admin.addPeer()
again in order to sync them. Is there a way to sync the nodes without manually adding the peers?
To clarify, I did not use the --nodiscover
flag so I think there should be some way the first node to discover second wtihout manual typing.
I know you can sync two nodes without admin.addPeer()
if you declare the admin.nodeInfo.enode
of the other in static-nodes.json
located in the data dir of the first. But that also requiers manual entering. I want to know if there is another, simpler way.