Connect 2 peers running on different networks
How do I connect 2 peers running on the cloud? I can't bind a peer to a public IP address, and I can't listen on 0.0.0.0, as peers won't know who to talk to. Is there a way I can get 2 peers to talk that are not on the same network? By "connect" I mean I want both peers to have each other in their routing table
I think you need another node with a public IP address. First, the 2 peers connect to the public node and then each peer can discover the other by querying the public node.
The two nodes need to be able to contact each other. If they are on two different networks, lets say, 10.0.0.0/24 and 10.0.1.0/24.
They need a gateway to talk to each other, either by the internet, or assuming a private network, a router.
Each node listens on its interface, i.e 10.0.0.23 and sets this IP as its ENR ip. It should also set the ENR UDP port it is listening on.
If both nodes do this and they can contact each other, when running discv5, add the ENR to the routing table on start via add_enr they should be fine to connect to each other.