@holographxyz/cli
Version:
Holograph operator CLI
56 lines (55 loc) • 2.53 kB
TypeScript
import { TransactionResponse } from '@ethersproject/abstract-provider';
import { Environment } from '@holographxyz/environment';
import { OperatorMode, BlockJob } from '../../utils/network-monitor';
import { OperatorJobAwareCommand } from '../../utils/operator-job';
/**
* Operator
* Description: The primary command for operating jobs on the Holograph network.
*/
export default class Operator extends OperatorJobAwareCommand {
static description: string;
static examples: string[];
static flags: {
healthCheck: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
healthCheckPort: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
networks: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined>;
mode: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
sync: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
unsafePassword: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
};
/**
* Operator class variables
*/
operatorMode: OperatorMode;
environment: Environment;
jobsFile: string;
/**
* Command Entry Point
*/
run(): Promise<void>;
exitCallback(): void;
/**
* Build the filters to search for events via the network monitor
*/
filterBuilder(): Promise<void>;
/**
* Process the transactions in each block job
*/
processTransactions(job: BlockJob, transactions: TransactionResponse[]): Promise<void>;
handleBridgeOutEvent(transaction: TransactionResponse, network: string, tags: (string | number)[]): Promise<void>;
handleBridgeInEvent(transaction: TransactionResponse, network: string, tags: (string | number)[]): Promise<void>;
/**
* Handle the AvailableOperatorJob event from the LayerZero contract when one is picked up while processing transactions
*/
handleAvailableOperatorJobEvent(transaction: TransactionResponse, network: string, tags: (string | number)[]): Promise<void>;
processOperatorJob: (network: string, jobHash: string, tags: (string | number)[]) => Promise<void>;
processOperatorJobs: (network: string, jobHash?: string) => void;
/**
* Execute the job
*/
executeJob(jobHash: string, tags: (string | number)[]): Promise<boolean>;
/**
* Execute the lz message payload on the destination network
*/
executeLzPayload(network: string, jobHash: string, args: any[], tags: (string | number)[]): Promise<void>;
}