import { ChainName } from '../types'; import { ScanOptions, ScanResult } from './types'; /** * Scan the network for a specific chain * * This function: * 1. Checks health of bootstrap endpoints from CHAINS_SPECS * 2. Discovers additional peers via duniter_peerings * 3. Checks health of discovered peers * 4. Calculates consensus across all nodes * 5. Selects the best RPC and Squid endpoints * * @param chain - Chain to scan (g1, gtest, gdev, gdev_local) * @param options - Scan options (timeout, concurrency, includeUnhealthy) * @returns ScanResult with all discovered nodes and best endpoints * * @example * ```ts * const result = await scanNetwork('gdev') * * console.log(`Found ${result.nodes.length} nodes`) * console.log(`Consensus: ${result.consensusLevel} at block ${result.consensusBlock}`) * * if (result.bestRpc) { * console.log(`Best RPC: ${result.bestRpc.endpoint} (${result.bestRpc.latency}ms)`) * } * ``` */ export declare function scanNetwork(chain: ChainName, options?: ScanOptions): Promise; /** * Quick scan - only check bootstrap endpoints, no discovery * * Faster than full scanNetwork but may miss some nodes. * * @param chain - Chain to scan * @param options - Scan options * @returns ScanResult with bootstrap nodes only */ export declare function quickScan(chain: ChainName, options?: ScanOptions): Promise; /** * Find the fastest healthy endpoint from a list * * @param endpoints - Array of endpoint URLs to test * @param type - Type of endpoints ('rpc' or 'squid') * @param timeout - Timeout per check in ms * @returns Fastest healthy endpoint or null */ export declare function findFastestEndpoint(endpoints: string[], type: 'rpc' | 'squid', timeout?: number): Promise;