import { createLightNode } from "@waku/sdk";
async function main() {
// Create and start a Light Node
const node = await createLightNode({ defaultBootstrap: true });
await node.start();
console.log("Node started");
// Use the stop() function to stop a running node
await node.stop();
await node.libp2p.stop();
console.log("Stopped");
}
main();
Ignore WebSocket connection failures
Waku tries to discover peers and some of them are expected to fail
Node started
Stopped