fix: use nwaku test fleet

Filter bug not yet deployed in prod

ref: https://github.com/status-im/nwaku/pull/1090
This commit is contained in:
fryorcraken.eth 2022-08-29 15:16:05 +10:00
parent 3606654b4d
commit 6508403912
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 12 additions and 1 deletions

View File

@ -11,12 +11,23 @@ import { validatePublicKeyMessage } from "./crypto";
import { Message } from "./messaging/Messages";
import { equals } from "uint8arrays/equals";
import { createWaku } from "js-waku/lib/create_waku";
import { PeerDiscoveryStaticPeers } from "js-waku/lib/peer_discovery_static_list";
import {
getPredefinedBootstrapNodes,
Fleet,
} from "js-waku/lib/predefined_bootstrap_nodes";
export const PublicKeyContentTopic = "/eth-pm/1/public-key/proto";
export const PrivateMessageContentTopic = "/eth-pm/1/private-message/proto";
export async function initWaku(): Promise<Waku> {
const waku = await createWaku({ defaultBootstrap: true });
const waku = await createWaku({
libp2p: {
peerDiscovery: [
new PeerDiscoveryStaticPeers(getPredefinedBootstrapNodes(Fleet.Test)),
],
},
});
await waku.start();
await waitForRemotePeer(waku, [Protocols.Filter, Protocols.LightPush]);