4

I have two ubuntu systems with ethereum installed. I started the node in each system using the following command : -

geth --datadir 'path of node folder' init 'path of genesis.json'
geth --datadir 'path of node folder' --networkid 12512 console

The systems are connected to a local network. The genesis file in both the systems are same. The time is in sync. But when I execute admin.addPeer("enode@ip:port"), I am getting net.peerCount as 0. There was no error while pinging the ip from one system to the other. Executing 'netstat -ntpl' gave the following:

machine 1: tcp6 0 0 :::30303 :::* LISTEN 3423/geth
machine 2: tcp6 0 0 :::30303 :::* LISTEN 3028/geth

Any help is appreciated.

  • 1
    Possible duplicate of Peer discovery not working on private network – niksmac Nov 25 '16 at 16:04
  • add --nodiscover to geth nodes to stop default discovery. – Raj Nov 28 '16 at 3:28
  • This is not a duplicate, since in the other question the solution was to manually add peers. In this question, the OP did not make this mistake, so the solution will necessarily be different. – Tjaden Hess Nov 29 '16 at 1:32
4

There were two things I needed to do:

1. Turn on UPnP in my network settings.

2. 'Genesis block mismatch'. Though I had the same genesis file in both the nodes I was getting this error. So I replaced it with the following:-

{
  "nonce": "0x0000000000000042",
  "timestamp": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "extraData": "0x0",
  "gasLimit": "0x8000000",
  "difficulty": "0x400",
  "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x3333333333333333333333333333333333333333",
  "alloc": {
   }
}

from https://souptacular.gitbooks.io/ethereum-tutorials-and-tips-by-hudson/content/private-chain.html"

This resolved the connectivity issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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