@libp2p/interface-content-routing
Content routing interface for libp2p
$ npm install @libp2p/interface-content-routing 
SYNC missed versions from official npm registry.

@libp2p/interface-content-routing

libp2p.io Discuss codecov CI

Content routing interface for libp2p

Table of contents

Install

$ npm i @libp2p/interface-content-routing

The primary goal of this module is to enable developers to pick and swap their Content 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.

Modules that implement the interface

Badge

Include this badge in your readme if you make a module that is compatible with the interface-content-routing API. You can validate this by running the tests.

How to use the battery of tests

Node.js

TBD

API

A valid (read: that follows this abstraction) Content Routing module must implement the following API.

findProviders

  • findProviders(cid)

Find peers in the network that can provide a specific value, given a key.

Parameters

Returns

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

AsyncIterable<{ id: PeerId, multiaddrs: Multiaddr[] }>

provide

  • provide(cid)

Announce to the network that we are providing the given value.

Parameters

Returns

It returns a promise that is resolved on the success of the operation.

Promise<void>

API Docs

License

Licensed under either of

Contribution

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.

Current Tags

  • 2.1.1                                ...           latest (2 years ago)
  • 2.1.1-d853d124                                ...           next (2 years ago)

23 Versions

  • 2.1.1-d853d124                                ...           2 years ago
  • 2.1.1-ea8a0637                                ...           2 years ago
  • 2.1.1-ab0e3980                                ...           2 years ago
  • 2.1.1-3dfc236e                                ...           2 years ago
  • 2.1.1-8c6b6d24                                ...           2 years ago
  • 2.1.1-d2f1eff4                                ...           2 years ago
  • 2.1.1-5a9fb4d6                                ...           2 years ago
  • 2.1.1-883082ca                                ...           2 years ago
  • 2.1.1-1c6702c8                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.0.0                                ...           3 years ago
Downloads
Total 14
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE