UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

33 lines 1.24 kB
export { RelevantPeerStatus }; var RelevantPeerStatus; (function (RelevantPeerStatus) { RelevantPeerStatus["Unknown"] = "unknown"; RelevantPeerStatus["relevant"] = "relevant"; RelevantPeerStatus["irrelevant"] = "irrelevant"; })(RelevantPeerStatus || (RelevantPeerStatus = {})); /** * Make data available to multiple components in the network stack. * Due to class dependencies some modules have circular dependencies, like PeerManager - ReqResp. * This third party class allows data to be available to both. * * The pruning and bounding of this class is handled by the PeerManager */ export class PeersData { connectedPeers = new Map(); getAgentVersion(peerIdStr) { return this.connectedPeers.get(peerIdStr)?.agentVersion ?? "NA"; } getPeerKind(peerIdStr) { return this.connectedPeers.get(peerIdStr)?.agentClient ?? null; } getEncodingPreference(peerIdStr) { return this.connectedPeers.get(peerIdStr)?.encodingPreference ?? null; } setEncodingPreference(peerIdStr, encoding) { const peerData = this.connectedPeers.get(peerIdStr); if (peerData) { peerData.encodingPreference = encoding; } } } //# sourceMappingURL=peersData.js.map