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: returned peer multiaddrs include peerIds #1961

Closed

Conversation

SgtPooki
Copy link
Member

@SgtPooki SgtPooki commented Aug 11, 2023

This PR addresses some concerns brought up in #1959 that I discussed with @achingbrain.

We should have a firm distinction between the types Peer and PeerInfo

peerStore.get returns Peer, this is the fully-featured version with peer ids appended to the multiaddrs (which we would do prior to returning them), along with tags, metadata, etc, then add a new peerStore.getInfo method that returns a PeerInfo - this just has the peer id and the multiaddrs without the peer id and is the structure you'd expect to exchange with other implementations.

fixes #1959

Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review

packages/peer-store/src/utils/address-to-fqmultiaddr.ts Outdated Show resolved Hide resolved
packages/peer-store/src/utils/to-peer-pb.ts Outdated Show resolved Hide resolved
packages/peer-store/test/save.spec.ts Outdated Show resolved Hide resolved
@SgtPooki SgtPooki requested a review from a team as a code owner August 25, 2023 23:30
Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

feat: peerStore returns multiaddrs for a peer with peerIds postfixed where necessary.
2 participants