fetchSeedNodes static method
Fetches seed nodes from the remote configuration with fallback to defaults.
This method attempts to fetch the latest seed nodes from the Komodo Platform repository and converts them to the string format expected by the KDF startup configuration.
Returns a list of seed node host addresses. If fetching fails, returns the hardcoded default seed nodes as a fallback.
Implementation
static Future<({List<String> seedNodes, int netId})> fetchSeedNodes({
bool filterForWeb = kIsWeb,
}) async {
try {
final config = await _getRuntimeConfig();
final (
seedNodes: nodes,
netId: netId,
) = await SeedNodeUpdater.fetchSeedNodes(
filterForWeb: filterForWeb,
config: config,
);
return (
seedNodes: SeedNodeUpdater.seedNodesToStringList(nodes),
netId: netId,
);
} catch (e) {
if (KdfLoggingConfig.verboseLogging) {
print('WARN Failed to fetch seed nodes from remote: $e');
print('WARN Falling back to default seed nodes');
}
return (
seedNodes: getDefaultSeedNodes(),
netId: kDefaultNetId,
);
}
}