OBJECTION to duplicate problem: The supposed duplicate answer DOES NOT work. The problem wording is similar but the problem itself requires a different solution.

I created a local private chain like below

geth --genesis ...CustomGenesis.json --verbosity 6 --datadir ...customchain1\chain --identity SomeChain --blockchainversion 12 --networkid 123 --rpcport 8101 --maxpeers 15 console 

Launching the wallet, I have to skip peer search because it never finishes. After opening I can see I'm in PRIVATE-NET but with 0 peers.

I noticed I needed 12 peers for validation of contracts so I tried creating 1-2 nodes to see if this would work. I used below tutorial and some others I forgot.


Initially, I created another folder with geth.exe in it. then used the below command on a seperate console while the main geth.exe was already running.

geth --datadir="...\customchain1\node1\chain" --verbosity 6 --networkid 123 --ipcdisable --port 30302 --rpcport 8102 console

I used admin.nodeInfo.enode on the node geth console to get enode value. Then used below command on the primary geth console to add as peer.


EDIT Adding " before and after enode returns true but admin.peers returns nothing still.

This returns (anonymous): Line 1:20 Unexpected token :

I then copied the genesis file I used to create the blockchain, deleted everything else and ran the exact same command within the node folder. I retrieved the enode line and tried again. The error was the same.

Am I misunderstanding how this should work or is there something else I'm missing?

Thank you.

EDIT Almost There Some logs I captured. Seems that they do almost connect then drop due to mismatched networkID but where the hell does it get that number from? I have nothing with networkID 1602902873 and I explicitly state the networkID differently in all commands.

10:42:11.869273 p2p/server.go:428] new task: static dial 07837c0f7f31ad77
10:42:11.869273 p2p/server.go:428] new task: static dial b708f0574d3b88af
10:42:11.869273 p2p/server.go:428] new task: static dial 38754ca3bd38f3b7
10:42:11.869273 p2p/server.go:428] new task: discovery lookup
10:42:11.869273 p2p/dial.go:263] dial tcp (07837c0f7f31)
10:42:11.870275 p2p/dial.go:263] dial tcp (b708f0574d3b)
10:42:11.870275 p2p/dial.go:263] dial tcp (38754ca3bd38) 
10:42:11.876277 p2p/server.go:477] <-posthandshake: static dial conn 07837c0f7f31ad77 
10:42:11.877278 p2p/server.go:477] <-posthandshake: static dial conn b708f0574d3b88af
10:42:11.878279 p2p/server.go:483] <-addpeer: static dial conn 07837c0f7f31ad77
10:42:11.878279 p2p/server.go:672] Added Peer 07837c0f7f31ad77
10:42:11.878279 p2p/server.go:467] <-taskdone: static dial 07837c0f7f31ad77
10:42:11.878279 p2p/peer.go:301] Peer 07837c0f7f31ad77 Starting protocol eth/63
10:42:11.879280 eth/handler.go:231] Peer 07837c0f7f31ad77 [eth/63]: peer connected [Geth/v1.4.4-stable/windows/go1.5.1/CustomChainPOCNode2]
10:42:11.879280 p2p/server.go:483] <-addpeer: static dial conn b708f0574d3b88af
10:42:11.879280 p2p/server.go:672] Added Peer b708f0574d3b88af
10:42:11.879280 eth/handler.go:236] Peer 07837c0f7f31ad77 [eth/63]: handshake failed: NetworkId mismatch - 1602902873 (!= 123)
10:42:11.879280 p2p/peer.go:308] Peer 07837c0f7f31ad77 Protocol eth/63 error: NetworkId mismatch - 1602902873 (!= 123)
10:42:11.879280 p2p/peer.go:177] Peer 07837c0f7f31ad77 protocol error: NetworkId mismatch - 1602902873 (!= 123) (Subprotocol error)
10:42:11.879280 p2p/server.go:477] <-posthandshake: static dial conn 38754ca3bd38f3b7
10:42:11.880280 p2p/server.go:467] <-taskdone: static dial b708f0574d3b88af
10:42:11.882281 p2p/peer.go:301] Peer b708f0574d3b88af Starting protocol eth/63
10:42:11.882281 eth/handler.go:231] Peer b708f0574d3b88af [eth/63]: peer connected [Geth/v1.4.4-stable/windows/go1.5.1/CustomChainPOCNode1]
10:42:11.882281 eth/handler.go:236] Peer b708f0574d3b88af [eth/63]: handshake failed: NetworkId mismatch - 1602902873 (!= 123)
10:42:11.884283 p2p/peer.go:308] Peer b708f0574d3b88af Protocol eth/63 error: NetworkId mismatch - 1602902873 (!= 123)
10:42:11.884283 p2p/peer.go:177] Peer b708f0574d3b88af protocol error: NetworkId mismatch - 1602902873 (!= 123) (Subprotocol error)
10:42:11.881281 p2p/server.go:626] static dial conn 38754ca3bd38f3b7 failed checkpoint posthandshake: Connected to self
10:42:11.882281 p2p/server.go:499] <-delpeer: Peer 07837c0f7f31ad77
10:42:11.888287 p2p/server.go:467] <-taskdone: static dial 38754ca3bd38f3b7
10:42:11.888287 p2p/server.go:499] <-delpeer: Peer b708f0574d3b88af
10:42:11.882281 p2p/server.go:688] Removed Peer 07837c0f7f31ad77 (Subprotocol error)
10:42:11.890288 p2p/server.go:688] Removed Peer b708f0574d3b88af (Subprotocol error)

