@libp2p/interface-keychain
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

@libp2p/interface-keychain

libp2p.io Discuss codecov CI

Keychain interface for libp2p

Table of contents

Install

$ npm i @libp2p/interface-keychain

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.

Readme

Keywords

Package Sidebar

Install

npm i @libp2p/interface-keychain

Weekly Downloads

16,179

Version

2.0.5

License

Apache-2.0 OR MIT

Unpacked Size

18.1 kB

Total Files

10

Last publish

Collaborators

  • jacobheun
  • npm-service-account-libp2p
  • alanshaw
  • vascosantos
  • achingbrain
  • daviddias