https://github.com/libp2p/interop
Interoperability tests for libp2p Implementations
https://github.com/libp2p/interop
Last synced: about 1 year ago
JSON representation
Interoperability tests for libp2p Implementations
- Host: GitHub
- URL: https://github.com/libp2p/interop
- Owner: libp2p
- License: other
- Created: 2017-11-04T08:53:46.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T13:28:02.000Z (over 1 year ago)
- Last Synced: 2025-04-09T21:16:38.418Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 1.47 MB
- Stars: 19
- Watchers: 23
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
[](http://libp2p.io/)
[](https://discuss.libp2p.io)
[](https://codecov.io/gh/libp2p/interop)
[](https://github.com/libp2p/interop/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
> 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:
```js
import { interopTests } from '@libp2p/interop'
import type { Daemon, DaemonFactory } from '@libp2p/interop'
async function createGoPeer (options: SpawnOptions): Promise {
// your implementation here
}
async function createJsPeer (options: SpawnOptions): Promise {
// 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
```console
$ npm i @libp2p/interop
```
# License
Licensed under either of
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / )
- MIT ([LICENSE-MIT](LICENSE-MIT) / )
# 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.