-
Notifications
You must be signed in to change notification settings - Fork 226
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
custom ProviderManager that brokers AddrInfos #751
Conversation
providers/providers_manager.go
Outdated
@@ -269,7 +284,7 @@ func (pm *ProviderManager) GetProviders(ctx context.Context, k []byte) []peer.ID | |||
case <-ctx.Done(): | |||
return nil | |||
case peers := <-gp.resp: | |||
return peers | |||
return peerstore_legacy.PeerInfos(pm.pstore, peers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use peerstore.AddrInfos here, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. The newer peerstore does not have this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only present in go-libp2p-core v0.9.0 and up, however bumping to this release introduces a ton of other problems. Many of the libraries that this repo depends on, as well as the tests in the repo, are incompatible with v0.9.0 and up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm... ok I guess. We're going to be using the later go-libp2p-core anyway in places like go-ipfs, but we can leave this for now.
In that case I wouldn't call the other one peerstore_legacy, it's where the common peerstore implementations live and definitely isn't legacy. Perhaps peerstore_impl or something like that.
@aschmahmann You can do another review round here. |
@petar CI is failing due to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, aside from one nit + one double check on a test. Merge when ready
ProvidersOptions
has been removed. It was used to pass options to the defaultProviderManager
. Going forward, users can create their own instance ofProviderManager
and pass it in using the newProviderStore
DHT option.Addresses #749 (comment)