mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-03 22:43:09 +00:00
rlnlib dependency (#376)
* adds rlnlib dependency * clones the full-node branch of rln repository * moves rlnlib dependency to the deps target * changes rlnlib path * adds test_rln_relay_wrappers to the v2 tests * loads rlnlib with different extensions based on the OS * deletes unnecessary imports * changes rlnlib extension to .exe for windows * minor * list files in rln/target/debug * edits rln lib name for windows * removes unnecessary commands * edits some comments * fetches specific commit of rln library
This commit is contained in:
parent
91162a8cd1
commit
d0977a67d5
5
Makefile
5
Makefile
@ -59,7 +59,7 @@ else
|
||||
NIM_PARAMS := $(NIM_PARAMS) -d:release
|
||||
endif
|
||||
|
||||
deps: | deps-common nat-libs waku.nims
|
||||
deps: | deps-common nat-libs waku.nims rlnlib
|
||||
ifneq ($(USE_LIBBACKTRACE), 0)
|
||||
deps: | libbacktrace
|
||||
endif
|
||||
@ -118,6 +118,9 @@ endif
|
||||
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
|
||||
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;
|
||||
|
||||
test2: | build deps installganache
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
|
||||
@ -12,7 +12,8 @@ import
|
||||
./v2/test_jsonrpc_waku,
|
||||
./v2/test_peer_manager,
|
||||
./v2/test_web3, # TODO remove it when rln-relay tests get finalized
|
||||
./v2/test_waku_rln_relay
|
||||
./v2/test_waku_rln_relay,
|
||||
./v2/test_rln_relay_wrappers
|
||||
|
||||
# TODO Only enable this once swap module is integrated more nicely as a dependency, i.e. as submodule with CI etc
|
||||
# For PoC execute it manually and run separate module here: https://github.com/vacp2p/swap-contracts-module
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
# this module contains the Nim wrappers for the rln library https://github.com/kilic/rln/blob/3bbec368a4adc68cd5f9bfae80b17e1bbb4ef373/src/ffi.rs
|
||||
|
||||
import stew/byteutils, os
|
||||
from strutils import rsplit
|
||||
import os
|
||||
|
||||
template sourceDir: string = currentSourcePath.rsplit(DirSep, 1)[0]
|
||||
# librln.dylib is the binary executable of rln library (originally implemented in rust with an exposed C API)
|
||||
# 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
|
||||
# to generate librln.dylib, clone this repo https://github.com/kilic/rln
|
||||
# and run the following command in the root directory of the cloned project
|
||||
# cargo build
|
||||
# can find the .dylib file under the target/debug directory
|
||||
# this file is already generated and copied here
|
||||
const libName* = sourceDir / "librln.dylib" # TODO may need to load different libs based on OS
|
||||
|
||||
const libPath = "rln/target/debug/"
|
||||
when defined(Windows):
|
||||
const libName* = libPath / "rln.dll"
|
||||
elif defined(Linux):
|
||||
const libName* = libPath / "librln.so"
|
||||
elif defined(MacOsX):
|
||||
const libName* = libPath / "librln.dylib"
|
||||
|
||||
# Data types -----------------------------
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user