mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-07 08:13:12 +00:00
* update Filter test suit, make service nodes connected to each other, remove single node Filter test suit, use 0.35 nwaku image * update light push tests * improve auto shard tests * update static sharding test * skip blocked tests * fix test * remove usage of pusubtopic with nwaku * remove comment
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { createEncoder } from "@waku/core";
|
|
import { LightNode, NetworkConfig, Protocols } from "@waku/interfaces";
|
|
import { utf8ToBytes } from "@waku/sdk";
|
|
import { createLightNode } from "@waku/sdk";
|
|
import { contentTopicToPubsubTopic, Logger } from "@waku/utils";
|
|
import { Context } from "mocha";
|
|
|
|
import { runNodes as runNodesBuilder, ServiceNode } from "../../src/index.js";
|
|
|
|
// Constants for test configuration.
|
|
export const log = new Logger("test:lightpush");
|
|
export const TestContentTopic = "/test/1/waku-light-push/utf8";
|
|
export const ClusterId = 3;
|
|
export const TestPubsubTopic = contentTopicToPubsubTopic(
|
|
TestContentTopic,
|
|
ClusterId
|
|
);
|
|
export const TestShardInfo = {
|
|
contentTopics: [TestContentTopic],
|
|
clusterId: ClusterId
|
|
};
|
|
export const TestEncoder = createEncoder({
|
|
contentTopic: TestContentTopic,
|
|
pubsubTopic: TestPubsubTopic
|
|
});
|
|
export const messageText = "Light Push works!";
|
|
export const messagePayload = { payload: utf8ToBytes(messageText) };
|
|
|
|
export const runNodes = (
|
|
context: Context,
|
|
shardInfo: NetworkConfig
|
|
): Promise<[ServiceNode, LightNode]> =>
|
|
runNodesBuilder<LightNode>({
|
|
context,
|
|
createNode: createLightNode,
|
|
protocols: [Protocols.LightPush, Protocols.Filter],
|
|
networkConfig: shardInfo
|
|
});
|