@ethereumjs/devp2p / DNS
• new DNS(options?
)
Name | Type |
---|---|
options |
DNSOptions |
packages/devp2p/src/dns/dns.ts:27
▸ __setNativeDNSModuleResolve(mock
): void
Only used for testing. A stopgap to enable successful
TestDouble mocking of the native dns
module.
Name | Type | Description |
---|---|---|
mock |
any |
TestDouble fn |
void
packages/devp2p/src/dns/dns.ts:208
▸ getPeers(maxQuantity
, dnsNetworks
): Promise
<PeerInfo
[]>
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.
Name | Type | Description |
---|---|---|
maxQuantity |
number |
max number to get |
dnsNetworks |
string [] |
enrTree strings (See EIP-1459 for format) |
Promise
<PeerInfo
[]>