@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
98 lines (97 loc) • 5.47 kB
TypeScript
/**
* SPDX-License-Identifier: Apache-2.0
*/
import * as x509 from '@peculiar/x509';
import { type AccountId } from '@hashgraph/sdk';
import { type IP, type NodeAlias, type NodeId } from '../types/aliases.js';
import { PodName } from './kube/resources/pod/pod_name.js';
import { GrpcProxyTlsEnums } from './enumerations.js';
import { type NamespaceName } from './kube/resources/namespace/namespace_name.js';
import { type ClusterRef, type NamespaceNameAsString } from './config/remote/types.js';
export declare class Templates {
static renderNetworkPodName(nodeAlias: NodeAlias): PodName;
private static renderNetworkSvcName;
private static nodeAliasFromNetworkSvcName;
static renderNetworkHeadlessSvcName(nodeAlias: NodeAlias): string;
static renderGossipPemPrivateKeyFile(nodeAlias: NodeAlias): string;
static renderGossipPemPublicKeyFile(nodeAlias: NodeAlias): string;
static renderTLSPemPrivateKeyFile(nodeAlias: NodeAlias): string;
static renderTLSPemPublicKeyFile(nodeAlias: NodeAlias): string;
static renderNodeAdminKeyName(nodeAlias: NodeAlias): string;
static renderNodeFriendlyName(prefix: string, nodeAlias: NodeAlias, suffix?: string): string;
private static extractNodeAliasFromPodName;
static prepareReleasePrefix(tag: string): string;
/**
* renders the name to be used to store the new account key as a Kubernetes secret
* @param accountId
* @returns the name of the Kubernetes secret to store the account key
*/
static renderAccountKeySecretName(accountId: AccountId | string): string;
/**
* renders the label selector to be used to fetch the new account key from the Kubernetes secret
* @param accountId
* @returns the label selector of the Kubernetes secret to retrieve the account key */
static renderAccountKeySecretLabelSelector(accountId: AccountId | string): string;
/**
* renders the label object to be used to store the new account key in the Kubernetes secret
* @param accountId
* @returns the label object to be used to store the new account key in the Kubernetes secret
*/
static renderAccountKeySecretLabelObject(accountId: AccountId | string): {
'solo.hedera.com/account-id': string;
};
static renderDistinguishedName(nodeAlias: NodeAlias, state?: string, locality?: string, org?: string, orgUnit?: string, country?: string): x509.Name;
static renderStagingDir(cacheDir: string, releaseTagOverride: string): string;
static installationPath(dep: string, osPlatform?: NodeJS.Platform | string, installationDir?: string): string;
static renderFullyQualifiedNetworkPodName(namespace: NamespaceName, nodeAlias: NodeAlias): string;
static renderFullyQualifiedNetworkSvcName(namespace: NamespaceName, nodeAlias: NodeAlias): string;
private static nodeAliasFromFullyQualifiedNetworkSvcName;
static nodeIdFromNodeAlias(nodeAlias: NodeAlias): NodeId;
static renderGossipKeySecretName(nodeAlias: NodeAlias): string;
static renderGossipKeySecretLabelObject(nodeAlias: NodeAlias): {
'solo.hedera.com/node-name': string;
};
/**
* Creates the secret name based on the node alias type
*
* @param nodeAlias - node alias
* @param type - whether is for gRPC or gRPC Web ( Haproxy or Envoy )
*
* @returns the appropriate secret name
*/
static renderGrpcTlsCertificatesSecretName(nodeAlias: NodeAlias, type: GrpcProxyTlsEnums): string;
/**
* Creates the secret labels based on the node alias type
*
* @param nodeAlias - node alias
* @param type - whether is for gRPC or gRPC Web ( Haproxy or Envoy )
*
* @returns the appropriate secret labels
*/
static renderGrpcTlsCertificatesSecretLabelObject(nodeAlias: NodeAlias, type: GrpcProxyTlsEnums): {
'haproxy-proxy-secret': `node${number}`;
'envoy-proxy-secret'?: undefined;
} | {
'envoy-proxy-secret': `node${number}`;
'haproxy-proxy-secret'?: undefined;
};
static renderEnvoyProxyName(nodeAlias: NodeAlias): string;
static renderHaProxyName(nodeAlias: NodeAlias): string;
static renderFullyQualifiedHaProxyName(nodeAlias: NodeAlias, namespace: NamespaceName): string;
static parseNodeAliasToIpMapping(unparsed: string): Record<NodeAlias, IP>;
/**
* Renders the fully qualified domain name for a consensus node. We support the following variables for templating
* in the dnsConsensusNodePattern: ${nodeAlias}, ${nodeId}, ${namespace}, ${cluster}
*
* The end result will be `${dnsConsensusNodePattern}.${dnsBaseDomain}`.
* For example, if the dnsConsensusNodePattern is `network-${nodeAlias}-svc.${namespace}.svc` and the dnsBaseDomain is `cluster.local`,
* the fully qualified domain name will be `network-${nodeAlias}-svc.${namespace}.svc.cluster.local`.
* @param nodeAlias - the alias of the consensus node
* @param nodeId - the id of the consensus node
* @param namespace - the namespace of the consensus node
* @param cluster - the cluster of the consensus node
* @param dnsBaseDomain - the base domain of the cluster
* @param dnsConsensusNodePattern - the pattern to use for the consensus node
*/
static renderConsensusNodeFullyQualifiedDomainName(nodeAlias: string, nodeId: number, namespace: NamespaceNameAsString, cluster: ClusterRef, dnsBaseDomain: string, dnsConsensusNodePattern: string): string;
}