fixing rln

This commit is contained in:
fryorcraken 2025-10-20 13:35:16 +11:00
parent e688a65cc3
commit b1c7a4a32d
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
3 changed files with 27 additions and 1 deletions

View File

@ -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")

View File

@ -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()

View File

@ -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: