Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

chore: update content and peer routing interfaces removing peer-info #43

Conversation

vasco-santos
Copy link
Member

In the context of deprecating peer-info as described on libp2p/js-libp2p#589, this PR removes the peer-info usage on the content-routing and peer-routing interfaces.

  • findPeer

Returns Promise<{ id: CID, addrs: Multiaddr[] }> instead of a PeerInfo

  • findProviders

Returns AsyncIterable<{ id: CID, addrs: Multiaddr[] }> instead of AsyncIterable<PeerInfo>

BREAKING CHANGE: content-routing and peer-routing APIs return an object with relevant properties instead of peer-info

BREAKING CHANGE: content-routing and peer-routing APIs return an object with relevant properties instead of peer-info

### `.provide`
- `findProviders(peerId)`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `findProviders(peerId)`
- `findProviders(cid)`


It returns an `AsyncIterable` containing the identification and addresses of the peers providing the given key, as follows:

`AsyncIterable<{ id: CID, addrs: Multiaddr[] }>`
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a PeerId?

Suggested change
`AsyncIterable<{ id: CID, addrs: Multiaddr[] }>`
`AsyncIterable<{ id: PeerId, addrs: Multiaddr[] }>`

key is a multihash
**Returns**

It returns a the `peer-id` [cid](https://github.com/multiformats/js-cid) together with the known peers [multiaddrs](https://github.com/multiformats/js-multiaddr), as follows:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is confusing. Is it a PeerId or CID? Shouldn't it be a PeerId?

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.

1 correction, otherwise this LGTM

@vasco-santos vasco-santos merged commit dafafd6 into v0.3.x Apr 17, 2020
@vasco-santos vasco-santos deleted the chore/update-content-and-peer-routing-interfaces-removing-peer-info branch April 17, 2020 15:22
jacobheun pushed a commit that referenced this pull request Apr 21, 2020
…43)

* chore: update content and peer routing interfaces removing peer-info

BREAKING CHANGE: content-routing and peer-routing APIs return an object with relevant properties instead of peer-info
jacobheun pushed a commit that referenced this pull request Jun 5, 2020
…43)

* chore: update content and peer routing interfaces removing peer-info

BREAKING CHANGE: content-routing and peer-routing APIs return an object with relevant properties instead of peer-info
jacobheun pushed a commit that referenced this pull request Jun 5, 2020
…43)

* chore: update content and peer routing interfaces removing peer-info

BREAKING CHANGE: content-routing and peer-routing APIs return an object with relevant properties instead of peer-info
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants