I have created a private blockchain on two different machines. Now I want these nodes to connect with each other as "peers". I am using geth
console.
I have tried the following command:
> admin.addPeer("enode://3414c01c19aa75a34f2dbd2f8d0898dc79d6b219ad77f8155abf1a287ce2ba60f14998a3a98c0cf14915eab[email protected]:30301");
Here 10.10.23.196
is the IP of the 2nd machine and 30301
is the port on which it's running.
A true
value is displayed but when I type:
> admin.peers
[]
is displayed.
Is there something wrong with the approach? If it helps I am using following command to run the geth in both machines.
geth --identity "Sukhi" --genesis CustomGenesis.json \
--rpc --rpcport "8001" --rpccorsdomain "*" \
--datadir "chaindata" --port "30301" \
--ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" \
--rpcapi "db,eth,net,web3" --autodag --networkid 1900 --nat "any" console
Moreover, the same procedure works for two unique nodes on the same machine.