SHAME...SHAME...SHAME...bell rings So while trying to understand how a random magical networkID appears instead of the one I gave. I noticed it was an Integer if written without quotes. I had a number beyond the max int value. When I fixed it to something acceptable it worked immediately.


2 Answers 2


In the admin.addPeer() function, you'll have to mention the IP address in the place of [::]. It looks like you're working on the same workstation. In this case, mention the localhost address while adding a peer. Your command should be:


Similarly, if you're working on a different workstation in the local network, you need to use the private IP address.

You need to use the same genesis file and network ID for all the nodes. Every node should have a different port #, different rpc port #, and a different data directory(if working on the same system).

Check this page for more info.

  • 2
    I cleared node chain files, then recreated using the same genesis as geth --genesis ...\customchain1\node1\CustomGenesis.json --datadir ...\customchain1\node1\chain --networkid 123 --ipcpath ~/Library/Ethereum/node1/geth.ipc --port 30302 --rpcport 8102 --maxpeers 15 console Different ports and ipcpath for node2. Then got the enodes and used addPeer with IP. I tried from primary node and new nodes. All returned true but admin.peers is empty in all nodes :(
    – mechanicum
    Jun 17, 2016 at 13:28
  • 1
    Check whether net.listening returns true before adding the peers. Check with net.peerCount if you actually have the peers connected. Please check this link and let me know if you still have problems.
    – galahad
    Jun 17, 2016 at 14:09
  • 1
    its true. peerCount is 0 always. I did the exact same geth commands in the link. Updating the question text.
    – mechanicum
    Jun 17, 2016 at 14:27
  • 1
    Please note that the enode URL changes every time you create a new instance with different parameters. You don't need to add "enode://pubkey@ip:port" to the static.json file. I recommend you delete everything and start over the process with the same genesis file and different empty datadirs.
    – galahad
    Jun 17, 2016 at 15:13
  • 1
    I think we are really close now. Your suggestion with the static IP fix removed the letter error that was popping up all the time and made the true problem finally visible. Thank you for your time and effort.
    – mechanicum
    Jun 20, 2016 at 7:58

First problem was the wrong syntax in the static-nodes.json as @galahad pointed out. Below is the correct one.


Second was the wrong networkID nodes were trying to connect with. After solving the above error it kept throwing networkID mismatch errors when trying to connect. It assigned a random int ID when the one I have was above max value. Getting networkID below max int value solved that problem.

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.