[Ethereum] admin.addPeer not working on private blockchain

go-ethereumjavascriptprivate-blockchain

I'm having so much trouble getting geth to talk to a private blockchain of Parity nodes. Here is where I am right now:

I have fired up geth with a custom data director and a genesis file that think should be a match for the Parity chain spec file.

But geth does not detect the Parity peers. So I add them manually using the JS console. The command returns "true" but then admin.peers shows no peers.

> admin.addPeer("enode:<string>:<port>")
true

> admin.peers
[]

Can anyone think of why this might be?

Best Answer

Can you make sure when you use admin.addPeer() both the above instances are running?

You can either use geth instance or geth console. (use ipc: ~your datadir/... after the above command if your ipc is in a non-default folder).

Also if both these two nodes are on the same machine, you can use 127.0.0.1 as the IP address if the external IP address doesn't work.

Give it try and let me know.

Related Topic