Skip to content

Commit bcdef8b

Browse files
committed
Merge remote-tracking branch 'origin/main' into 00949-production-readiness-dynamically-construct-the-genesis-networkjson-and-add-it-to-the-values-file-to-be-used-during-network-deploy
2 parents 847cd45 + 861c579 commit bcdef8b

25 files changed

+598
-206
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ An opinionated CLI tool to deploy and manage standalone test networks.
2222

2323
### Hardware Requirements
2424

25-
To run a three-node network, you will need to set up Docker Desktop with at least 8GB of memory and 4 CPUs.
25+
To run a three-node network, you will need to set up Docker Desktop with at least 8GB of memory and 4 CPUs.
2626

2727
![alt text](/docs/content/User/DockerDesktop.png)
2828

docs/content/User/Env.md

-7
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,3 @@ User can configure the following environment variables to customize the behavior
3535
| `RELAY_PODS_READY_MAX_ATTEMPTS` | The maximum number of attempts to check if relay pods are ready. | `100` |
3636
| `RELAY_PODS_READY_DELAY` | The interval between attempts to check if relay pods are ready, in the unit of milliseconds. | `120` |
3737
| `NETWORK_DESTROY_WAIT_TIMEOUT` | The period of time to wait for network to be destroyed, in the unit of milliseconds. | `60000` |
38-
39-
40-
41-
42-
43-
44-

docs/content/User/FAQ.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ You can run `solo account init` anytime after `solo node start`
44

55
### Where can I find the default account keys ?
66

7-
It is the well known default genesis key [Link](https://github.com/hashgraph/hedera-services/blob/develop/hedera-node/data/onboard/GenesisPrivKey.txt)
7+
It is the well known default genesis key [Link](https://github.com/hashgraph/hedera-services/blob/develop/hedera-node/data/onboard/GenesisPrivKey.txt)
88

99
### How do I get the key for an account?
1010

1111
Use the following command to get account balance and private key of the account `0.0.1007`:
12+
1213
```bash
1314
# get account info of 0.0.1007 and also show the private key
1415
solo account get --account-id 0.0.1007 -n solo-e2e --private-key

docs/content/User/GetStarted.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ For Hedera extended users:
2121
* [Using Environment Variables](Env.md)
2222

2323
FAQ:
24+
2425
* [Frequently Asked Questions](FAQ.md)
2526

2627
For curious mind:

package-lock.json

+16-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@
4747
"license": "Apache2.0",
4848
"dependencies": {
4949
"@eslint/eslintrc": "^3.2.0",
50-
"@hashgraph/sdk": "^2.55.1",
50+
"@hashgraph/sdk": "^2.56.0",
5151
"@kubernetes/client-node": "^0.22.3",
5252
"@listr2/prompt-adapter-enquirer": "^2.0.12",
5353
"@peculiar/x509": "^1.12.3",
5454
"adm-zip": "^0.5.16",
55-
"chalk": "^5.3.0",
55+
"chalk": "^5.4.0",
5656
"class-transformer": "^0.5.1",
5757
"class-validator": "^0.14.1",
5858
"dot-object": "^2.1.5",
@@ -115,7 +115,7 @@
115115
"eslint-plugin-prettier": "^5.2.1",
116116
"eslint-plugin-promise": "^7.2.1",
117117
"eslint-plugin-tsdoc": "^0.4.0",
118-
"globals": "^15.13.0",
118+
"globals": "^15.14.0",
119119
"jest-mock": "^29.7.0",
120120
"madge": "^8.0.0",
121121
"mocha": "^11.0.1",

src/commands/base.ts

+8
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ export abstract class BaseCommand extends ShellRunner {
9696
return valuesArg;
9797
}
9898

99+
getConfigManager(): ConfigManager {
100+
return this.configManager;
101+
}
102+
99103
/**
100104
* Dynamically builds a class with properties from the provided list of flags
101105
* and extra properties, will keep track of which properties are used. Call
@@ -185,6 +189,10 @@ export abstract class BaseCommand extends ShellRunner {
185189
return this.localConfig;
186190
}
187191

192+
getRemoteConfigManager() {
193+
return this.remoteConfigManager;
194+
}
195+
188196
abstract close(): Promise<void>;
189197

190198
commandActionBuilder(actionTasks: any, options: any, errorString: string, lease: Lease | null) {

src/commands/context/configs.ts

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* Copyright (C) 2024 Hedera Hashgraph, LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the ""License"");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an ""AS IS"" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
import {type NodeAlias} from '../../types/aliases.js';
19+
20+
export const CONNECT_CONFIGS_NAME = 'connectConfig';
21+
22+
export const connectConfigBuilder = async function (argv, ctx, task) {
23+
const config = this.getConfig(CONNECT_CONFIGS_NAME, argv.flags, [
24+
'currentDeploymentName',
25+
]) as ContextConnectConfigClass;
26+
27+
// set config in the context for later tasks to use
28+
ctx.config = config;
29+
30+
return ctx.config;
31+
};
32+
33+
export interface ContextConnectConfigClass {
34+
app: string;
35+
cacheDir: string;
36+
devMode: boolean;
37+
namespace: string;
38+
nodeAlias: NodeAlias;
39+
context: string;
40+
clusterName: string;
41+
}

src/commands/context/flags.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,12 @@ import {Flags as flags} from '../flags.js';
2020
export const USE_FLAGS = {
2121
requiredFlags: [],
2222
requiredFlagsWithDisabledPrompt: [],
23-
optionalFlags: [flags.devMode, flags.quiet, flags.clusterName, flags.context, flags.force, flags.namespace],
23+
optionalFlags: [
24+
flags.devMode,
25+
flags.quiet,
26+
flags.clusterName,
27+
flags.context,
28+
flags.namespace,
29+
flags.userEmailAddress,
30+
],
2431
};

src/commands/context/handlers.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,32 @@ import {type ContextCommandTasks} from './tasks.js';
1919
import * as helpers from '../../core/helpers.js';
2020
import * as constants from '../../core/constants.js';
2121
import * as ContextFlags from './flags.js';
22+
import {RemoteConfigTasks} from '../../core/config/remote/remote_config_tasks.js';
23+
import type {RemoteConfigManager} from '../../core/config/remote/remote_config_manager.js';
24+
import {connectConfigBuilder} from './configs.js';
2225

2326
export class ContextCommandHandlers implements CommandHandlers {
2427
readonly parent: BaseCommand;
2528
readonly tasks: ContextCommandTasks;
29+
public readonly remoteConfigManager: RemoteConfigManager;
30+
private getConfig: any;
2631

27-
constructor(parent: BaseCommand, tasks: ContextCommandTasks) {
32+
constructor(parent: BaseCommand, tasks: ContextCommandTasks, remoteConfigManager: RemoteConfigManager) {
2833
this.parent = parent;
2934
this.tasks = tasks;
35+
this.remoteConfigManager = remoteConfigManager;
36+
this.getConfig = parent.getConfig.bind(parent);
3037
}
3138

3239
async connect(argv: any) {
3340
argv = helpers.addFlagsToArgv(argv, ContextFlags.USE_FLAGS);
3441

3542
const action = this.parent.commandActionBuilder(
3643
[
37-
this.tasks.initialize(argv),
38-
this.parent.getLocalConfig().promptLocalConfigTask(),
44+
this.tasks.initialize(argv, connectConfigBuilder.bind(this)),
45+
this.parent.getLocalConfig().promptLocalConfigTask(this.parent.getK8()),
46+
this.tasks.selectContext(argv),
47+
RemoteConfigTasks.loadRemoteConfig.bind(this)(argv),
3948
this.tasks.updateLocalConfig(argv),
4049
],
4150
{

src/commands/context/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class ContextCommand extends BaseCommand {
3131
constructor(opts: Opts) {
3232
super(opts);
3333

34-
this.handlers = new ContextCommandHandlers(this, new ContextCommandTasks(this));
34+
this.handlers = new ContextCommandHandlers(this, new ContextCommandTasks(this), this.remoteConfigManager);
3535
}
3636

3737
getCommandDefinition() {

0 commit comments

Comments
 (0)