-
Notifications
You must be signed in to change notification settings - Fork 445
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
feat: peer store #470
feat: peer store #470
Conversation
28b3b06
to
284db17
Compare
284db17
to
3468fca
Compare
const peerInfo = getPeerInfo(connection.remotePeer) | ||
|
||
peerInfo.protocols.add(stream.protocol) | ||
this.peerStore.put(peerInfo) |
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 will only put to the peer store if protocols are given. If .dial
is called, it calls .dialProtocol
in turn without protocols, so the peer info might not get saved
170ead1
to
51a23d6
Compare
51a23d6
to
1c77705
Compare
1c77705
to
83c6cde
Compare
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
83c6cde
to
2f1f2c7
Compare
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 looks good. I will need to refactor some things as part of the Identify refactor, but that doesn't need to hold this up. 🚀
* feat: peer-store v0 * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
* feat: peer-store v0 * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
* feat: peer-store v0 * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
* feat: peer-store v0 * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
Otherwise the log displays `[object Object]`
## [9.1.5](libp2p/js-libp2p-kad-dht@v9.1.4...v9.1.5) (2023-05-05) ### Bug Fixes * log peer id not whole object ([libp2p#470](libp2p/js-libp2p-kad-dht#470)) ([e9efb7f](libp2p/js-libp2p-kad-dht@e9efb7f)) * only choose query peers after initial self-query has run ([libp2p#471](libp2p/js-libp2p-kad-dht#471)) ([4d05154](libp2p/js-libp2p-kad-dht@4d05154))
Initial implementation of
peer-store
, which will replace libp2p/js-peer-book, using the same name asgo-libp2p
, being this the initial step for libp2p/js-libp2p#453, as well as for the new version ofpeer-store
, which we will be working on after the refactor.Work extracted from #467