Skip to content

Commit

Permalink
remove circular dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon committed Dec 23, 2024
1 parent 70137f4 commit 4e7ad7e
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 54 deletions.
7 changes: 0 additions & 7 deletions .madgerc

This file was deleted.

41 changes: 1 addition & 40 deletions src/commands/node/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {validatePath} from '../../core/helpers.js';
import {Flags as flags} from '../flags.js';
import type {NodeAlias, NodeAliases, PodName} from '../../types/aliases.js';
import type {NetworkNodeServices} from '../../core/network_node_services.js';
import {type NodeAddConfigClass} from './node_add_config.js';

export const PREPARE_UPGRADE_CONFIGS_NAME = 'prepareUpgradeConfig';
export const DOWNLOAD_GENERATED_FILES_CONFIGS_NAME = 'downloadGeneratedFilesConfig';
Expand Down Expand Up @@ -357,46 +358,6 @@ export interface NodeStartConfigClass {
nodeAliasesUnparsed: string;
}

export interface NodeAddConfigClass {
app: string;
cacheDir: string;
chainId: string;
chartDirectory: string;
devMode: boolean;
debugNodeAlias: NodeAlias;
endpointType: string;
soloChartVersion: string;
generateGossipKeys: boolean;
generateTlsKeys: boolean;
gossipEndpoints: string;
grpcEndpoints: string;
localBuildPath: string;
namespace: string;
nodeAlias: NodeAlias;
releaseTag: string;
adminKey: PrivateKey;
allNodeAliases: NodeAliases;
chartPath: string;
curDate: Date;
existingNodeAliases: NodeAliases;
freezeAdminPrivateKey: string;
keysDir: string;
lastStateZipPath: string;
nodeClient: any;
podNames: Record<NodeAlias, PodName>;
serviceMap: Map<string, NetworkNodeServices>;
treasuryKey: PrivateKey;
stagingDir: string;
stagingKeysDir: string;
grpcTlsCertificatePath: string;
grpcWebTlsCertificatePath: string;
grpcTlsKeyPath: string;
grpcWebTlsKeyPath: string;
haproxyIps: string;
envoyIps: string;
getUnusedConfigs: () => string[];
}

export interface NodeDeleteConfigClass {
app: string;
cacheDir: string;
Expand Down
59 changes: 59 additions & 0 deletions src/commands/node/node_add_config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* Copyright (C) 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the ""License"");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an ""AS IS"" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import type {NodeAlias, NodeAliases, PodName} from '../../types/aliases.js';
import type {NetworkNodeServices} from '../../core/network_node_services.js';
import {type PrivateKey} from '@hashgraph/sdk';

export interface NodeAddConfigClass {
app: string;
cacheDir: string;
chainId: string;
chartDirectory: string;
devMode: boolean;
debugNodeAlias: NodeAlias;
endpointType: string;
soloChartVersion: string;
generateGossipKeys: boolean;
generateTlsKeys: boolean;
gossipEndpoints: string;
grpcEndpoints: string;
localBuildPath: string;
namespace: string;
nodeAlias: NodeAlias;
releaseTag: string;
adminKey: PrivateKey;
allNodeAliases: NodeAliases;
chartPath: string;
curDate: Date;
existingNodeAliases: NodeAliases;
freezeAdminPrivateKey: string;
keysDir: string;
lastStateZipPath: string;
nodeClient: any;
podNames: Record<NodeAlias, PodName>;
serviceMap: Map<string, NetworkNodeServices>;
treasuryKey: PrivateKey;
stagingDir: string;
stagingKeysDir: string;
grpcTlsCertificatePath: string;
grpcWebTlsCertificatePath: string;
grpcTlsKeyPath: string;
grpcWebTlsKeyPath: string;
haproxyIps: string;
envoyIps: string;
getUnusedConfigs: () => string[];
}
8 changes: 2 additions & 6 deletions src/commands/node/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,12 @@ import {
} from '../../types/aliases.js';
import {NodeStatusCodes, NodeStatusEnums, NodeSubcommandType} from '../../core/enumerations.js';
import * as x509 from '@peculiar/x509';
import type {
NodeAddConfigClass,
NodeDeleteConfigClass,
NodeRefreshConfigClass,
NodeUpdateConfigClass,
} from './configs.js';
import type {NodeDeleteConfigClass, NodeRefreshConfigClass, NodeUpdateConfigClass} from './configs.js';
import {type Lease} from '../../core/lease/lease.js';
import {ListrLease} from '../../core/lease/listr_lease.js';
import {Duration} from '../../core/time/duration.js';
import {type BaseCommand} from '../base.js';
import {type NodeAddConfigClass} from './node_add_config.js';

export class NodeCommandTasks {
private readonly accountManager: AccountManager;
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {type NodeAlias, type NodeAliases} from '../types/aliases.js';
import {type CommandFlag} from '../types/flag_types.js';
import {type SoloLogger} from './logging.js';
import {type Duration} from './time/duration.js';
import {type NodeAddConfigClass} from '../commands/node/configs.js';
import {type NodeAddConfigClass} from '../commands/node/node_add_config.js';

export function sleep(duration: Duration) {
return new Promise<void>(resolve => {
Expand Down

0 comments on commit 4e7ad7e

Please sign in to comment.