2

i'm setting two local nodes on the same computer as different users (two different sessions). The problem is that i can't make them be peers.

Command to wake main node:

geth    --identity "MainNode" \
        --rpc \
        --rpcport 8000 \
        --rpccorsdomain "*" \
        --datadir "/home/ubuntu/ethereum" \
        --port "30303" \
        --nodiscover \
        --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" \
        --rpcapi "db,eth,net,web3" \
        --autodag \
        --networkid 10165211 \
        --nat "any" console init /home/ubuntu/ethereum/CustomGenesis.json

Command to wake second node:

geth    --identity "My Node" \
        --rpc \
        --rpcport 8001 \
        --rpccorsdomain "*" \
        --datadir "/home/xxxx/ethereum" \
        --port "30304" \
        --nodiscover \
        --ipcdisable \
        --rpcapi "db,eth,net,web3" \
        --autodag \
        --networkid 10165211 \
        --nat "any" console init /home/xxxx/ethereum/CustomGenesis.json

But when i start the nodes, and i use the command admin.nodeInfo i find this in the first node:

admin.nodeInfo
{
  enode: "enode://34f8ec977f25f4a85d4d7debac748fd82851b75ca670b2ece234c9a26a493fb995fca0021b9eee6cb2ccfa98a934cdb4a8590e4a4140a1077575f94a82468129@[::]:30303?discport=0",
  id: "34f8ec977f25f4a85d4d7debac748fd82851b75ca670b2ece234c9a26a493fb995fca0021b9eee6cb2ccfa98a934cdb4a8590e4a4140a1077575f94a82468129",
  ip: "::",
  listenAddr: "[::]:30303",
  name: "Geth/v1.4.12-stable/linux/go1.5.1/MainNode",
  ports: {
    discovery: 0,
    listener: 30303
  },
  protocols: {
    eth: {
      difficulty: 17179869184,
      genesis: "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
      head: "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
      network: 10165211
    }
  }
}

And THIS, on the second one:

 admin.nodeInfo
{
  enode: "enode://34f8ec977f25f4a85d4d7debac748fd82851b75ca670b2ece234c9a26a493fb995fca0021b9eee6cb2ccfa98a934cdb4a8590e4a4140a1077575f94a82468129@[::]:30304?discport=0",
  id: "34f8ec977f25f4a85d4d7debac748fd82851b75ca670b2ece234c9a26a493fb995fca0021b9eee6cb2ccfa98a934cdb4a8590e4a4140a1077575f94a82468129",
  ip: "::",
  listenAddr: "[::]:30304",
  name: "Geth/v1.4.12-stable/linux/go1.5.1/My Node",
  ports: {
    discovery: 0,
    listener: 30304
  },
  protocols: {
    eth: {
      difficulty: 1024,
      genesis: "0x1a8c903ab9d8b7bec7ba8b15dab33a3418c90dbf8f73ec3086d34b4e17e017e6",
      head: "0x1a8c903ab9d8b7bec7ba8b15dab33a3418c90dbf8f73ec3086d34b4e17e017e6",
      network: 10165211
    }
  }
}

Even when the CustomGenesis.json file is a pure copy of each other (completely) we can see some strange things:

  • the enode ID is the same in both cases. It should not be.
  • The port changes (obviously it must be done that way). It's OK.
  • The difficulty is not the same, it should be.
  • The genesis hash and the head are not the same. I guess they should be.

I'm sure is not a Genesis.json file problem, as i've even tried to use the same file for both nodes but the same i'm explaining here happenned to me.

Any idea on where's the error/mistake/bug?

THANK YOU.

  • The difficulty is not the same,node 2 not sync with the whole blockchain. – Mohammed Sep 29 '16 at 13:50
  • 1
    Are you using different datadirs? Also, what do you mean by two sessions? I think you're accessing the same datadir from both the sessions. – galahad Sep 30 '16 at 0:07
  • I am not, i got different datadirs as you can see in the code. Two sessions: two different user-sessions (xxxx and ubuntu). – KanekiDev Sep 30 '16 at 6:43
0

Solution for me:

When this happens, it may seem to be a corruption of some data. The solution is as easy as deleting every datadir and subfolders. This will mean you to start from zero (or saving some data, as accounts if you backup them before) but it worked.

In my case:

sudo rm -r /home/ubuntu/ethereum/
sudo rm -r /home/ubuntu/.ethereum/
sudo rm -r /home/xxxx/ethereum

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.