I have created a node in my laptop. Now I want my friend (from his home) to connect to the node I created. We are part of two different networks. How can these two nodes be connected in ethereum. What are the geth commands that I should use?
You have two options:
- Open up port 303030 on your router, and provide your friend with your
enodeURL. Make sure to update it to include your public IP. This may not be possible depending on your ISPs settings, and how often your public IP changes (which can be fairly often for residential connections).
- You and your friend set up a VPN which allows you to communicate as if you were on the same local network, and use the
enodeURL via the VPN network
However, more often than not, you only need to connect to the RPC instead of the node directly. In that case, repeat the steps above with port 8545 instead.