js-waku/packages/tests/tests/waku.node.optional.spec.ts
fryorcraken d27db21ba5
fix: do not use waku test fleet as default bootstrap (#2312)
The waku test fleet is unstable and should not be used as boostrap.

The issue is that DNS Discovery looks for "2" nodes and stop there. Meaning that if those "discovered" nodes are not reachable (ie, coming from test suite). js-waku does not connect.
2025-03-20 16:32:27 +01:00

33 lines
766 B
TypeScript

import { enrTree, wakuDnsDiscovery } from "@waku/discovery";
import { LightNode } from "@waku/interfaces";
import { createLightNode } from "@waku/sdk";
import { expect } from "chai";
describe("Use static and several ENR trees for bootstrap", function () {
let waku: LightNode;
it("", async function () {
this.timeout(10_000);
const NODE_REQUIREMENTS = {
store: 3,
lightPush: 3,
filter: 3
};
waku = await createLightNode({
libp2p: {
peerDiscovery: [
wakuDnsDiscovery([enrTree["SANDBOX"]], NODE_REQUIREMENTS)
]
}
});
await waku.start();
const peersDiscovered = await waku.libp2p.peerStore.all();
// 3 from DNS Disc
expect(peersDiscovered.length).to.eq(3);
});
});