3

The rasberry pi and my laptop are using same network

From my laptop admin.addPeer("enode from above rasberrypi")

enode://6179e58bb512415a76e4169dd25ae5a171e34069660b233cf79dabd3581d8dd1221a7f3a5e5d64251aa7e8ac20eda5430e42eed161e68cb05d05e6c3cab68a6e@publicip:port

When i run admin.nodeInfo.enode i get a different IP and when i check it from my http://www.whatismypublicip.com/ it returns some different IP Which IP should i use while connecting the 2 nodes while net.peerCount still remains 0 even if it returns true . Is their any configuration that needs to be taken care of ? What is the command if i want to include genesis also at the time of node creation

  • 1
    If you're operating from the same network, you need the private IP address of your raspberry pi. You can get that by using ifconfig. The admin.nodeInfo.enode shows the private IP address and the website you referred to shows the public IP address. Hence, the confusion. – galahad Aug 22 '16 at 14:17
2

On both nodes, you need to run the same genesis commands:

geth --datadir /where/ever init /your/genesis.json

And the same launch command:

geth --datadir /where/ever --networkid A_NUMBER

Your admin.addPeer() command is correct. Make sure that the long hex part of the enode of your laptop and Raspberry are different. If they are the same, delete the /where/ever/nodekey file and start again.

As for the Raspberry's IP, you should get it with ifconfig instead. Confirm that your laptop can connect to Geth on the Raspberry with telnet IP_ADDRESS 30303.

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.