1

I am trying to set 2 peer in 1 computer(win 10).

As I saw some question like what I am asking, I init 2 client with same genesis.json, and open 2 cmd for console.

the 1st cmd runs:

geth --networkid 1000 --nodiscover --port 30303 --datadir C:\bc\geth\client\00 --rpc --rpcapi net,eth,web3,personal --rpcaddr 127.0.0.1 --ipcdisable console

the 2nd cmd runs:

geth --networkid 1001 --nodiscover --port 30304 --datadir C:\bc\geth\client\01 --rpc --rpcapi net,eth,web3,personal --rpcaddr 127.0.0.1 --rpcport 8546 --ipcdisable console

then I try to add peer in 2nd console:

admin.addPeer("enode://e0e5b8211d7ad85414dd54298ed1c9d96476611f19548652efadb6af5dbf714ef6bd7d5830e1bcfcc441c223e37e65d9c897697ced6a556307cae5970f8c195c@127.0.0.1:30303?discport=0")

It show "true", but when I check the peers with admin.peers, get "[]", net.peerCount return 0.

1

In 1st command you have added network id as 1000 and in 2nd cmd you have added network id as 1001. To add peers you need to give same network id to both. So keep it 1000 or 1001 in both commands

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.