mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-01-14 05:53:07 +00:00
* merge branches * tests: use a generator for sharded pubsub topics * fix namespace edge case * move shardInfo to pubsubTopic logic in waku.ts * simplify encoder/decoder creation logic + update tests * sharding utils: add error handling * remove redundant test util * baseprotocol: create abstraction for initialising pubsub topics * fix: `createDecoder` interface * filter: createSubscription takes shardInfo instead of pubsubTopicStr * fix: sharding utils for error handling * SingleShardInfo: use a new interface instead of omitting and rename namespace * change redundant namespaces
19 lines
695 B
TypeScript
19 lines
695 B
TypeScript
import { createDecoder, createEncoder, waitForRemotePeer } from "@waku/core";
|
|
import { Protocols, RelayNode } from "@waku/interfaces";
|
|
import { Logger } from "@waku/utils";
|
|
|
|
export const messageText = "Relay works!";
|
|
export const TestContentTopic = "/test/1/waku-relay/utf8";
|
|
export const TestEncoder = createEncoder({ contentTopic: TestContentTopic });
|
|
export const TestDecoder = createDecoder(TestContentTopic);
|
|
export const log = new Logger("test:relay");
|
|
|
|
export async function waitForAllRemotePeers(
|
|
...nodes: RelayNode[]
|
|
): Promise<void> {
|
|
log.info("Wait for mutual pubsub subscription");
|
|
await Promise.all(
|
|
nodes.map((node) => waitForRemotePeer(node, [Protocols.Relay]))
|
|
);
|
|
}
|