From 168f8d1e1d88088f2fbda386d664d96caabb15fc Mon Sep 17 00:00:00 2001 From: Sanaz Taheri Boshrooyeh <35961250+staheri14@users.noreply.github.com> Date: Tue, 2 Mar 2021 12:57:48 -0800 Subject: [PATCH] Adds rln as a submodule (#402) * adds rln as submodule * removes the duplicate rln submodule * adds rln * Delete waku.nims --- .gitmodules | 4 ++++ Makefile | 3 +-- vendor/rln | 1 + waku.nimble | 3 ++- waku/v2/protocol/waku_rln_relay/rln.nim | 3 ++- 5 files changed, 10 insertions(+), 4 deletions(-) create mode 160000 vendor/rln diff --git a/.gitmodules b/.gitmodules index fb723efb9..7341d7df2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -106,3 +106,7 @@ [submodule "vendor/nim-web3"] path = vendor/nim-web3 url = https://github.com/status-im/nim-web3.git +[submodule "vendor/rln"] + path = vendor/rln + url = https://github.com/kilic/rln + branch = full-node diff --git a/Makefile b/Makefile index 8f4038af0..0779c68f4 100644 --- a/Makefile +++ b/Makefile @@ -119,8 +119,7 @@ installganache: npm install ganache-cli; npx ganache-cli -p 8540 -g 0 -l 3000000000000& rlnlib: - #cargo clean --manifest-path rln/Cargo.toml #TODO may need to clean the rln directory before cloning the rln repo - rm -rf rln; git clone --branch full-node https://github.com/kilic/rln; git --git-dir=rln/.git reset --hard a80f5d0; cargo build --manifest-path rln/Cargo.toml; + cargo build --manifest-path vendor/rln/Cargo.toml test2: | build deps installganache echo -e $(BUILD_MSG) "build/$@" && \ diff --git a/vendor/rln b/vendor/rln new file mode 160000 index 000000000..a80f5d013 --- /dev/null +++ b/vendor/rln @@ -0,0 +1 @@ +Subproject commit a80f5d013eb092ff18bd1d946c57565e2cdc65da diff --git a/waku.nimble b/waku.nimble index bbe51fd89..cc7dadb91 100644 --- a/waku.nimble +++ b/waku.nimble @@ -21,7 +21,8 @@ requires "nim >= 1.2.0", "stint", "metrics", "libp2p", # Only for Waku v2 - "web3" + "web3", + "rln" ### Helper functions proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") = diff --git a/waku/v2/protocol/waku_rln_relay/rln.nim b/waku/v2/protocol/waku_rln_relay/rln.nim index 4a54228a3..d80a68956 100644 --- a/waku/v2/protocol/waku_rln_relay/rln.nim +++ b/waku/v2/protocol/waku_rln_relay/rln.nim @@ -5,7 +5,8 @@ import os # librln.dylib is the rln library taken from https://github.com/kilic/rln (originally implemented in rust with an exposed C API) # contains the key generation and other relevant functions -const libPath = "rln/target/debug/" + +const libPath = "vendor/rln/target/debug/" when defined(Windows): const libName* = libPath / "rln.dll" elif defined(Linux):