feat: ensure waku is installable via nimble

This commit is contained in:
fryorcraken 2025-10-14 20:43:28 +11:00
parent 9808e205af
commit 5116312c11
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
3 changed files with 99 additions and 0 deletions

View File

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

View File

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

View File

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