fryorcraken 6d55af947e
fix!: remove node level pubsub topic concept
For an edge node, there is no such thing as a "pubsub topic configuration". An edge node should be able to operate for any possible shard, and it is a per-protocol matter (eg send message with light push).

A relay node do subscribe to shards, but in this case, even metadata protocol does not need to advertise them, this is already handled by gossipsub.

Only service node should advertise their shards via metadata protocol, which is out of scope for js-waku.

# Conflicts:
#	packages/interfaces/src/connection_manager.ts
2025-07-17 09:57:15 +10:00

30 lines
763 B
TypeScript

import type { CreateNodeOptions, LightNode } from "@waku/interfaces";
import { WakuNode } from "../waku/index.js";
import { createLibp2pAndUpdateOptions } from "./libp2p.js";
/**
* Create a Waku node that uses Waku Light Push, Filter and Store to send and
* receive messages, enabling low resource consumption.
* Uses Waku Filter V2 by default.
*/
export async function createLightNode(
options: CreateNodeOptions = {}
): Promise<LightNode> {
const libp2p = await createLibp2pAndUpdateOptions(options);
const node = new WakuNode(options, libp2p, {
store: true,
lightpush: true,
filter: true
}) as LightNode;
// only if `false` is passed explicitly
if (options?.autoStart !== false) {
await node.start();
}
return node;
}