Skip to content
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

Merged
merged 2 commits into from
Nov 6, 2019
Merged

feat: peer store #470

merged 2 commits into from
Nov 6, 2019

Conversation

vasco-santos
Copy link
Member

@vasco-santos vasco-santos commented Nov 1, 2019

Initial implementation of peer-store, which will replace libp2p/js-peer-book, using the same name as go-libp2p, being this the initial step for libp2p/js-libp2p#453, as well as for the new version of peer-store, which we will be working on after the refactor.

Work extracted from #467

src/peer-store/index.js Outdated Show resolved Hide resolved
src/peer-store/index.js Outdated Show resolved Hide resolved
src/peer-store/index.js Outdated Show resolved Hide resolved
src/peer-store/index.js Outdated Show resolved Hide resolved
const peerInfo = getPeerInfo(connection.remotePeer)

peerInfo.protocols.add(stream.protocol)
this.peerStore.put(peerInfo)
Copy link
Contributor

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

src/peer-store/index.js Outdated Show resolved Hide resolved
test/peer-store/peer-store.spec.js Outdated Show resolved Hide resolved
test/peer-store/peer-store.spec.js Show resolved Hide resolved
test/peer-store/peer-store.spec.js Outdated Show resolved Hide resolved
test/peer-store/peer-store.spec.js Show resolved Hide resolved
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
Copy link
Contributor

@jacobheun jacobheun left a 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. 🚀

@jacobheun jacobheun merged commit 53bcd2d into refactor/async-await Nov 6, 2019
@jacobheun jacobheun deleted the feat/peer-store branch November 6, 2019 14:11
dirkmc pushed a commit that referenced this pull request Nov 26, 2019
* feat: peer-store v0

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
dirkmc pushed a commit that referenced this pull request Nov 26, 2019
* feat: peer-store v0

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
jacobheun added a commit that referenced this pull request Dec 12, 2019
* feat: peer-store v0

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
jacobheun added a commit that referenced this pull request Jan 24, 2020
* feat: peer-store v0

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
maschad pushed a commit to maschad/js-libp2p that referenced this pull request Jun 21, 2023
Otherwise the log displays `[object Object]`
maschad pushed a commit to maschad/js-libp2p that referenced this pull request Jun 21, 2023
## [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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants