@waku/discovery
Version:
Contains various discovery mechanisms: DNS Discovery (EIP-1459, Peer Exchange, Local Peer Cache Discovery.
14 lines (13 loc) • 878 B
TypeScript
import type { IEnr, NodeCapabilityCount } from "@waku/interfaces";
/**
* Fetch nodes using passed [[getNode]] until all wanted capabilities are
* fulfilled or the number of [[getNode]] call exceeds the sum of
* [[wantedNodeCapabilityCount]] plus [[errorTolerance]].
*/
export declare function fetchNodesUntilCapabilitiesFulfilled(wantedNodeCapabilityCount: Partial<NodeCapabilityCount>, errorTolerance: number, getNode: () => Promise<IEnr | null>): Promise<IEnr[]>;
/**
* Fetch nodes using passed [[getNode]] until all wanted capabilities are
* fulfilled or the number of [[getNode]] call exceeds the sum of
* [[wantedNodeCapabilityCount]] plus [[errorTolerance]].
*/
export declare function yieldNodesUntilCapabilitiesFulfilled(wantedNodeCapabilityCount: Partial<NodeCapabilityCount>, errorTolerance: number, getNode: () => Promise<IEnr | null>): AsyncGenerator<IEnr>;