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..2bd630af7 --- /dev/null +++ b/transport-interop/impl/c/v0.0.1/Makefile @@ -0,0 +1,26 @@ +image_name := c-v0.0.1 +commitSha := 9ee22b6a2272ffa5cecbce2af61d4bda8b7a1b21 +zip_name := c-libp2p-$(commitSha).zip +dir_name := c-libp2p-$(commitSha) + +all: image.json + +image.json: + wget -O $(zip_name) https://github.com/Pier-Two/c-libp2p/archive/$(commitSha).zip && unzip -o $(zip_name) + 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) $(zip_name) + +.PHONY: all clean diff --git a/transport-interop/package-lock.json b/transport-interop/package-lock.json index c2916e005..158828ad3 100644 --- a/transport-interop/package-lock.json +++ b/transport-interop/package-lock.json @@ -1786,9 +1786,10 @@ } }, "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", + "license": "MIT", "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", diff --git a/transport-interop/versionsInput.json b/transport-interop/versionsInput.json index 60b166f5d..9d453593e 100644 --- a/transport-interop/versionsInput.json +++ b/transport-interop/versionsInput.json @@ -349,5 +349,18 @@ "muxers": [ "yamux" ] + }, + { + "id": "c-v0.0.1", + "transports": [ + "tcp" + ], + "secureChannels": [ + "noise" + ], + "muxers": [ + "mplex", + "yamux" + ] } ]