import { publicKey } from '@shardeum-foundation/lib-types'; import { CycleMarker } from '@shardeum-foundation/lib-types/build/src/p2p/CycleCreatorTypes'; import { ArchiverDownMsg, ArchiverRefutesLostMsg, ArchiverUpMsg, InvestigateArchiverMsg } from '@shardeum-foundation/lib-types/build/src/p2p/LostArchiverTypes'; import { Node } from '@shardeum-foundation/lib-types/build/src/p2p/NodeListTypes'; import { SignedObject } from '@shardeum-foundation/lib-types/build/src/p2p/P2PTypes'; import { LostArchiverRecord } from './state'; /** Lost Archivers Functions */ export declare function createLostArchiverRecord(obj: Partial): LostArchiverRecord; /** * Marks an Archiver as lost in our internal map. * This function gets called anytime communication with an Archiver breaks down * @param publicKey - The public key of the lost Archiver * @param errorMsg - The error message received when communication broke down * Called by Archivers.ts */ export declare function reportLostArchiver(publicKey: publicKey, errorMsg: string): void; /** * Investigates a reported lost Archiver. * This function gets called to verify if an Archiver is indeed lost * @param publicKey - The public key of the Archiver to investigate */ export declare function investigateArchiver(investigateMsg: SignedObject): Promise; /** * Picks an investigator node for lost archiver detection * @param record record in from the lostArchiverRecordMap * @returns The node ID of the investigator for that specific record */ export declare function getInvestigator(target: publicKey, marker: CycleMarker): Node; /** * Informs the investigator node that an Archiver is lost * @param target - The public key of the lost Archiver */ export declare function informInvestigator(target: publicKey): void; /** * Tells the network that an Archiver is down * @param archiverKey - The public key of the down Archiver */ export declare function tellNetworkArchiverIsDown(record: LostArchiverRecord): void; /** * Tells the network thtellNetworkArchiverIsUpat an Archiver as up. * @param publicKey - The public key of the Archiver that is now up */ export declare function tellNetworkArchiverIsUp(record: LostArchiverRecord): void; /** * Checks for errors in an ArchiverDownMsg * @param msg - The ArchiverDownMsg to check * @returns null if there are no errors, and a string describing the error otherwise */ export declare function errorForArchiverDownMsg(msg: SignedObject | null): string | null; /** * Checks for errors in an ArchiverUpMsg * @param msg - The ArchiverUpMsg to check * @returns null if there are no errors, and a string describing the error otherwise */ export declare function errorForArchiverUpMsg(msg: SignedObject | null): string | null; /** * Checks for errors in an ArchiverRefutesLostMsg * @param msg - The ArchiverUpMsg to check * @returns null if there are no errors, and a string describing the error otherwise */ export declare function errorForArchiverRefutesLostMsg(msg: SignedObject | null): string | null; /** * Checks for errors in an InvestigateArchiverMsg * @param msg - The InvestigateArchiverMsg to check * @returns null if there are no errors, and a string describing the error otherwise */ export declare function errorForInvestigateArchiverMsg(msg: SignedObject | null): string | null;