Skip to content

DnsSeedProvider

Defined in: src/discovery/DnsSeedProvider.ts:38

Seed provider backed by DNS. Default mode resolves A records and pairs each IP with the configured port; SRV mode picks up name:port directly.

The actual DNS functions are injected via settings so tests can stub them without touching the network. The real impl uses node:dns/promises.

TTL cache: repeated lookups inside the configured cacheTtlMs window are served from a per-instance in-memory cache, halving the DNS load on large clusters where each node polls the same name.

new DnsSeedProvider(settings): DnsSeedProvider

Defined in: src/discovery/DnsSeedProvider.ts:42

DnsSeedProviderSettings

DnsSeedProvider

invalidateCacheForTest(): void

Defined in: src/discovery/DnsSeedProvider.ts:62

Test hook — drop the cached entry so the next lookup() re-queries DNS.

void


lookup(): Promise<NodeAddress[]>

Defined in: src/discovery/DnsSeedProvider.ts:49

Return candidate seed addresses.

Promise<NodeAddress[]>

SeedProvider.lookup