4

I'm currently running geth.

I have 4 nodes in my network and I'm willing to make them interact with each other.

On host-01, I've run:

geth --identity "Node1" --genesis /tmp/eth/genesis.json --rpc --rpcport \
    "8001" --rpccorsdomain "*" --datadir /tmp/eth/60/01/ --port "30301" \
    --nodiscover -ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" \
    -rpcapi "db,eth,net,web3" --autodag --networkid 4828 --nat \
    "any" console 2>> /tmp/eth/60/01.log

On host-02, I've copied the genesis.json file from host-01, and ran the same command, just changing the --identity argument.

Now I'm trying to make them talk to each other. I've obtained host-01 enode:

admin.nodeInfo.enode

this gave me a string like:

"enode://6380bf79e7900309ac71612835f...@[::]:30301?discport=0"

Then, on host-02, I've run in the console:

admin.addPeer("enode://6380bf79e7900309ac71612835f...@[::]:30301?discport=0")

The result is true, but when I run:

admin.peers

it shows me an empty list.

What am I missing?


Edit

Additional info: The hosts do see each other in the network (tested via ping) and the ports are up (tested via telnet), although the connection only keeps open for approximately 1 sec. Not sure if this is the problem.

Henrique Barcelos
  • 2,481
  • 4
  • 20
  • 38

1 Answers1

5

Shame on me!

I've forgotten to change the network interface to reflect the actual IP address of the other node:

admin.addPeer("enode://6380bf79e7900309ac71612835f...@<HOST-02 IP HERE>:30301?discport=0")

Now works perfectly.

Henrique Barcelos
  • 2,481
  • 4
  • 20
  • 38