@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
160 lines (159 loc) • 5.96 kB
TypeScript
import { BaseCommand, type Opts } from './base.js';
import * as constants from '../core/constants.js';
import { type CommandBuilder, type IP, type NodeAlias, type NodeAliases } from '../types/aliases.js';
import { type SoloListrTask } from '../types/index.js';
import { NamespaceName } from '../core/kube/resources/namespace/namespace_name.js';
import { type ConsensusNode } from '../core/model/consensus_node.js';
import { type ClusterRef, type ClusterRefs } from '../core/config/remote/types.js';
export interface NetworkDeployConfigClass {
applicationEnv: string;
cacheDir: string;
chartDirectory: string;
enablePrometheusSvcMonitor: boolean;
loadBalancerEnabled: boolean;
soloChartVersion: string;
namespace: NamespaceName;
deployment: string;
nodeAliasesUnparsed: string;
persistentVolumeClaims: string;
profileFile: string;
profileName: string;
releaseTag: string;
chartPath: string;
keysDir: string;
nodeAliases: NodeAliases;
stagingDir: string;
stagingKeysDir: string;
valuesFile: string;
valuesArgMap: Record<ClusterRef, string>;
grpcTlsCertificatePath: string;
grpcWebTlsCertificatePath: string;
grpcTlsKeyPath: string;
grpcWebTlsKeyPath: string;
genesisThrottlesFile: string;
resolvedThrottlesFile: string;
getUnusedConfigs: () => string[];
haproxyIps: string;
envoyIps: string;
haproxyIpsParsed?: Record<NodeAlias, IP>;
envoyIpsParsed?: Record<NodeAlias, IP>;
storageType: constants.StorageType;
gcsAccessKey: string;
gcsSecrets: string;
gcsEndpoint: string;
gcsBucket: string;
gcsBucketPrefix: string;
awsAccessKey: string;
awsSecrets: string;
awsEndpoint: string;
awsBucket: string;
awsBucketPrefix: string;
backupBucket: string;
googleCredential: string;
consensusNodes: ConsensusNode[];
contexts: string[];
clusterRefs: ClusterRefs;
}
export declare class NetworkCommand extends BaseCommand {
private readonly keyManager;
private readonly platformInstaller;
private readonly profileManager;
private readonly certificateManager;
private profileValuesFile?;
constructor(opts: Opts);
static get DEPLOY_CONFIGS_NAME(): string;
static get DEPLOY_FLAGS_LIST(): import("../types/flag_types.js").CommandFlag[];
prepareMinioSecrets(config: NetworkDeployConfigClass, minioAccessKey: string, minioSecretKey: string): Promise<void>;
prepareStreamUploaderSecrets(config: NetworkDeployConfigClass): Promise<void>;
prepareBackupUploaderSecrets(config: NetworkDeployConfigClass): Promise<void>;
prepareStorageSecrets(config: NetworkDeployConfigClass): Promise<void>;
/**
* Prepare values args string for each cluster-ref
* @param config
*/
prepareValuesArgMap(config: {
chartDirectory?: string;
app?: string;
nodeAliases: string[];
debugNodeAlias?: NodeAlias;
enablePrometheusSvcMonitor?: boolean;
releaseTag?: string;
persistentVolumeClaims?: string;
valuesFile?: string;
haproxyIpsParsed?: Record<NodeAlias, IP>;
envoyIpsParsed?: Record<NodeAlias, IP>;
storageType: constants.StorageType;
resolvedThrottlesFile: string;
gcsAccessKey: string;
gcsSecrets: string;
gcsEndpoint: string;
gcsBucket: string;
gcsBucketPrefix: string;
awsAccessKey: string;
awsSecrets: string;
awsEndpoint: string;
awsBucket: string;
awsBucketPrefix: string;
backupBucket: string;
googleCredential: string;
loadBalancerEnabled: boolean;
clusterRefs: ClusterRefs;
consensusNodes: ConsensusNode[];
}): Promise<Record<ClusterRef, string>>;
/**
* Prepare the values argument for the helm chart for a given config
* @param config
*/
prepareValuesArg(config: {
chartDirectory?: string;
app?: string;
consensusNodes: ConsensusNode[];
debugNodeAlias?: NodeAlias;
enablePrometheusSvcMonitor?: boolean;
releaseTag?: string;
persistentVolumeClaims?: string;
valuesFile?: string;
haproxyIpsParsed?: Record<NodeAlias, IP>;
envoyIpsParsed?: Record<NodeAlias, IP>;
storageType: constants.StorageType;
resolvedThrottlesFile: string;
gcsAccessKey: string;
gcsSecrets: string;
gcsEndpoint: string;
gcsBucket: string;
gcsBucketPrefix: string;
awsAccessKey: string;
awsSecrets: string;
awsEndpoint: string;
awsBucket: string;
awsBucketPrefix: string;
backupBucket: string;
googleCredential: string;
loadBalancerEnabled: boolean;
}): Record<ClusterRef, string>;
/**
* Adds the template string to the argument for each record
* @param records - the records to iterate over
* @param consensusNodes - the consensus nodes to iterate over
* @param valuesArgs - the values arguments to add to
* @param templateString - the template string to add
* @private
*/
private addArgForEachRecord;
prepareNamespaces(config: NetworkDeployConfigClass): Promise<void>;
prepareConfig(task: any, argv: any, promptForNodeAliases?: boolean): Promise<NetworkDeployConfigClass>;
destroyTask(ctx: any, task: any): Promise<void>;
/** Run helm install and deploy network components */
deploy(argv: any): Promise<boolean>;
destroy(argv: any): Promise<boolean>;
/** Run helm upgrade to refresh network components with new settings */
refresh(argv: any): Promise<boolean>;
getCommandDefinition(): {
command: string;
desc: string;
builder: CommandBuilder;
};
/** Adds the consensus node, envoy and haproxy components to remote config. */
addNodesAndProxies(): SoloListrTask<any>;
close(): Promise<void>;
}