-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
update the peerstore, change the peerstore option #1256
Conversation
c594561
to
4fd8ff8
Compare
p2p/host/basic/basic_host.go
Outdated
@@ -148,6 +148,9 @@ type HostOpts struct { | |||
// DisableSignedPeerRecord disables the generation of Signed Peer Records on this host. | |||
DisableSignedPeerRecord bool | |||
|
|||
// EventBus must be set. | |||
EventBus event.Bus |
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.
This is annoying. NewHost
will panic if the EventBus
is not set.
Should we make the event.Bus
a function parameter of NewHost
?
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.
that sounds like the right thing to do
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 am beginning to suspect we should have put the pstore manager in the host ans avoided this mess... oh well.
4fd8ff8
to
2282223
Compare
I had the same thought. But logically, it does belong to the peerstore and not to the host. I suppose the long-term answer here is dependency injection, but I don't want to cross that bridge now. |
Agree very much with @vyzo on: #1256 (review). FWIW, quoting myself from libp2p/go-libp2p-peerstore#186 (comment):
|
No description provided.