-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Circuit Relay Integration #209
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
Comments
Summoning @whyrusleeping @lgierth @Stebalien @diasdavid |
cc @dryajov |
I'm not familiar with the go terminology or codebase, so can't provide any insights into that, but I can provide a quick overview of where circuit integrates in the js code, and hopefully give some more perspective for the go implementation. So, circuit is bootstrapped by libp2p, and receives the Other than that, during bootstrap, if no explicit These are some pretty arbitrary assumptions I had to resort to when implementing in order to be able to move it forward, but now that the spec is ready it might be a good point to reevaluate them. To summarize:
|
This also brings up a secondary issue, which is address filtering. Right now, when you register the relay as a transport (which plugs into swarm), it will also add a listen address There is no relay discovery, the relay-prefixed addresses will need to be added through the AddressFactory filter, which could also proceed to filter away the unspecific listen address. |
Per discussion with @whyrusleeping on irc, we also need to consider whether we should filter the unspecific circuit address ( One way to approach connecting to unspecific addresses, is to have the One problem with this approach is that we need a heuristic in the dialer as to when to use the relay address. Ideally, we want the relay address to be a fallback for when it's impossible to connect directly to the peer. |
State of World circuit v0.1.0 Implementation:
PR#4: Relay Discovery and unspecific address dialing (libp2p/go-libp2p-circuit#4)
TBD:
|
This has long since been implemented. |
* bump go.mod to Go 1.16 and run go fix * run go mod tidy * run gofmt -s * update .github/workflows/automerge.yml * update .github/workflows/go-test.yml * update .github/workflows/go-check.yml Co-authored-by: web3-bot <[email protected]>
The go-libp2p-circut relay code can integrate with any Host that has a swarm network by using the
circuit.AddRelayTransport
function.This gives us some alternatives to integrating with go-libp2p:
BasicHost
, as an option toNewBasicHost
.RoutedHost
, by modifying theWrap
function or adding a new constructor.Ideally, we would want to integrate with libp2p so that it's always available, but there is a difference in the two integrations in terms of capabilities of the relay, modulo #207:
RoutedHost.NewStream
can do peer lookup (RoutedHost: NewStream ensures we have the means to connect to the peer #208), then it is preferable to integrate withRoutedHost
so that we can support dialing to unspecific relay addresses and active relayRoutedHost.NewStream
will not ever do peer address discovery,, then the distinction is moot and we can just integrate through options in theNewBasicHost
constructor.Let's discuss integration approach, in terms of code complexity it's all very straightforward.
The text was updated successfully, but these errors were encountered: