Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

libp2p/interface-content-routing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⛔️ DEPRECATED: interface-content-routing is now included in libp2p-interfaces

interface-content-routing

Discourse posts

A test suite and interface you can use to implement a Content Routing module for libp2p.

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.

The API is presented with both Node.js and Go primitives, however, there is not actual limitations for it to be extended for any other language, pushing forward the cross compatibility and interop through diferent stacks.

Lead Maintainer

Vasco Santos.

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

var tape = require('tape')
var tests = require('interface-content-routing/tests')
var yourImpl = require('../src')

var common = {
    setup: function (t, cb) {
      cb(null, yourImpl)
    },
    teardown: function (t, cb) {
      cb()
    }
}

tests(tape, common)

Go

WIP - The go-libp2p implementation does not have a test suite to be used, yet.

API

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

.findProviders

  • JavaScript peerRouting.findProviders

.provide

  • JavaScript peerRouting.provide

About

⛔️ DEPRECATED: interface-content-routing is now included in https://github.com/libp2p/js-interfaces

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published