Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DnsNodeDiscovery

Hierarchy

  • DnsNodeDiscovery

Index

Constructors

Properties

_DNSTreeCache: {}

Type declaration

  • [key: string]: string
_errorTolerance: number = 10

Methods

  • _getTXTRecord(subdomain: string, context: SearchContext): Promise<string>
  • 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.

    Parameters

    Returns Promise<string>

  • 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.

    Parameters

    Returns Promise<null | ENR>

  • getPeers(maxQuantity: number, enrTreeUrls: string[]): Promise<ENR[]>
  • Returns a list of verified peers listed in an EIP-1459 DNS tree. Method may return fewer peers than requested if maxQuantity is larger than the number of ENR records or the number of errors/duplicate peers encountered by randomized search exceeds maxQuantity plus the errorTolerance factor.

    Parameters

    • maxQuantity: number
    • enrTreeUrls: string[]

    Returns Promise<ENR[]>

Generated using TypeDoc