Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
2993fd9a
Commit
2993fd9a
authored
6 years ago
by
vyzo
Browse files
Options
Download
Email Patches
Plain Diff
add autorelay documentation
parent
a7e1bf0f
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
p2p/host/relay/doc.go
+28
-0
p2p/host/relay/doc.go
with
28 additions
and
0 deletions
+28
-0
p2p/host/relay/doc.go
0 → 100644
View file @
2993fd9a
/*
The relay package contains host implementations that automatically
advertise relay addresses when the presence of NAT is detected. This
feature is dubbed `autorelay`.
System Components:
- AutoNATService instances -- see https://github.com/libp2p/go-libp2p-autonat-svc
- One or more relays, instances of `RelayHost`
- The autorelayed hosts, instances of `AutoRelayHost`.
How it works:
- `AutoNATService` instances are instantiated in the
bootstrappers (or other well known publicly reachable hosts)
- `RelayHost`s are constructed with
`libp2p.New(libp2p.EnableRelay(circuit.OptHop), libp2p.Routing(makeDHT))`.
They provide Relay Hop services, and advertise through the DHT
in the `/libp2p/relay` namespace
- `AutoRelayHost`s are constructed with `libp2p.New(libp2p.Routing(makeDHT))`
They passively discover autonat service instances and test dialability of
their listen address set through them. When the presence of NAT is detected,
they discover relays through the DHT, connect to some of them and begin
advertising relay addresses. The new set of addresses is propagated to
connected peers through the `identify/push` protocol.
*/
package
relay
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help