Peer Routing interface for libp2p
$ npm i @libp2p/interface-peer-routing
The primary goal of this module is to enable developers to pick and swap their Peer Routing module as they see fit for their libp2p installation, without having to go through shims or compatibility issues. This module and test suite were heavily inspired by abstract-blob-store and interface-stream-muxer.
Publishing a test suite as a module lets multiple modules all ensure compatibility since they use the same test suite.
Include this badge in your readme if you make a module that is compatible with the interface-record-store API. You can validate this by running the tests.
TBD
A valid (read: that follows this abstraction) Peer Routing module must implement the following API.
findPeer(peerId)
Query the network for all multiaddresses associated with a PeerId
.
Parameters
Returns
It returns the peerId together with the known peers multiaddrs, as follows:
Promise<{ id: PeerId, multiaddrs: Multiaddr[] }>
Licensed under either of
- Apache 2.0, (LICENSE-APACHE / http://www.apache.org/licenses/LICENSE-2.0)
- MIT (LICENSE-MIT / http://opensource.org/licenses/MIT)
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.