-
Notifications
You must be signed in to change notification settings - Fork 1.1k
How do I test autorelay? #487
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
There is no dependency loop; you pass it a constructor which takes a host, and can then construct the dht from that host. |
Btw, I am working on adding the feature to ipfs, will open pr in the next couple of days. |
The only concrete type I could find implements |
You have a libp2p.New(..., libp2p.Routing(func(h host.Host) (routing.PeerRouting, error) {
// make the DHT with the given Host
return dht.New(ctx, h, opts...)
})) |
Thanks, I'll try again.
vyzo <[email protected]> 于 2018年11月19日周一 19:22写道:
… You have a Host object in the constructor.
So:
libp2p.New(..., libp2p.Routing(func(h host.Host) (routing.PeerRouting, error) {
// make the DHT with the given Host
return dht.New(ctx, h, opts...)
}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#487 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABHft-CIx45501Rvut0F8-oNd5FBZ_4Vks5uwpRjgaJpZM4Yo0Ua>
.
|
For ipfs integration see ipfs/kubo#5785 |
In
go-ipfs
, DHT service is initialized after libp2p, instartOnlineServicesWithHost
:(https://github.com/ipfs/go-ipfs/blob/31099e882469fab12a98f2069e38c847f0b1188c/core/core.go#L264-L272)
But the new autorelay feature requires
cfg.Routing
, which is DHT service:go-libp2p/config/config.go
Lines 169 to 198 in 4341acb
So we have a dependency loop here(the reason why refactoring is necessary) and I just can't enable the feature. Now I only need a somewhat hacky way to test the feature, I'd like to know what did you do in your tests?
(btw, I had an idea about refactoring, I'll write some snippets to elaborate the idea if interested)
The text was updated successfully, but these errors were encountered: