Skip to content

Conversation

@adklempner
Copy link
Member

@adklempner adklempner commented Oct 9, 2025

Problem / Description

The most accurate testing of js-waku applications requires running against an nwaku fleet.

These are not always readily accessible, and depend on external connectivity, which can be especially spotty during hackathons.

Solution

Provide a new package @waku/run that a dev can use via npx to quickly spin up two nwaku nodes pre-configured to connect with each other.
Command prints minimum light node config necessary for dev to create a js-waku node that connects to the local fleet.

Notes


Checklist

  • Code changes are covered by unit tests.
  • Code changes are covered by e2e tests, if applicable.
  • Dogfooding has been performed, if feasible.
  • A test version has been published, if required.
  • All CI checks pass successfully.

@adklempner adklempner requested a review from a team as a code owner October 9, 2025 06:14
@adklempner adklempner marked this pull request as draft October 9, 2025 06:14
@github-actions
Copy link

github-actions bot commented Oct 9, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 96.1 KB (0%) 2 s (0%) 1.2 s (+3.02% 🔺) 3.1 s
Waku Simple Light Node 147.38 KB (0%) 3 s (0%) 821 ms (+12.62% 🔺) 3.8 s
ECIES encryption 22.51 KB (0%) 451 ms (0%) 316 ms (-3.62% 🔽) 767 ms
Symmetric encryption 21.91 KB (0%) 439 ms (0%) 123 ms (-61.3% 🔽) 561 ms
DNS discovery 52.15 KB (0%) 1.1 s (0%) 534 ms (+7.98% 🔺) 1.6 s
Peer Exchange discovery 52.9 KB (0%) 1.1 s (0%) 477 ms (+4.34% 🔺) 1.6 s
Peer Cache Discovery 46.57 KB (0%) 932 ms (0%) 354 ms (-35.32% 🔽) 1.3 s
Privacy preserving protocols 77.05 KB (0%) 1.6 s (0%) 717 ms (-11.9% 🔽) 2.3 s
Waku Filter 79.69 KB (0%) 1.6 s (0%) 831 ms (+8.98% 🔺) 2.5 s
Waku LightPush 77.77 KB (0%) 1.6 s (0%) 911 ms (+73.83% 🔺) 2.5 s
History retrieval protocols 83.61 KB (0%) 1.7 s (0%) 829 ms (-12.17% 🔽) 2.6 s
Deterministic Message Hashing 28.9 KB (0%) 578 ms (0%) 291 ms (+15.01% 🔺) 869 ms

@weboko
Copy link
Collaborator

weboko commented Oct 9, 2025

add new package to release-please configs

@adklempner adklempner force-pushed the feat/waku-run branch 2 times, most recently from 9ead3eb to 9cab60e Compare October 10, 2025 04:34
@adklempner adklempner marked this pull request as ready for review October 20, 2025 18:47
@adklempner adklempner force-pushed the feat/waku-run branch 2 times, most recently from 4a345c3 to 6bc711d Compare October 21, 2025 19:00
@weboko weboko requested a review from Copilot October 21, 2025 21:34
@weboko
Copy link
Collaborator

weboko commented Oct 21, 2025

you must update https://github.com/waku-org/js-waku/blob/master/.release-please-manifest.json too with adding initial version from which release will start

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@@ -0,0 +1,27 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this must be used from the root of the repo

@@ -0,0 +1,11 @@
# Environment variables
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this must be used from the root of the repo too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is still present

@@ -0,0 +1,142 @@
# Environment variable definitions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we actually run nwaku-compose with needed configs for us here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nwaku-compose comes with a bunch of other stuff we don't need (e.g. grafana/prometheus)

"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/run#readme",
"repository": {
"type": "git",
"url": "https://github.com/waku-org/js-waku.git"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: git prefix to use for url #2688

"check:spelling": "cspell \"{README.md,src/**/*.ts,scripts/**/*.ts,tests/**/*.ts}\""
},
"engines": {
"node": ">=18"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use 24 now #2688

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually we have 22, CI uses 24

"mocha": "^10.3.0",
"npm-run-all": "^4.1.5",
"ts-node": "^10.9.2",
"tsx": "^4.7.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need tsx?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was used to run scripts in package.json, but can be safely removed and use dist/... instead

"chai": "^4.3.10",
"cspell": "^8.6.1",
"esbuild": "^0.21.5",
"express": "^4.21.2",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

express seems completely unnecessary

as I see it is used to check for REST endpoints
we should not do such testing and just check in our CI that docker is getting run with correct commands - smoke testing

anything else does not add value to our CI

https://en.wikipedia.org/wiki/Smoke_testing_(software)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using this for testing against the env via browser, but those tests (and this dependency) can be removed. i think the node tests are sufficient (and are not run in CI anyways)

};

function checkAndPullImages(): void {
const nwakuImage = process.env.NWAKU_IMAGE || "wakuorg/nwaku:v0.36.0";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the configs and default values must be in const or config file

this includes: nwaku image, postgres image, CLUSTER_ID below

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in other files too
please, double check it as I see that there are still some magic numbers


# Shared nwaku configuration
x-nwaku-base: &nwaku-base
image: ${NWAKU_IMAGE:-wakuorg/nwaku:v0.36.0}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like you don't need to hardcode here any versions of nwaku, postgres, or TC PORT - seems everything get's passed from our script - so it is safe to assume the values are present and no fallback is needed

Copy link
Collaborator

@weboko weboko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left comments, overall looks super useful!

Copy link
Collaborator

@weboko weboko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@adklempner adklempner merged commit 0df18b2 into master Oct 23, 2025
19 of 20 checks passed
@adklempner adklempner deleted the feat/waku-run branch October 23, 2025 04:38
@weboko weboko mentioned this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: local development environment

2 participants