UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

111 lines (110 loc) 4.58 kB
import { BaseCommand } from './base.js'; import { type ClusterCommandTasks } from './cluster/tasks.js'; import { type ClusterReferenceName, type DeploymentName, type SoloListrTask } from '../types/index.js'; import { NamespaceName } from '../types/namespace/namespace-name.js'; import { type ArgvStruct, type NodeAliases } from '../types/aliases.js'; import { LedgerPhase } from '../data/schema/model/remote/ledger-phase.js'; import { CommandFlags } from '../types/flag-types.js'; interface DeploymentAddClusterConfig { quiet: boolean; context: string; namespace: NamespaceName; deployment: DeploymentName; clusterRef: ClusterReferenceName; enableCertManager: boolean; numberOfConsensusNodes: number; dnsBaseDomain: string; dnsConsensusNodePattern: string; ledgerPhase?: LedgerPhase; nodeAliases: NodeAliases; existingNodesCount: number; existingClusterContext?: string; } export interface DeploymentAddClusterContext { config: DeploymentAddClusterConfig; } export declare class DeploymentCommand extends BaseCommand { private readonly tasks; constructor(tasks: ClusterCommandTasks); static CREATE_FLAGS_LIST: CommandFlags; static DESTROY_FLAGS_LIST: CommandFlags; static ADD_CLUSTER_FLAGS_LIST: CommandFlags; static LIST_DEPLOYMENTS_FLAGS_LIST: CommandFlags; static SHOW_STATUS_FLAGS_LIST: CommandFlags; static REFRESH_FLAGS_LIST: CommandFlags; static PORTS_FLAGS_LIST: CommandFlags; /** * Create new deployment inside the local config */ create(argv: ArgvStruct): Promise<boolean>; /** * Delete a deployment from the local config */ delete(argv: ArgvStruct): Promise<boolean>; /** * Add new cluster for specified deployment, and create or edit the remote config */ addCluster(argv: ArgvStruct): Promise<boolean>; list(argv: ArgvStruct): Promise<boolean>; close(): Promise<void>; ports(argv: ArgvStruct): Promise<boolean>; /** * Initializes and populates the config and context for 'deployment cluster attach' */ initializeClusterAddConfig(argv: ArgvStruct): SoloListrTask<DeploymentAddClusterContext>; /** * Validates: * - cluster ref is present in the local config's cluster-ref => context mapping * - the deployment is created * - the cluster-ref is not already added to the deployment */ verifyClusterAddArgs(): SoloListrTask<DeploymentAddClusterContext>; /** * Checks the ledger phase: * - if remote config is found check's the ledgerPhase field to see if it's pre or post genesis. * - pre genesis: * - prompts user if needed. * - generates node aliases based on '--number-of-consensus-nodes' * - post genesis: * - throws if '--number-of-consensus-nodes' is passed * - if remote config is not found: * - prompts user if needed. * - generates node aliases based on '--number-of-consensus-nodes'. */ checkNetworkState(): SoloListrTask<DeploymentAddClusterContext>; /** * Tries to connect with the cluster using the context from the local config */ testClusterConnection(): SoloListrTask<DeploymentAddClusterContext>; verifyClusterAddPrerequisites(): SoloListrTask<DeploymentAddClusterContext>; checkForExistingDeployments(): SoloListrTask<DeploymentAddClusterContext>; /** * Adds the new cluster-ref for the deployment in local config */ addClusterRefToDeployments(): SoloListrTask<DeploymentAddClusterContext>; /** * - if remote config not found, create new remote config for the deployment. * - if remote config is found, add the new data for the deployment. */ createOrEditRemoteConfigForNewDeployment(argv: ArgvStruct): SoloListrTask<DeploymentAddClusterContext>; /** Show list of existing deployments in the cluster */ private showExistingDeploymentsInCluster; /** * Refresh port-forward processes for all components in the deployment */ refresh(argv: ArgvStruct): Promise<boolean>; /** * Check if a port-forward process is running on the specified port */ private isPortForwardRunning; /** * Display the full deployment status including component info, versions, and port-forward status. * If no deployment is specified, iterates over all local deployments. */ showDeploymentStatus(argv: ArgvStruct): Promise<boolean>; /** * Get the pod name for a component based on its type */ private getPodNameForComponent; } export {};