-
Notifications
You must be signed in to change notification settings - Fork 800
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
Add UPnP support for Lighthouse #927
Comments
For this one, I think we can just use igd: https://docs.rs/igd/0.10.0/igd/ I imagine we can run this in it's own thread. We don't need channels or shared memory as I don't think really care about the result (failed or not). If it succeeds, then the ports will be open externally, the local ENR sets the local TCP port regardless, see here: https://github.com/sigp/lighthouse/blob/enr-v0.2.0/beacon_node/eth2-libp2p/src/discovery/enr_helpers.rs#L86 So if the UPnP is successful, when the node connects to others, discv5 will do it's magic and update the IP to the un-NAT'd external IP and UDP ports. Therefore, I think it's sufficient to just spawn a thread, that takes a reference to a logger, and attempts to open the ports in the config. It should log failure or success, so at least the user knows. We should also add a CLI option to disable UPnP support if people like. I imagine the best place to spawn the thread is somewhere that has access to Should able to use the info in |
I've had a go at this at #1587 Could I request a review to see if this is on the right track? In addition, would one make the function asynchronous using the executor parameter that is being passed around the service function?
|
Adding UPnP support will help grow the DHT by allowing NAT traversal for peers with UPnP supported routers. ## Issue Addressed #927 ## Proposed Changes Using IGD library: https://docs.rs/igd/0.10.0/igd/ Adding the the libp2p tcp port and discovery udp port. If this fails it simply logs the attempt and moves on ## Additional Info Co-authored-by: Age Manning <Age@AgeManning.com>
Adding UPnP support will help grow the DHT by allowing NAT traversal for peers with UPnP supported routers. ## Issue Addressed #927 ## Proposed Changes Using IGD library: https://docs.rs/igd/0.10.0/igd/ Adding the the libp2p tcp port and discovery udp port. If this fails it simply logs the attempt and moves on ## Additional Info Co-authored-by: Age Manning <Age@AgeManning.com>
Resolved in #1587 |
Description
Adding UPnP support will help grow our DHT by allowing NAT traversal for peers with UPnP supported routers.
The modification is relatively trivial, however searching for the gateway and modifying ports should be done asynchronously.
The text was updated successfully, but these errors were encountered: