UNPKG

@waku/discovery

Version:

Contains various discovery mechanisms: DNS Discovery (EIP-1459, Peer Exchange, Local Peer Cache Discovery.

18 lines (17 loc) 907 B
import { TypedEventEmitter } from "@libp2p/interface"; import { PeerDiscovery, PeerDiscoveryEvents, Startable } from "@libp2p/interface"; import type { Libp2pComponents, PeerCacheDiscoveryOptions } from "@waku/interfaces"; export declare class PeerCacheDiscovery extends TypedEventEmitter<PeerDiscoveryEvents> implements PeerDiscovery, Startable { private readonly components; private isStarted; private readonly cache; constructor(components: Libp2pComponents, options?: Partial<PeerCacheDiscoveryOptions>); get [Symbol.toStringTag](): string; start(): Promise<void>; stop(): void | Promise<void>; private handleDiscoveredPeer; private discoverPeers; private readPeerInfoFromCache; private writePeerInfoToCache; } export declare function wakuPeerCacheDiscovery(options?: Partial<PeerCacheDiscoveryOptions>): (components: Libp2pComponents) => PeerCacheDiscovery;