Open dariusc93 opened 1 year ago
This sounds like a great idea! We can follow the design in libp2p-kad
and - by default - do this automatically based on our external addresses with an option to override it.
Thoughts @mxinden @dariusc93 ?
@dariusc93 Can you investigate what go-libp2p
does here? Would you mind discussing this on the specs level? I think it would make sense to include this in an "implementation considerations" section.
General note, I am in favor of this proposal. Thank you @dariusc93 for suggesting it.
Seems like go-libp2p disables the relaysvc
(I am guessing the server side), when its reachability changes to private:
Description
Add a feature to [automatically and manually] enable and disable the relay v2 HOP protocol advertisement.
Motivation
Currently, when a local node runs with the relay v2 HOP behaviour, it would advertise its protocol regardless of if the node can be connected to or not, including if the node itself is connected to a relay where itself cannot be use the HOP protocol (though not sure if this will ever happen in the future if spec calls for this). Example would be if the node doesnt have an external address that the protocol would not be advertised until one is available (eg waiting for upnp or port mapping, autonat, etc)
Another reason would be if a node who is serving as a relay v2 HOP decides for whatever reason that they no longer wish to serve as a relay, they can disable its services at runtime without needing to reboot the node itself to disable it, giving more flexibility to the node itself.
Open questions
Are you planning to do it yourself in a pull request?
Maybe, if nobody else is interested in doing this