Ivan FB 070c86c0eb
fix(tests): add relay-only peer nwaku so mesh forms before tests publish
Tests built on `runNodes` (Store, Filter single-node, etc.) start a single
nwaku container and a js-waku LightNode. LightNodes never join the
gossipsub mesh, so the nwaku ends up with zero mesh peers on the test
topic. After nwaku PR #3669 (Jan 2026) the REST endpoint
`POST /relay/v1/auto/messages` now returns HTTP 400 with
`NoPeersToPublish` instead of silently succeeding in that state, which
causes `ServiceNode.sendMessage()` to return `false` and fails every
test that seeds the store via REST publish. That broke ~50/56 of the
failing assertions in the nwaku `js-waku-node` CI job and the job has
been red on every master run since.

Fix the test harness rather than reverting the (correct) nwaku change:

- `runNodes` now starts a second relay-only `ServiceNode` chained to the
  primary via `--staticnode`, subscribed to the same shards/topics. Once
  the gossipsub mesh GRAFTs, REST publishes on the primary have a real
  mesh peer and succeed.
- The peer's lifecycle is bound to the primary through a new private
  `companion` field + `setCompanion()` getter; existing `tearDownNodes`
  calls keep working unchanged.
- Add `ServiceNode.waitForMeshPeers(pubsubTopics, {timeoutMs})` polling
  `/admin/v1/peers/mesh`, called before `runNodes` returns so the first
  publish doesn't race the heartbeat.

Doesn't touch `ServiceNodesFleet` (already multi-node); doesn't address
the Filter Multiple-Service-Nodes duplication or Peer Exchange compliance
timeouts surfaced in the same run — those are separate bugs.
2026-05-21 16:35:54 +02:00
2021-03-05 09:34:01 +11:00
2022-11-02 14:16:31 +11:00
2025-10-23 12:53:04 +02:00
2025-10-23 12:53:04 +02:00
2025-10-23 12:53:04 +02:00
2023-09-21 10:57:37 +02:00

GitHub Action Code Climate Discord chat

js-waku

A TypeScript implementation of the Waku v2 protocol.

Documentation

API Documentation can also be generated locally:

git clone https://github.com/waku-org/js-waku.git
cd js-waku
npm install
npm run doc

Using Nix shell

git clone https://github.com/waku-org/js-waku.git
cd js-waku
nix develop
npm install
npm run doc

Bugs, Questions & Features

If you encounter any bug or would like to propose new features, feel free to open an issue.

For general discussion, get help or latest news, join us on Vac Discord or the Waku Telegram Group.

Roadmap

You can track progress on the project board.

Contributing

See CONTRIBUTING.md.

License

Licensed and distributed under either of

or

at your option. These files may not be copied, modified, or distributed except according to those terms.

Description
JavaScript implementation of Waku v2
https://js.waku.org
Readme
Languages
TypeScript 95.1%
JavaScript 4.6%
Dockerfile 0.1%
Shell 0.1%