diff --git a/transport-interop/Makefile b/transport-interop/Makefile index ed98ff716..4fb5ef2f3 100644 --- a/transport-interop/Makefile +++ b/transport-interop/Makefile @@ -4,8 +4,9 @@ RUST_SUBDIRS := $(wildcard impl/rust/*/.) NIM_SUBDIRS := $(wildcard impl/nim/*/.) ZIG_SUBDIRS := $(wildcard impl/zig/*/.) JAVA_SUBDIRS := $(wildcard impl/java/*/.) +C_SUBDIRS := $(wildcard impl/c/*/.) -all: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS) $(JAVA_SUBDIRS) +all: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS) $(JAVA_SUBDIRS) $(C_SUBDIRS) $(JS_SUBDIRS): $(MAKE) -C $@ $(GO_SUBDIRS): @@ -18,5 +19,7 @@ $(ZIG_SUBDIRS): $(MAKE) -C $@ $(JAVA_SUBDIRS): $(MAKE) -C $@ +$(C_SUBDIRS): + $(MAKE) -C $@ -.PHONY: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS) $(JAVA_SUBDIRS) all +.PHONY: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS) $(JAVA_SUBDIRS) $(C_SUBDIRS) all diff --git a/transport-interop/impl/c/.gitignore b/transport-interop/impl/c/.gitignore new file mode 100644 index 000000000..d84214176 --- /dev/null +++ b/transport-interop/impl/c/.gitignore @@ -0,0 +1,4 @@ +c-libp2p-*.zip +c-libp2p-* +c-libp2p-*/* +image.json diff --git a/transport-interop/impl/c/v0.0.1/Makefile b/transport-interop/impl/c/v0.0.1/Makefile new file mode 100644 index 000000000..8380edb39 --- /dev/null +++ b/transport-interop/impl/c/v0.0.1/Makefile @@ -0,0 +1,29 @@ +image_name := c-v0.0.1 +commitSha := 2d6ccc96b39a5129ebdaf5b2577eba5880f3dc0a +repo_url := https://github.com/Pier-Two/c-libp2p.git +dir_name := c-libp2p-$(commitSha) + +all: image.json + +image.json: + rm -rf $(dir_name) + git clone $(repo_url) $(dir_name) + cd $(dir_name) && git checkout $(commitSha) + cd $(dir_name) && git submodule update --init --recursive lib/picoquic + cd $(dir_name) && \ + mkdir -p lib/secp256k1 && wget -O secp256k1.zip https://github.com/bitcoin-core/secp256k1/archive/master.zip && unzip -o secp256k1.zip && mv secp256k1-master/* lib/secp256k1/ && rm -rf secp256k1.zip secp256k1-master && \ + mkdir -p lib/libtomcrypt && wget -O libtomcrypt.zip https://github.com/libtom/libtomcrypt/archive/develop.zip && unzip -o libtomcrypt.zip && mv libtomcrypt-develop/* lib/libtomcrypt/ && rm -rf libtomcrypt.zip libtomcrypt-develop && \ + mkdir -p lib/libtommath && wget -O libtommath.zip https://github.com/libtom/libtommath/archive/master.zip && unzip -o libtommath.zip && mv libtommath-master/* lib/libtommath/ && rm -rf libtommath.zip libtommath-master && \ + mkdir -p lib/libeddsa && wget -O libeddsa.zip https://github.com/phlay/libeddsa/archive/master.zip && unzip -o libeddsa.zip && mv libeddsa-master/* lib/libeddsa/ && rm -rf libeddsa.zip libeddsa-master && \ + mkdir -p lib/noise-c && wget -O noise-c.zip https://github.com/uink45/noise-c/archive/master.zip && unzip -o noise-c.zip && mv noise-c-master/* lib/noise-c/ && rm -rf noise-c.zip noise-c-master && \ + mkdir -p lib/wjcryptlib && wget -O wjcryptlib.zip https://github.com/WaterJuice/WjCryptLib/archive/master.zip && unzip -o wjcryptlib.zip && mv WjCryptLib-master/* lib/wjcryptlib/ && rm -rf wjcryptlib.zip WjCryptLib-master && \ + mkdir -p lib/sha3 && wget -O sha3.zip https://github.com/pablotron/sha3/archive/main.zip && unzip -o sha3.zip && mv sha3-main/* lib/sha3/ && rm -rf sha3.zip sha3-main && \ + mkdir -p lib/c20p1305 && wget -O c20p1305.zip https://github.com/wg/c20p1305/archive/master.zip && unzip -o c20p1305.zip && mv c20p1305-master/* lib/c20p1305/ && rm -rf c20p1305.zip c20p1305-master + cd $(dir_name) && IMAGE_NAME=$(image_name) ../../../../dockerBuildWrapper.sh -f interop-tests/Dockerfile . + docker image inspect $(image_name) -f '{{.Id}}' | \ + xargs -I {} echo '{"imageID": "{}"}' > $@ + +clean: + rm -rf image.json $(dir_name) + +.PHONY: all clean diff --git a/transport-interop/package-lock.json b/transport-interop/package-lock.json index c2916e005..0e7f2f239 100644 --- a/transport-interop/package-lock.json +++ b/transport-interop/package-lock.json @@ -1,11 +1,11 @@ { - "name": "Multidimensional libp2p interop test", + "name": "@libp2p/transport-interop", "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "Multidimensional libp2p interop test", + "name": "@libp2p/transport-interop", "version": "0.0.1", "license": "MIT", "dependencies": { @@ -361,9 +361,10 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" diff --git a/transport-interop/versionsInput.json b/transport-interop/versionsInput.json index 60b166f5d..dab7204de 100644 --- a/transport-interop/versionsInput.json +++ b/transport-interop/versionsInput.json @@ -349,5 +349,19 @@ "muxers": [ "yamux" ] + }, + { + "id": "c-v0.0.1", + "transports": [ + "tcp", + "quic-v1" + ], + "secureChannels": [ + "noise" + ], + "muxers": [ + "mplex", + "yamux" + ] } ]