Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A node in p2p mode should be able to be discoverable without providing it's external IP #2268

Open
derrix060 opened this issue Nov 17, 2024 · 0 comments
Assignees
Labels
Milestone

Comments

@derrix060
Copy link
Contributor

The problem

When a customer connects to the p2p network, they shouldn't need to specify their own public IP always. That's a bad UX.

For example, when one starts using a torrent client to download files, they don't need to figure out their public ip in order to get things moving, the torrent client takes care of ensuring the computer is discoverable by the peers and auto adjust.

Current State

As of Nov 2024, when a peer connects to the p2p network, it advertises it's private ip + public ip (if set in the args). These two get's advertised to the network and saved in the dht throught the addressFactory

As a first step to get the nodes from Juno be able to be used as "discover" nodes so people could connect to the network, I've made a first implementation in #2011 by adding a new flag where who ever is running juno could set their own public ip.

I also created a PoC with figuring out what's the public IP of a machine, and advertising it to the peers: See more

How to work on this issue

  1. Understand how to advertise the current node's address
  1. Enable relay service

    • Probably the EnableRelayService should still be turned on for the 'bootstrap' nodes (when I tested it was enabled)
    • It might be necessary to update the addressFactory to go throught the list of initial peers (bootstrap nodes) and advertise those IP
  2. Figure out how to do proper DCUtR

  • Once the connection is made throught the relay, we should try as soon as possible make that connection directly, otherwise the costs for having data being transfered throught the bootstrap nodes will make it expensive to run bootstrap nodes
    • holePunching is already enabled, so it might just work - need testing!
  • I'd avise looking at other projects that also use go-libp2p and see how they do. A good example is https://github.com/taubyte/tau and https://github.com/minaprotocol/mina
  1. Test with nodes running behind a NAT
  • For nodes running behind a NAT, the first step is to try to advertise to the NAT that we want to start listening to a specific port. This should be already enabled here, but it needs testing
  • Setup 2 nodes running behind 2 different NAT (for example 2 people from the team running their nodes on their local computers). Start the connection throught the relay, and then see if they will start connecting directly (even though the relay address will still have to be advertised and saved in the dht)
@derrix060 derrix060 added the P2P label Nov 17, 2024
@stranger80 stranger80 added this to the v0.14.0 milestone Nov 22, 2024
@AnkushinDaniil AnkushinDaniil self-assigned this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

3 participants