From c9ffe1386a15bd7105181bff18617ecc222150e0 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 14 Oct 2025 20:43:28 +1100 Subject: [PATCH 01/38] feat: ensure waku is installable via nimble --- .github/workflows/test-nimble-install.yml | 56 +++++++++++++++++++++++ examples/nimble/example.nimble | 15 ++++++ examples/nimble/src/example.nim | 28 ++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 .github/workflows/test-nimble-install.yml create mode 100644 examples/nimble/example.nimble create mode 100644 examples/nimble/src/example.nim diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml new file mode 100644 index 000000000..2361f8dba --- /dev/null +++ b/.github/workflows/test-nimble-install.yml @@ -0,0 +1,56 @@ +name: Test Nimble Installation + +on: + pull_request: + push: + branches: + - master + +jobs: + test-nimble-install: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] # TODO: Windows + nim-version: ['2.2.4'] # TODO: tests with more versions + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: nim-lang/setup-nimble-action@v1 + with: + nimble-version: "nightly" + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Display Nimble version + run: | + nimble --version + + - name: Display example.nimble + run: cat examples/nimble/example.nimble + + - name: Display waku.nimble + run: head -n40 waku.nimble + + - name: Install waku from head of PR branch + working-directory: examples/nimble + run: nimble --verbose install "waku@#${{ github.event.pull_request.head.sha }}" + + - name: List installed packages + working-directory: examples/nimble + run: | + nimble list --installed --ver + + - name: Build example project + working-directory: examples/nimble + run: | + echo "Building example project..." + nimble --verbose build + + - name: Run example project + working-directory: examples/nimble + run: | + echo "Running example project..." + nimble --verbose run \ No newline at end of file diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble new file mode 100644 index 000000000..25cbbbdd7 --- /dev/null +++ b/examples/nimble/example.nimble @@ -0,0 +1,15 @@ +# Package + +version = "0.1.0" +author = "fryorcraken" +description = "Test Waku with nimble" +license = "MIT" +srcDir = "src" +bin = @["example"] + + +# Dependencies + +requires "chronos" +requires "results" +requires "waku" \ No newline at end of file diff --git a/examples/nimble/src/example.nim b/examples/nimble/src/example.nim new file mode 100644 index 000000000..18756cdba --- /dev/null +++ b/examples/nimble/src/example.nim @@ -0,0 +1,28 @@ +import std/options +import chronos, results +import waku + +proc main() {.async.} = + echo("Starting Waku node...") + + # 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)) + + # Create the node using the library API's createNode function + let node = (await createNode(config)).valueOr: + echo("Failed to create node: ", error) + quit(1) + + echo("Waku node created successfully!") + + # Start the node + (await startWaku(addr node)).isOkOr: + echo("Failed to start node: ", error) + quit(1) + + echo("Node started successfully! exiting") + +when isMainModule: + waitFor main() From 9c078e20cf522633844592235a1a54e2d3778f5b Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Wed, 15 Oct 2025 12:29:52 +1100 Subject: [PATCH 02/38] remove --verbose to avoid issue with long logs --- .github/workflows/test-nimble-install.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 2361f8dba..887557f7a 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -12,9 +12,9 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] # TODO: Windows nim-version: ['2.2.4'] # TODO: tests with more versions - + runs-on: ${{ matrix.os }} - + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -36,13 +36,13 @@ jobs: - name: Install waku from head of PR branch working-directory: examples/nimble - run: nimble --verbose install "waku@#${{ github.event.pull_request.head.sha }}" + run: nimble install "waku@#${{ github.event.pull_request.head.sha }}" - name: List installed packages working-directory: examples/nimble run: | nimble list --installed --ver - + - name: Build example project working-directory: examples/nimble run: | @@ -53,4 +53,4 @@ jobs: working-directory: examples/nimble run: | echo "Running example project..." - nimble --verbose run \ No newline at end of file + nimble --verbose run From 204974690343a8fda6513c602fcf3e2c4273d1b4 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Wed, 15 Oct 2025 12:34:27 +1100 Subject: [PATCH 03/38] continue-on-error: true --- .github/workflows/test-nimble-install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 887557f7a..91e0a33ba 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -8,6 +8,7 @@ on: jobs: test-nimble-install: + continue-on-error: true # Some runs get oddly cancelled strategy: matrix: os: [ubuntu-latest, macos-latest] # TODO: Windows From 0dfcc62af929ca12fed324cd60cfd1319267ff08 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Wed, 15 Oct 2025 14:42:03 +1100 Subject: [PATCH 04/38] only run for ubuntu --- .github/workflows/test-nimble-install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 91e0a33ba..c830ff83c 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -11,7 +11,7 @@ jobs: continue-on-error: true # Some runs get oddly cancelled strategy: matrix: - os: [ubuntu-latest, macos-latest] # TODO: Windows + os: [ubuntu-latest] # TODO: Windows nim-version: ['2.2.4'] # TODO: tests with more versions runs-on: ${{ matrix.os }} From 21a09be92e7a801030f8d4bbd4fdc220e27d4125 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Wed, 15 Oct 2025 14:42:57 +1100 Subject: [PATCH 05/38] set fail-fast false --- .github/workflows/test-nimble-install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index c830ff83c..783c683d6 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -10,6 +10,7 @@ jobs: test-nimble-install: continue-on-error: true # Some runs get oddly cancelled strategy: + fail-fast: false matrix: os: [ubuntu-latest] # TODO: Windows nim-version: ['2.2.4'] # TODO: tests with more versions From 76f7272144f0917f89421f2214a6c5e993483ab5 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Wed, 15 Oct 2025 14:43:16 +1100 Subject: [PATCH 06/38] ignore nimbledeps folder --- examples/nimble/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 examples/nimble/.gitignore diff --git a/examples/nimble/.gitignore b/examples/nimble/.gitignore new file mode 100644 index 000000000..29a5f1df0 --- /dev/null +++ b/examples/nimble/.gitignore @@ -0,0 +1 @@ +nimbledeps From d70f6bbd5d9564cf279c420a6758ffdcfd1a6ff5 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Fri, 17 Oct 2025 11:19:33 +1100 Subject: [PATCH 07/38] specific commit hash --- examples/nimble/example.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index 25cbbbdd7..f1cf43f7f 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -12,4 +12,4 @@ bin = @["example"] requires "chronos" requires "results" -requires "waku" \ No newline at end of file +requires "waku#a292ace6eafaea4fee9811d9bde72e9a952e6669" \ No newline at end of file From 1e5f1e829ee6df66999f816a36a2ee9e9b61bf95 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Fri, 17 Oct 2025 13:24:09 +1100 Subject: [PATCH 08/38] pin nim-stew to match vendor And avoid ambiguous call error for now --- waku.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waku.nimble b/waku.nimble index c63d20246..a870db2d1 100644 --- a/waku.nimble +++ b/waku.nimble @@ -21,7 +21,7 @@ requires "nim >= 2.2.4", "libbacktrace", "nimcrypto", "serialization", - "stew", + "stew == 0.4.1", "stint", "metrics", "libp2p >= 1.14.2", From 3879208adf3b65fadb6d632e5cd67e43d7379dc8 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 12:40:51 +1100 Subject: [PATCH 09/38] remove ver in .nimble file --- examples/nimble/example.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index f1cf43f7f..25cbbbdd7 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -12,4 +12,4 @@ bin = @["example"] requires "chronos" requires "results" -requires "waku#a292ace6eafaea4fee9811d9bde72e9a952e6669" \ No newline at end of file +requires "waku" \ No newline at end of file From f4fe8ff700ca10103ba6f5d3f191414a753f1c2d Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Sun, 19 Oct 2025 12:41:56 +0200 Subject: [PATCH 10/38] test --- examples/nimble/example.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index 25cbbbdd7..4f1533fd6 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -12,4 +12,4 @@ bin = @["example"] requires "chronos" requires "results" -requires "waku" \ No newline at end of file +requires "waku#da5767a388f1a4ab0b7ce43f3765d20cf1d098ed" From 5754fb5098b2c51709eda22f76b9f631f664c547 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Sun, 19 Oct 2025 12:47:13 +0200 Subject: [PATCH 11/38] ci --- .github/workflows/test-nimble-install.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 783c683d6..81c5d615c 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - master + - simpler-deps jobs: test-nimble-install: @@ -23,7 +23,7 @@ jobs: - uses: nim-lang/setup-nimble-action@v1 with: - nimble-version: "nightly" + nimble-version: "0.20.1" repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Display Nimble version @@ -36,15 +36,6 @@ jobs: - name: Display waku.nimble run: head -n40 waku.nimble - - name: Install waku from head of PR branch - working-directory: examples/nimble - run: nimble install "waku@#${{ github.event.pull_request.head.sha }}" - - - name: List installed packages - working-directory: examples/nimble - run: | - nimble list --installed --ver - - name: Build example project working-directory: examples/nimble run: | From 02eb038823eef8e27df0ffb7c7474f38ef88a775 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 13:35:16 +1100 Subject: [PATCH 12/38] fixing rln --- examples/nimble/config.nims | 12 ++++++++++++ examples/nimble/example.nimble | 14 ++++++++++++++ examples/nimble/src/example.nim | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 examples/nimble/config.nims 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: From b449120f5b373e08e8a48d59945996c501c41f18 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 13:35:25 +1100 Subject: [PATCH 13/38] remove unused import --- examples/nimble/src/example.nim | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/nimble/src/example.nim b/examples/nimble/src/example.nim index e659be154..fae571336 100644 --- a/examples/nimble/src/example.nim +++ b/examples/nimble/src/example.nim @@ -1,4 +1,3 @@ -import std/options import chronos, results import waku From 265c4d11a74edd8f115771aafbbe4f76baa59c8a Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 13:35:39 +1100 Subject: [PATCH 14/38] update gitignore --- examples/nimble/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/nimble/.gitignore b/examples/nimble/.gitignore index 29a5f1df0..aa5500535 100644 --- a/examples/nimble/.gitignore +++ b/examples/nimble/.gitignore @@ -1 +1,4 @@ nimbledeps +nimble.develop +nimble.paths +example \ No newline at end of file From f9ae30e435fbd39ede68625075e34b0e89652ae1 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 14:13:18 +1100 Subject: [PATCH 15/38] pull submodules for RLN --- .github/workflows/test-nimble-install.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 81c5d615c..132976a52 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -20,6 +20,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + submodules: "true" # Needed to pull RLN script - uses: nim-lang/setup-nimble-action@v1 with: From b15085f550e73876009fe9bebf5b03537677fe56 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 14:14:37 +1100 Subject: [PATCH 16/38] fix rln script Not sure how the previous script ever worked when checking zerokit assets on GitHub --- scripts/build_rln.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_rln.sh b/scripts/build_rln.sh index 5e1b0caa5..c93be290a 100755 --- a/scripts/build_rln.sh +++ b/scripts/build_rln.sh @@ -19,7 +19,7 @@ host_triplet=$(rustc --version --verbose | awk '/host:/{print $2}') tarball="${host_triplet}" -tarball+="-rln.tar.gz" +tarball+="-default-rln.tar.gz" # Download the prebuilt rln library if it is available if curl --silent --fail-with-body -L \ From 7eb979050cc6080050dc4f167be1e1d4e53cbe13 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 14:26:29 +1100 Subject: [PATCH 17/38] ensure build dir for RLN exists --- examples/nimble/example.nimble | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index d807eb79a..3a28c25fd 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -21,6 +21,11 @@ proc ensureRln(libFile: string = "build/librln.a", version = "v0.8.0") = echo "Building RLN library..." let buildDir = parentDir(parentDir(getCurrentDir())) & "/vendor/zerokit" let outFile = libFile + + let outDir = parentDir(outFile) + if not dirExists(outDir): + mkDir(outDir) # Ensure build directory exists + exec "bash ../../scripts/build_rln.sh " & buildDir & " " & version & " " & outFile else: echo "RLN library already exists: " & libFile From 415249d6c1d8f6b48cef53f644eee405246d1406 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 14:40:52 +1100 Subject: [PATCH 18/38] update example to waku commit with rendezvous fix --- examples/nimble/example.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index 3a28c25fd..0ab38391a 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -12,7 +12,7 @@ bin = @["example"] requires "chronos" requires "results" -requires "waku#da5767a388f1a4ab0b7ce43f3765d20cf1d098ed" +requires "waku#2073b5518b074408e6cf23c6f890c82d0c88ea56" import os From 3f45909e589ff6ad164dd52d599ce06f88e34f43 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 14:51:02 +1100 Subject: [PATCH 19/38] Update commit hash after rebase --- examples/nimble/example.nimble | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index 0ab38391a..ea61eb6cd 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -12,7 +12,7 @@ bin = @["example"] requires "chronos" requires "results" -requires "waku#2073b5518b074408e6cf23c6f890c82d0c88ea56" +requires "waku#8066b96aebcb7875c021e13ab71d3cab6329a0e8" import os @@ -31,4 +31,4 @@ proc ensureRln(libFile: string = "build/librln.a", version = "v0.8.0") = echo "RLN library already exists: " & libFile before build: - ensureRln() \ No newline at end of file + ensureRln() From 983ced4ead8f579d99eded8da550122d83d1f02f Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 15:06:39 +1100 Subject: [PATCH 20/38] use new commit with correct nim-libp2p branch --- examples/nimble/example.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index ea61eb6cd..08bc8090f 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -12,7 +12,7 @@ bin = @["example"] requires "chronos" requires "results" -requires "waku#8066b96aebcb7875c021e13ab71d3cab6329a0e8" +requires "waku#7351f209a7d4ce15068c8fb12807c58517101c81" import os From 6228dab15d59dd5747986f05304dbafd9d7a8c11 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 15:51:31 +1100 Subject: [PATCH 21/38] try with nimble nightly --- .github/workflows/test-nimble-install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 132976a52..e00524fe6 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -25,7 +25,7 @@ jobs: - uses: nim-lang/setup-nimble-action@v1 with: - nimble-version: "0.20.1" + nimble-version: "nightly" repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Display Nimble version From 933b281b0a993639a6dadb8c2d4c1b40893119a7 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 18:09:23 +1100 Subject: [PATCH 22/38] run the executable instead of using nimble run --- .github/workflows/test-nimble-install.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index e00524fe6..0ab0fc569 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -48,4 +48,5 @@ jobs: working-directory: examples/nimble run: | echo "Running example project..." - nimble --verbose run + # nimble --verbose run # TODO: Use nimble run + ./example From ee6b7a437b0e7bf30fbc87175cd0fb2cbd7f121c Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 20 Oct 2025 21:27:07 +1100 Subject: [PATCH 23/38] unpin stew --- waku.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waku.nimble b/waku.nimble index a870db2d1..c63d20246 100644 --- a/waku.nimble +++ b/waku.nimble @@ -21,7 +21,7 @@ requires "nim >= 2.2.4", "libbacktrace", "nimcrypto", "serialization", - "stew == 0.4.1", + "stew", "stint", "metrics", "libp2p >= 1.14.2", From d7c09f24d1749c8dae6c6e150813119c81196280 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 10:41:35 +1100 Subject: [PATCH 24/38] upgrade libp2p to fix nimble --- waku.nimble | 1 + 1 file changed, 1 insertion(+) diff --git a/waku.nimble b/waku.nimble index c63d20246..0ee0bdc26 100644 --- a/waku.nimble +++ b/waku.nimble @@ -8,6 +8,7 @@ version = "0.36.0" author = "Status Research & Development GmbH" description = "Waku, Private P2P Messaging for Resource-Restricted Devices" license = "MIT or Apache License 2.0" +srcDir = "waku" #bin = @["build/waku"] ### Dependencies From d67b42c7f277c336a9f327eae5ef3f5ce72b1d41 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 10:47:36 +1100 Subject: [PATCH 25/38] add nimble check directly on the waku library --- .github/workflows/test-nimble-install.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 0ab0fc569..0763f8564 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -29,14 +29,13 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Display Nimble version - run: | - nimble --version + run: nimble --version - - name: Display example.nimble - run: cat examples/nimble/example.nimble + - name: Run nimble install on waku + run: nimble --verbose install - - name: Display waku.nimble - run: head -n40 waku.nimble + - name: Run nimble check on waku + run: nimble check -l - name: Build example project working-directory: examples/nimble From 531b001862c4573aa1da3dfb57187cb7574020d0 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 11:39:02 +1100 Subject: [PATCH 26/38] fix format --- examples/nimble/config.nims | 3 +-- examples/nimble/example.nimble | 19 +++++++++---------- examples/nimble/src/example.nim | 5 +++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/examples/nimble/config.nims b/examples/nimble/config.nims index e34da8afb..29ebdc6f7 100644 --- a/examples/nimble/config.nims +++ b/examples/nimble/config.nims @@ -1,4 +1,3 @@ - # begin Nimble config (version 2) when withDir(thisDir(), system.fileExists("nimble.paths")): include "nimble.paths" @@ -9,4 +8,4 @@ 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 +switch("passL", "-lm") diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index 08bc8090f..c8b62c168 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -1,12 +1,11 @@ # Package -version = "0.1.0" -author = "fryorcraken" -description = "Test Waku with nimble" -license = "MIT" -srcDir = "src" -bin = @["example"] - +version = "0.1.0" +author = "fryorcraken" +description = "Test Waku with nimble" +license = "MIT" +srcDir = "src" +bin = @["example"] # Dependencies @@ -21,14 +20,14 @@ proc ensureRln(libFile: string = "build/librln.a", version = "v0.8.0") = echo "Building RLN library..." let buildDir = parentDir(parentDir(getCurrentDir())) & "/vendor/zerokit" let outFile = libFile - + let outDir = parentDir(outFile) if not dirExists(outDir): - mkDir(outDir) # Ensure build directory exists + mkDir(outDir) # Ensure build directory exists exec "bash ../../scripts/build_rln.sh " & buildDir & " " & version & " " & outFile else: echo "RLN library already exists: " & libFile before build: - ensureRln() + ensureRln() diff --git a/examples/nimble/src/example.nim b/examples/nimble/src/example.nim index fae571336..1ee756ab7 100644 --- a/examples/nimble/src/example.nim +++ b/examples/nimble/src/example.nim @@ -6,8 +6,9 @@ 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 = - NodeConfig.init(protocolsConfig = ProtocolsConfig.init(entryNodes = @[], clusterId = 42)) + let config = NodeConfig.init( + protocolsConfig = ProtocolsConfig.init(entryNodes = @[], clusterId = 42) + ) # Create the node using the library API's createNode function let node = (await createNode(config)).valueOr: From 8edd68d7e61b83eee5a1c3e3690b2eee76f1adbc Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 11:39:27 +1100 Subject: [PATCH 27/38] bump waku in example with latest libp2p lib --- examples/nimble/example.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index c8b62c168..33b29000e 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -11,7 +11,7 @@ bin = @["example"] requires "chronos" requires "results" -requires "waku#7351f209a7d4ce15068c8fb12807c58517101c81" +requires "waku#3f7ffa9e619dfad9a57433b3545277ba33dbc3d7" import os From 50a37994668d446299ec254e95bec2325d9e4031 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 12:03:20 +1100 Subject: [PATCH 28/38] remove `--verbose` on nimble install as the CI job gets "cancelled" --- .github/workflows/test-nimble-install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 0763f8564..d88bab154 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -32,7 +32,7 @@ jobs: run: nimble --version - name: Run nimble install on waku - run: nimble --verbose install + run: nimble install - name: Run nimble check on waku run: nimble check -l From b2a4c907fcfed882bd034b0ba9eb4b7b8934833a Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 13:10:18 +1100 Subject: [PATCH 29/38] run nimble check first --- .github/workflows/test-nimble-install.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index d88bab154..5f354a3e8 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -31,12 +31,12 @@ jobs: - name: Display Nimble version run: nimble --version - - name: Run nimble install on waku - run: nimble install - - name: Run nimble check on waku run: nimble check -l + - name: Run nimble install on waku + run: nimble install + - name: Build example project working-directory: examples/nimble run: | From 224f76976d085ab0341dbea3e0fd994d2a8ff22b Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 13:13:01 +1100 Subject: [PATCH 30/38] installation first but add timeout --- .github/workflows/test-nimble-install.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 5f354a3e8..5fee3b007 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -31,11 +31,13 @@ jobs: - name: Display Nimble version run: nimble --version - - name: Run nimble check on waku - run: nimble check -l - - name: Run nimble install on waku run: nimble install + timeout-minutes: 60 + + - name: Run nimble check on waku + run: nimble check -l + timeout-minutes: 60 - name: Build example project working-directory: examples/nimble From 1d9cc372e089ea44daf0a457717a9e7ee53ee417 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 13:18:25 +1100 Subject: [PATCH 31/38] ignore nimbledeps folders --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7430c3e99..070dbd050 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ # Nimble packages /vendor/.nimble +nimbledeps # Generated Files *.generated.nim From 37dd27fb841e8417078b9d42def3f5c1354aac1e Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 13:21:15 +1100 Subject: [PATCH 32/38] re-add mix (needed) --- waku.nimble | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/waku.nimble b/waku.nimble index 0ee0bdc26..20ff8556f 100644 --- a/waku.nimble +++ b/waku.nimble @@ -31,7 +31,8 @@ requires "nim >= 2.2.4", "regex", "results", "db_connector", - "minilru" + "minilru", + "https://github.com/vacp2p/mix#0.1.0" ### Helper functions proc buildModule(filePath, params = "", lang = "c"): bool = From 087755480b08d8b49776bdf213ba363d622fc892 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 14:45:17 +1100 Subject: [PATCH 33/38] fix ambiguous call --- waku/waku_store_sync/reconciliation.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/waku/waku_store_sync/reconciliation.nim b/waku/waku_store_sync/reconciliation.nim index 8b196a3e9..f5883190e 100644 --- a/waku/waku_store_sync/reconciliation.nim +++ b/waku/waku_store_sync/reconciliation.nim @@ -79,7 +79,7 @@ proc messageIngress*( let id = SyncID(time: msg.timestamp, hash: msgHash) self.storage.insert(id, pubsubTopic, msg.contentTopic).isOkOr: - error "failed to insert new message", msg_hash = $id.hash.toHex(), error = $error + error "failed to insert new message", msg_hash = $byteutils.toHex(id.hash), error = $error proc messageIngress*( self: SyncReconciliation, @@ -87,7 +87,7 @@ proc messageIngress*( pubsubTopic: PubsubTopic, msg: WakuMessage, ) = - trace "message ingress", msg_hash = msgHash.toHex(), msg = msg + trace "message ingress", msg_hash = byteutils.toHex(msgHash), msg = msg if msg.ephemeral: return @@ -95,7 +95,7 @@ proc messageIngress*( let id = SyncID(time: msg.timestamp, hash: msgHash) self.storage.insert(id, pubsubTopic, msg.contentTopic).isOkOr: - error "failed to insert new message", msg_hash = $id.hash.toHex(), error = $error + error "failed to insert new message", msg_hash = $byteutils.toHex(id.hash), error = $error proc messageIngress*( self: SyncReconciliation, @@ -104,7 +104,7 @@ proc messageIngress*( contentTopic: ContentTopic, ) = self.storage.insert(id, pubsubTopic, contentTopic).isOkOr: - error "failed to insert new message", msg_hash = $id.hash.toHex(), error = $error + error "failed to insert new message", msg_hash = $byteutils.toHex(id.hash), error = $error proc preProcessPayload( self: SyncReconciliation, payload: RangesData From 6cf2203decd12834608ebdf27485c991d1519a42 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 14:47:51 +1100 Subject: [PATCH 34/38] use nimble 0.20.1 --- .github/workflows/test-nimble-install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-nimble-install.yml b/.github/workflows/test-nimble-install.yml index 5fee3b007..c027cf754 100644 --- a/.github/workflows/test-nimble-install.yml +++ b/.github/workflows/test-nimble-install.yml @@ -25,7 +25,7 @@ jobs: - uses: nim-lang/setup-nimble-action@v1 with: - nimble-version: "nightly" + nimble-version: "0.20.1" repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Display Nimble version From 6acf807e09d345a2e7842bea601178c87279be16 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 14:48:06 +1100 Subject: [PATCH 35/38] upgrade to nwaku with toHex fix --- examples/nimble/example.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index 33b29000e..e6e1ac558 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -11,7 +11,7 @@ bin = @["example"] requires "chronos" requires "results" -requires "waku#3f7ffa9e619dfad9a57433b3545277ba33dbc3d7" +requires "waku#2a8e65c3ba2997e9e2caa1a9664ee8156bc46aaf" import os From 071334de5c8de7dcc2c17ea6f7174ab4684902d3 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 14:54:08 +1100 Subject: [PATCH 36/38] more toHex fix --- waku/utils/requests.nim | 2 +- waku/waku_filter_v2/client.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/waku/utils/requests.nim b/waku/utils/requests.nim index 5e5b9d960..d9afd2887 100644 --- a/waku/utils/requests.nim +++ b/waku/utils/requests.nim @@ -7,4 +7,4 @@ import bearssl/rand, stew/byteutils proc generateRequestId*(rng: ref HmacDrbgContext): string = var bytes: array[10, byte] hmacDrbgGenerate(rng[], bytes) - return toHex(bytes) + return byteutils.toHex(bytes) diff --git a/waku/waku_filter_v2/client.nim b/waku/waku_filter_v2/client.nim index 1dc018150..954a71f56 100644 --- a/waku/waku_filter_v2/client.nim +++ b/waku/waku_filter_v2/client.nim @@ -30,7 +30,7 @@ type WakuFilterClient* = ref object of LPProtocol func generateRequestId(rng: ref HmacDrbgContext): string = var bytes: array[10, byte] hmacDrbgGenerate(rng[], bytes) - return toHex(bytes) + return byteutils.toHex(bytes) proc addSubscrObserver*(wfc: WakuFilterClient, obs: SubscriptionObserver) = wfc.subscrObservers.add(obs) From 0824c00eba187f70dd3780a7e144406ea245a9b7 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 14:54:44 +1100 Subject: [PATCH 37/38] bump waku with more toHex fix --- examples/nimble/example.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nimble/example.nimble b/examples/nimble/example.nimble index e6e1ac558..9bacbe858 100644 --- a/examples/nimble/example.nimble +++ b/examples/nimble/example.nimble @@ -11,7 +11,7 @@ bin = @["example"] requires "chronos" requires "results" -requires "waku#2a8e65c3ba2997e9e2caa1a9664ee8156bc46aaf" +requires "waku#44bfddb245e30eeab850730dee67c41cbe7f7252" import os From ce19d16c31b26e193f98e42fd1a9261dab386b98 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 21 Oct 2025 15:26:35 +1100 Subject: [PATCH 38/38] try to fix tag on mix --- waku.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waku.nimble b/waku.nimble index 20ff8556f..dee4f7d4c 100644 --- a/waku.nimble +++ b/waku.nimble @@ -32,7 +32,7 @@ requires "nim >= 2.2.4", "results", "db_connector", "minilru", - "https://github.com/vacp2p/mix#0.1.0" + "https://github.com/vacp2p/mix#v0.1.0" ### Helper functions proc buildModule(filePath, params = "", lang = "c"): bool =