diff --git a/examples/nimble/config.nims b/examples/nimble/config.nims new file mode 100644 index 000000000..e34da8afb --- /dev/null +++ b/examples/nimble/config.nims @@ -0,0 +1,12 @@ + +# begin Nimble config (version 2) +when withDir(thisDir(), system.fileExists("nimble.paths")): + include "nimble.paths" +# end Nimble config + +import os + +let rlnLib = getCurrentDir() / "build" / "librln.a" +echo "RLN lib path: ", rlnLib +switch("passL", rlnLib) +switch("passL", "-lm") \ No newline at end of file diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index 4f1533fd6..d807eb79a 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -13,3 +13,17 @@ bin = @["example"] requires "chronos" requires "results" requires "waku#da5767a388f1a4ab0b7ce43f3765d20cf1d098ed" + +import os + +proc ensureRln(libFile: string = "build/librln.a", version = "v0.8.0") = + if not fileExists(libFile): + echo "Building RLN library..." + let buildDir = parentDir(parentDir(getCurrentDir())) & "/vendor/zerokit" + let outFile = libFile + exec "bash ../../scripts/build_rln.sh " & buildDir & " " & version & " " & outFile + else: + echo "RLN library already exists: " & libFile + +before build: + ensureRln() \ No newline at end of file diff --git a/examples/nimble/src/example.nim b/examples/nimble/src/example.nim index 18756cdba..e659be154 100644 --- a/examples/nimble/src/example.nim +++ b/examples/nimble/src/example.nim @@ -8,7 +8,7 @@ proc main() {.async.} = # Create a basic configuration for the Waku node # No RLN so we don't need to path an eth rpc endpoint let config = - newNodeConfig(wakuConfig = newWakuConfig(bootstrapNodes = @[], clusterId = 42)) + NodeConfig.init(protocolsConfig = ProtocolsConfig.init(entryNodes = @[], clusterId = 42)) # Create the node using the library API's createNode function let node = (await createNode(config)).valueOr: