I am attempting to have a second node sync up with an original node.

I had previously synced two nodes from the get-go but am unable to add a peer to an already running blockchain. In other words I want to add a peer to an already running network either for the first time or after a disconnect.

I have instantiated and started the chains with the same commands

geth --datadir test/ --maxpeers 55 --nodiscover init genesis.json

geth --datadir test/ --networkid 1234321 console 2>> myEth.log

And they have the same genesis.json files

  "config": {
        "chainId": 1234321,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
  "alloc"      : {},
  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x20000",
  "extraData"  : "",
  "gasLimit"   : "0x2fefd8",
  "nonce"      : "0x0000000000000042",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"

What am I doing wrong? Is there some command I must use to make them sync and peer?

I have already tried admin.addPeer()

1 Answer 1


You need to attach themself manually with


You can obtain the enodeid on the other node with admin.nodeInfo.enode

They cannot discover each other automatically as bootstrap nodes are required, however you can either preload a javascript script with all the admin.addPeer you need, or, alternatively you can create a json <datadir>/geth/static-nodes.json with this format

  • Yes, this is what i did to initiate contact but I think when I changed IP addresses or lost connectivity the syncing stopped and the peers were dropped..
    – 0TTT0
    Jan 23, 2019 at 17:06
  • 1
    It dropped because each time the nodes lose connectivity or change IP, it needs to reconnect to the other nodes. Also, if it changes IP, the other node cannot know the new IP, as there's no discovery, so, yeah, don't change IP. to make them reconnect, put the admin.addPeer you need in a preloaded javascript file or create the static-nodes.json file
    – waytosay
    Jan 23, 2019 at 17:37
  • I had three nodes running and synched, i stopped them from mining and then waited a couple days came back and the blockchain had been reset to block 0... what could have happened?
    – 0TTT0
    Jan 25, 2019 at 17:47
  • Did it go to 0 on all three nodes or just one or two? It could be possible, if not all of them, that the ones that went to zero at some point failed to syncronize with the other nodes. It is something that can happen with a very low difficulty and blocktime, in that case you can wipe the datadir of your faulty node and resync it
    – waytosay
    Jan 28, 2019 at 17:19

Your Answer

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

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