AutoRelayConfig.static constructor
AutoRelayConfig.static(})
Implementation
factory AutoRelayConfig.static(
List<AddrInfo> staticRelays, {
Clock? clock,
Duration? bootDelay, // bootDelay is not set by Go's WithStaticRelays
Duration? backoff, // backoff is not set by Go's WithStaticRelays
Duration? maxCandidateAge, // maxCandidateAge is not set by Go's WithStaticRelays
Duration? minInterval, // minInterval is not set by Go's WithStaticRelays
MetricsTracer? metricsTracer,
}) {
if (staticRelays.isEmpty) {
throw ArgumentError('staticRelays list cannot be empty if provided.');
}
return AutoRelayConfig(
clock: clock,
staticRelays: staticRelays,
// In Go, WithStaticRelays sets peerSource, minCandidates, maxCandidates, and desiredRelays.
// minCandidates, maxCandidates, desiredRelays are set to len(staticRelays).
minCandidates: staticRelays.length,
maxCandidates: staticRelays.length,
desiredRelays: staticRelays.length,
// Other parameters use defaults or provided values
bootDelay: bootDelay,
backoff: backoff,
maxCandidateAge: maxCandidateAge,
minInterval: minInterval,
metricsTracer: metricsTracer,
);
}