mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-13 19:23:14 +00:00
* up lock * make ConnectionManager use ctor * reform connection manager configurations * remove log param from peerManager * make PeerManager use only ConnectionManager, move getPeers to ConnectionManager, remove not needed code * remove allPeers and connectedPeers from BaseProtocolCore, update tests, add getPeers for IWaku * use only one peerManager from Waku object * remove IBaseProtocolSDK and merge with PeerManager * re-implement peerManager, remove ProtocolUseOptions * remove not needed test, up lock * update deps and lock * remove old test for peerManager, fix check and spell * rename to getConnectedPeers * feat: improve filter subscriptions (#2193) * add message cache to Filter * remove WakuOptions and use only ProtocolCreateOptions * move subscribe options to createLightNode Fitler protocol options * rename SubscriptionManager to Subscription * rename to CreateNodeOptions * add warning * feat: introduce subscription manager (#2202) * feat: inroduce subscription manager * fix: make pipeline succeed (#2238) * fix test * use hardcoded value * update playwright * fix test:browser * up lock * make peer retrieval probabilistic * add comments * up lightpush tests * add tests for peer_manager, improve folder structure * create named files for protocols * create named files, simplify project structure * remove only
23 lines
664 B
TypeScript
23 lines
664 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, pubsubTopics } = await createLibp2pAndUpdateOptions(options);
|
|
|
|
return new WakuNode(pubsubTopics, options, libp2p, {
|
|
store: true,
|
|
lightpush: true,
|
|
filter: true
|
|
}) as LightNode;
|
|
}
|