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?

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

  • You should add your solution as an answer, so it can help others. – Ismael yesterday

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.