import BaseService from '../common/BaseService'; export default class DealReplicationWorker extends BaseService { private readonly lotusCMD; private readonly boostCMD; private queryLotusBlockHeight; private cronRefArray; constructor(); start(): Promise; private readonly PollInterval; private readonly ImmediatePollInterval; private startPollWork; private pollWork; private checkCronChange; private pollReplicationWork; /** * Create providers list by storageProviders. Currently it is just a list of providers separated by comma. * * @param storageProviders * @returns */ static generateProvidersList(storageProviders: string): Array; /** * Check if given provider is using lotus or boost * * @param provider * @returns true is lotus, false is boost */ isUsingLotus(provider: string): Promise; private static calculatePriceWithSize; private static assembleDownloadUrl; private isUrlReachable; createDealCmd(useLotus: boolean, provider: string, replicationRequest: { isOffline: boolean; maxPrice: number; client: string; isVerfied: boolean; duration: number; urlPrefix: string; }, carFile: { pieceCid?: string; pieceSize?: number; dataCid?: string; filenameOverride?: string; carSize?: number; }, startEpoch: number): Promise; private stopCronIfExist; private checkAndMarkCompletion; /** * Main function of deal making * @param replicationRequest */ private replicate; makeDeal(dealCmd: string, pieceCid: string, provider: string, dealsMadePerSP: number, useLotus: boolean, retryTimeout: number, maxRetry: number): Promise<{ dealCid: string; errorMsg: string; state: string; retryTimeout: number; }>; private startHealthCheck; private healthCheck; private checkIsMainnet; private currentBlockHeight; private lotusBlockHeightAPI; private getLotusNodeUrl; }