0

I have a cluster with 2 nodes and I would like to create a testnet by connecting them with geth.

I am using the following command:

Node1:
geth --datadir node1 --port 30302 --rpc --rpcport 3003 --rpcaddr 127.0.0.2 --ipcpath node1/geth.ipc --rpcapi="db,eth,net,web3,personal" --networkid 15 --rpccorsdomain "*" --ws --wsaddr 127.0.0.1 --wsport 3002 --wsorigins "*"

Node2:
geth --datadir node2 --port 30304 --rpc --rpcport 3005 --rpcaddr 127.0.0.2 --ipcpath node2/geth.ipc --rpcapi="db,eth,net,web3,personal" --networkid 15 --rpccorsdomain "*" --ws --wsaddr 127.0.0.1 --wsport 3004 --wsorigins "*"

and both work individually. When I try to add them as peer, if does not work

admin.addPeer("....@127.0.0.1:30304") 

Although the exit of this command is true, the peer is not added. Any idea?

  • You should add your solution as an answer, so it can help others. – Ismael Jan 14 at 6:48
0

SOLUTION: It is necessary to check the ip address of each node and write it to --rcpaddr yourip. Then: admin.addPeer("....@yourip:yourport")

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.