mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-02-01 06:43:15 +00:00
* make relay folder * make relay folder * adjust message collector for relay * small fix * small fix * small fix * split tests more * small fixes * small fix * new test * fix pubsubtopic name * new subscribe tests * new subscribe tests * new tests * small fix after ci run * small fix after ci run2 * fix skipped test * added issue for skipped test
30 lines
1019 B
TypeScript
30 lines
1019 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 CustomContentTopic = "/test/2/waku-relay/utf8";
|
|
export const CustomPubSubTopic = "/some/pubsub/topic";
|
|
export const CustomEncoder = createEncoder({
|
|
contentTopic: CustomContentTopic,
|
|
pubsubTopic: CustomPubSubTopic
|
|
});
|
|
export const CustomDecoder = createDecoder(
|
|
CustomContentTopic,
|
|
CustomPubSubTopic
|
|
);
|
|
|
|
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]))
|
|
);
|
|
}
|