-
Notifications
You must be signed in to change notification settings - Fork 448
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
[discovery] Add support for AutoRelay #699
Comments
After discussing with @jacobheun I am planning on dividing this effort in a set of PRs as follows:
WIP NOTES: Milesone 1
Milestone 2
Milestone 3
Milesone 4
|
This is partially implemented from
|
Closing as CircuitRelay v2 has an equivalent auto relay feature built-in. |
AutoRelay enables libp2p nodes to dynamically find and bind to relays on the network. Once binding (listening) is done, the node can and should advertise its addresses to the network, allowing any other node to dial it over its bound relay(s). While direct connections to nodes are preferable, it's not always possible to do so due to NATs.
Use Cases
Finding Relays
A connected relay
The Circuit Relay module has the ability to ask connected nodes if they support the relay
HOP
protocol. If they do, the libp2p node can bind to that relay as a listener. A node should record a list of relays and use only a subset of those to avoid binding to a large number of relays, as this is not considerate to those relays./libp2p/circuit/relay/0.1.0
, it may ask that node if it supportHOP
.HOP
, libp2p should add it to its list of known relays./ip4/127.0.0.1/tcp/4001
.Remote Relays
When a node with AutoRelay enabled boots, it should search the network for the relay protocol,
/libp2p/relay
. This search may be done via one of several options leveraginglibp2p.contentRouting.findProviders()
. Depending on what features are turned on this may include: the DHT, Delegate Routing, and/or the Rendezvous Protocol (WIP).If a node does not have enough known relays connected, and is unable to connect to other known relays, it should query the network for more relays. This should be done with a backoff to avoid spamming queries.
References:
The text was updated successfully, but these errors were encountered: