mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-01-13 21:43:07 +00:00
The waku test fleet is unstable and should not be used as boostrap. The issue is that DNS Discovery looks for "2" nodes and stop there. Meaning that if those "discovered" nodes are not reachable (ie, coming from test suite). js-waku does not connect.
23 lines
593 B
TypeScript
23 lines
593 B
TypeScript
import type { PeerDiscovery } from "@libp2p/interface";
|
|
import {
|
|
enrTree,
|
|
wakuDnsDiscovery,
|
|
wakuLocalPeerCacheDiscovery,
|
|
wakuPeerExchangeDiscovery
|
|
} from "@waku/discovery";
|
|
import { type Libp2pComponents, PubsubTopic } from "@waku/interfaces";
|
|
|
|
export function defaultPeerDiscoveries(
|
|
pubsubTopics: PubsubTopic[]
|
|
): ((components: Libp2pComponents) => PeerDiscovery)[] {
|
|
const dnsEnrTrees = [enrTree["SANDBOX"]];
|
|
|
|
const discoveries = [
|
|
wakuDnsDiscovery(dnsEnrTrees),
|
|
wakuLocalPeerCacheDiscovery(),
|
|
wakuPeerExchangeDiscovery(pubsubTopics)
|
|
];
|
|
|
|
return discoveries;
|
|
}
|