mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-06-13 01:01:44 +00:00
chore: update content and peer routing interfaces removing peer-info (#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
This commit is contained in:
@ -30,6 +30,32 @@ TBD
|
||||
|
||||
A valid (read: that follows this abstraction) Content Routing module must implement the following API.
|
||||
|
||||
### `.findProviders`
|
||||
### findProviders
|
||||
|
||||
### `.provide`
|
||||
- `findProviders(cid)`
|
||||
|
||||
Find peers in the network that can provide a specific value, given a key.
|
||||
|
||||
**Parameters**
|
||||
- [CID](https://github.com/multiformats/js-cid)
|
||||
|
||||
**Returns**
|
||||
|
||||
It returns an `AsyncIterable` containing the identification and addresses of the peers providing the given key, as follows:
|
||||
|
||||
`AsyncIterable<{ id: PeerId, addrs: Multiaddr[] }>`
|
||||
|
||||
### provide
|
||||
|
||||
- `provide(cid)`
|
||||
|
||||
Announce to the network that we are providing the given value.
|
||||
|
||||
**Parameters**
|
||||
- [CID](https://github.com/multiformats/js-cid)
|
||||
|
||||
**Returns**
|
||||
|
||||
It returns a promise that is resolved on the success of the operation.
|
||||
|
||||
`Promise<void>`
|
||||
|
Reference in New Issue
Block a user