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

12.0.2 • Public • Published

libp2p.io Discuss codecov CI

Interoperability Tests for libp2p

About

This repository holds interop tests for testing compatibility between different libp2p implementations.

Example - How to run the tests

Create a js file that configures the different types of daemon:

import { interopTests } from '@libp2p/interop'
import type { Daemon, DaemonFactory } from '@libp2p/interop'

async function createGoPeer (options: SpawnOptions): Promise<Daemon> {
  // your implementation here
}

async function createJsPeer (options: SpawnOptions): Promise<Daemon> {
  // your implementation here
}

async function main () {
  const factory: DaemonFactory = {
    async spawn (options: SpawnOptions) {
      if (options.type === 'go') {
        return createGoPeer(options)
      }

      return createJsPeer(options)
    }
  }

  interopTests(factory)
}

main().catch(err => {
  console.error(err)
  process.exit(1)
})

For an example, see the js-libp2p interop test runner.

Install

$ npm i @libp2p/interop

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/interop

Weekly Downloads

409

Version

12.0.2

License

Apache-2.0 OR MIT

Unpacked Size

161 kB

Total Files

112

Last publish

Collaborators

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