@waku/discovery
Version:
Contains various discovery mechanisms: DNS Discovery (EIP-1459, Peer Exchange, Local Peer Cache Discovery.
24 lines (23 loc) • 826 B
TypeScript
import type { DnsClient, IEnr } from "@waku/interfaces";
export declare class DnsNodeDiscovery {
private readonly dns;
private readonly _DNSTreeCache;
static dnsOverHttp(dnsClient?: DnsClient): Promise<DnsNodeDiscovery>;
constructor(dns: DnsClient);
/**
* Retrieve the next peers from the passed [[enrTreeUrls]],
*/
getNextPeer(enrTreeUrls: string[]): AsyncGenerator<IEnr>;
/**
* Runs a recursive, randomized descent of the DNS tree to retrieve a single
* ENR record as an ENR. Returns null if parsing or DNS resolution fails.
*/
private _search;
/**
* Retrieves the TXT record stored at a location from either
* this DNS tree cache or via DNS query.
*
* @throws if the TXT Record contains non-UTF-8 values.
*/
private _getTXTRecord;
}