UNPKG

@hashgraph/solo

Version:

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

63 lines (62 loc) 3.52 kB
/** * SPDX-License-Identifier: Apache-2.0 */ import { ComponentType } from './enumerations.js'; import { BaseComponent } from './components/base_component.js'; import { RelayComponent } from './components/relay_component.js'; import { HaProxyComponent } from './components/ha_proxy_component.js'; import { MirrorNodeComponent } from './components/mirror_node_component.js'; import { EnvoyProxyComponent } from './components/envoy_proxy_component.js'; import { ConsensusNodeComponent } from './components/consensus_node_component.js'; import { MirrorNodeExplorerComponent } from './components/mirror_node_explorer_component.js'; import { type ComponentsDataStructure, type ComponentName, type NamespaceNameAsString } from './types.js'; import { type ToObject, type Validate } from '../../../types/index.js'; /** * Represent the components in the remote config and handles: * - CRUD operations on the components. * - Validation. * - Conversion FROM and TO plain object. */ export declare class ComponentsDataWrapper implements Validate, ToObject<ComponentsDataStructure> { readonly relays: Record<ComponentName, RelayComponent>; readonly haProxies: Record<ComponentName, HaProxyComponent>; readonly mirrorNodes: Record<ComponentName, MirrorNodeComponent>; readonly envoyProxies: Record<ComponentName, EnvoyProxyComponent>; readonly consensusNodes: Record<ComponentName, ConsensusNodeComponent>; readonly mirrorNodeExplorers: Record<ComponentName, MirrorNodeExplorerComponent>; /** * @param relays - Relay record mapping service name to relay components * @param haProxies - HA Proxies record mapping service name to ha proxies components * @param mirrorNodes - Mirror Nodes record mapping service name to mirror nodes components * @param envoyProxies - Envoy Proxies record mapping service name to envoy proxies components * @param consensusNodes - Consensus Nodes record mapping service name to consensus nodes components * @param mirrorNodeExplorers - Mirror Node Explorers record mapping service name to mirror node explorers components */ private constructor(); /** Used to add new component to their respective group. */ add(serviceName: ComponentName, component: BaseComponent): void; /** Used to edit an existing component from their respective group. */ edit(serviceName: ComponentName, component: BaseComponent): void; /** Used to remove specific component from their respective group. */ remove(serviceName: ComponentName, type: ComponentType): void; getComponent<T extends BaseComponent>(type: ComponentType, serviceName: ComponentName): T; /** * Method used to map the type to the specific component group * and pass it to a callback to apply modifications */ private applyCallbackToComponentGroup; /** * Handles creating instance of the class from plain object. * * @param components - component groups distinguished by their type. */ static fromObject(components: ComponentsDataStructure): ComponentsDataWrapper; /** Used to create an empty instance used to keep the constructor private */ static initializeEmpty(): ComponentsDataWrapper; static initializeWithNodes(nodeAliases: string[], cluster: string, namespace: NamespaceNameAsString): ComponentsDataWrapper; /** checks if component exists in the respective group */ private exists; validate(): void; toObject(): ComponentsDataStructure; clone(): ComponentsDataWrapper; }