Multidimension Interop Test
The multidim interop tests use random high ports for listeners. Since you need to know which port will be listened on ahead of time to EXPOSE
a port in a Docker image to the host machine, this means everything has to be run in Docker.
This must be repeated every time you make a change to the js-libp2p source code.
$ npm run build
$ docker build . -f ./interop/Dockerfile -t js-libp2p-node
$ npm run build
$ docker build . -f ./interop/BrowserDockerfile -t js-libp2p-browsers
- Clone the test-plans repo somewhere
$ git clone https://github.com/libp2p/test-plans.git
- (Optional) If you are running an M1 Mac you may need to override the build platform.
- Edit
/multidim-interop/dockerBuildWrapper.sh
- Add
--platform linux/arm64/v8
to thedocker buildx build
commanddocker buildx build \ --platform linux/arm64/v8 \ <-- add this line --load \ -t $IMAGE_NAME $CACHING_OPTIONS "$@"
- Edit
- (Optional) Enable some sort of debug output
- nim-libp2p
- edit
/multidim-interop/impl/nim/$VERSION/Dockerfile
- Change
-d:chronicles_log_level=WARN
to-d:chronicles_log_level=DEBUG
- edit
- rust-libp2p
- When starting the docker container add
-e RUST_LOG=debug
- When starting the docker container add
- go-libp2p
- When starting the docker container add
-e GOLOG_LOG_LEVEL=debug
- When starting the docker container add
- nim-libp2p
- Build the version you want to test against
$ cd multidim-interop/impl/$IMPL/$VERSION $ make ...
Redis is used to allow inter-container communication, exchanging listen addresses etc. It must be started as a Docker container:
$ docker run --name redis --rm -p 6379:6379 redis:7-alpine
$ docker run -e transport=tcp -e muxer=yamux -e security=noise -e is_dialer=true -e redis_addr=redis:6379 --link redis:redis js-libp2p-node
$ docker run -e transport=webtransport -e muxer=yamux -e security=noise -e is_dialer=true -e redis_addr=redis:6379 --link redis:redis js-libp2p-browsers
- Change
go-v0.29
to the implementation you wish to use. - Ensure one docker run has
is_dialer=false
and the other hasis_dialer=true
- Ensure the
transport
option is the same for both implementations
$ docker run -e transport=tcp -e muxer=yamux -e security=noise -e is_dialer=false -e redis_addr=redis:6379 --link redis:redis go-v0.29
Licensed under either of
- Apache 2.0, (LICENSE-APACHE / http://www.apache.org/licenses/LICENSE-2.0)
- MIT (LICENSE-MIT / http://opensource.org/licenses/MIT)
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.