@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
122 lines (121 loc) • 6.42 kB
TypeScript
import { type NodeCommandConfigs } from './configs.js';
import { type LockManager } from '../../core/lock/lock-manager.js';
import { type NodeCommandTasks } from './tasks.js';
import { AnyListrContext, type ArgvStruct } from '../../types/aliases.js';
import { type Optional, type SoloListrTask } from '../../types/index.js';
import { CommandHandler } from '../../core/command-handler.js';
import { DeploymentPhase } from '../../data/schema/model/remote/deployment-phase.js';
import { type RemoteConfigRuntimeStateApi } from '../../business/runtime-state/api/remote-config-runtime-state-api.js';
import { LedgerPhase } from '../../data/schema/model/remote/ledger-phase.js';
import { LocalConfigRuntimeState } from '../../business/runtime-state/config/local/local-config-runtime-state.js';
import { type Zippy } from '../../core/zippy.js';
import { type ConfigManager } from '../../core/config-manager.js';
import { type K8Factory } from '../../integration/kube/k8-factory.js';
export declare class NodeCommandHandlers extends CommandHandler {
private readonly leaseManager;
private readonly localConfig;
private readonly remoteConfig;
private readonly tasks;
private readonly configs;
private readonly k8Factory;
private readonly zippy?;
private readonly nodeConfigManager;
constructor(leaseManager: LockManager, configManager: ConfigManager, localConfig: LocalConfigRuntimeState, remoteConfig: RemoteConfigRuntimeStateApi, tasks: NodeCommandTasks, configs: NodeCommandConfigs, k8Factory: K8Factory, zippy?: Zippy);
private static readonly ADD_CONTEXT_FILE;
private static readonly DESTROY_CONTEXT_FILE;
private static readonly UPDATE_CONTEXT_FILE;
private static readonly UPGRADE_CONTEXT_FILE;
private resolveOutputDirectory;
private resolveDeploymentFlag;
private resolveQuietFlag;
private ensureInteractiveSelectionPrompt;
/** ******** Task Lists **********/
private destroyPrepareTaskList;
private destroySubmitTransactionsTaskList;
private destroyExecuteTaskList;
private addPrepareTasks;
private addSubmitTransactionsTasks;
private addExecuteTasks;
private updatePrepareTasks;
private updateSubmitTransactionsTasks;
private updateExecuteTasks;
private upgradePrepareTasks;
private upgradeSubmitTransactionsTasks;
private upgradeExecuteTasks;
/** ******** Handlers **********/
prepareUpgrade(argv: ArgvStruct): Promise<boolean>;
freezeUpgrade(argv: ArgvStruct): Promise<boolean>;
update(argv: ArgvStruct): Promise<boolean>;
updatePrepare(argv: ArgvStruct): Promise<boolean>;
updateSubmitTransactions(argv: ArgvStruct): Promise<boolean>;
updateExecute(argv: ArgvStruct): Promise<boolean>;
upgradePrepare(argv: ArgvStruct): Promise<boolean>;
upgradeSubmitTransactions(argv: ArgvStruct): Promise<boolean>;
upgradeExecute(argv: ArgvStruct): Promise<boolean>;
upgrade(argv: ArgvStruct): Promise<boolean>;
destroy(argv: ArgvStruct): Promise<boolean>;
destroyPrepare(argv: ArgvStruct): Promise<boolean>;
destroySubmitTransactions(argv: ArgvStruct): Promise<boolean>;
destroyExecute(argv: ArgvStruct): Promise<boolean>;
add(argv: ArgvStruct): Promise<boolean>;
addPrepare(argv: ArgvStruct): Promise<boolean>;
addSubmitTransactions(argv: ArgvStruct): Promise<boolean>;
addExecute(argv: ArgvStruct): Promise<boolean>;
logs(argv: ArgvStruct): Promise<boolean>;
analyze(argv: ArgvStruct): Promise<boolean>;
private resolveDeploymentForLogs;
all(argv: ArgvStruct, excludeSensitiveData?: boolean): Promise<boolean>;
debug(argv: ArgvStruct, excludeSensitiveData?: boolean): Promise<boolean>;
connections(argv: ArgvStruct): Promise<boolean>;
private validateConnectionsTaskList;
/**
* Collects a full debug archive for the deployment (logs + configs + zip) and
* then creates a GitHub issue using the `gh` CLI with a pre-filled title and body.
* The generated archive is referenced for the user to attach manually via the GitHub UI.
*
*/
report(argv: ArgvStruct): Promise<boolean>;
states(argv: ArgvStruct): Promise<boolean>;
refresh(argv: ArgvStruct): Promise<boolean>;
keys(argv: ArgvStruct): Promise<boolean>;
stop(argv: ArgvStruct): Promise<boolean>;
start(argv: ArgvStruct): Promise<boolean>;
setup(argv: ArgvStruct): Promise<boolean>;
freeze(argv: ArgvStruct): Promise<boolean>;
restart(argv: ArgvStruct): Promise<boolean>;
/**
* Changes the state from all consensus nodes components in remote config.
*
* @param phase - to which to change the consensus node component
* @param ledgerPhase
*/
changeAllNodePhases(phase: DeploymentPhase, ledgerPhase?: Optional<LedgerPhase>): SoloListrTask<AnyListrContext>;
/**
* Creates tasks to validate that each node state is either one of the accepted states or not one of the excluded.
*
* @param acceptedPhases - the state at which the nodes can be, not matching any of the states throws an error
* @param excludedPhases - the state at which the nodes can't be, matching any of the states throws an error
*/
validateAllNodePhases({ acceptedPhases, excludedPhases, }: {
acceptedPhases?: DeploymentPhase[];
excludedPhases?: DeploymentPhase[];
}): SoloListrTask<AnyListrContext>;
/**
* Creates tasks to validate that specific node state is either one of the accepted states or not one of the excluded.
*
* @param acceptedPhases - the state at which the node can be, not matching any of the states throws an error
* @param excludedPhases - the state at which the node can't be, matching any of the states throws an error
*/
validateSingleNodeState({ acceptedPhases, excludedPhases, }: {
acceptedPhases?: DeploymentPhase[];
excludedPhases?: DeploymentPhase[];
}): SoloListrTask<AnyListrContext>;
/**
* @param nodeAlias - the alias of the node whose state to validate
* @param components - the component data wrapper
* @param acceptedPhases - the state at which the node can be, not matching any of the states throws an error
* @param excludedPhases - the state at which the node can't be, matching any of the states throws an error
*/
private validateNodeState;
collectJavaFlightRecorderLogs(argv: ArgvStruct): Promise<boolean>;
}