UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

21 lines 709 B
import { PeerIdStr } from "../../../util/peerId.js"; import { Batch } from "../batch.js"; /** * Balance and organize peers to perform requests with a SyncChain * Shuffles peers only once on instantiation */ export declare class ChainPeersBalancer { private peers; private activeRequestsByPeer; constructor(peers: PeerIdStr[], batches: Batch[]); /** * Return the most suitable peer to retry * Sort peers by (1) no failed request (2) less active requests, then pick first */ bestPeerToRetryBatch(batch: Batch): PeerIdStr | undefined; /** * Return peers with 0 or no active requests */ idlePeers(): PeerIdStr[]; } //# sourceMappingURL=peerBalancer.d.ts.map