Skip to content

Commit 5216b08

Browse files
committed
Squashed commit of the following:
commit 45251dc Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 17:04:15 2024 +0100 revert changes in init.mjs Signed-off-by: Jeromy Cannon <[email protected]> commit 69c844d Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 15:57:02 2024 +0100 fixed unused configs test case Signed-off-by: Jeromy Cannon <[email protected]> commit ec3fc91 Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 15:45:59 2024 +0100 fixed tests, altered used/unused command options Signed-off-by: Jeromy Cannon <[email protected]> commit 3e1791d Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 14:57:25 2024 +0100 fix unit test cases Signed-off-by: Jeromy Cannon <[email protected]> commit d06b6b9 Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 14:42:11 2024 +0100 fix lint error Signed-off-by: Jeromy Cannon <[email protected]> commit 7573147 Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 14:36:48 2024 +0100 remove TODOs Signed-off-by: Jeromy Cannon <[email protected]> commit 524737a Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 14:11:26 2024 +0100 remove TODOs Signed-off-by: Jeromy Cannon <[email protected]> commit c9e5de0 Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 13:54:36 2024 +0100 moved node subtask 'Copy configuration files' into profile_manager Signed-off-by: Jeromy Cannon <[email protected]> commit b7887c0 Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 13:28:04 2024 +0100 increase test coverage Signed-off-by: Jeromy Cannon <[email protected]> commit 9aa2b3a Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 12:46:51 2024 +0100 remove NodeInfo references Signed-off-by: Jeromy Cannon <[email protected]> commit a0fae4b Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 12:43:20 2024 +0100 # TODO: bootstrap.properties is scheduled to go away, will need to delete this and related code Signed-off-by: Jeromy Cannon <[email protected]> commit b01ff4f Author: Jeromy Cannon <[email protected]> Date: Thu Jul 18 12:20:36 2024 +0100 typedef Signed-off-by: Jeromy Cannon <[email protected]> commit eae6b44 Author: Jeromy Cannon <[email protected]> Date: Wed Jul 17 22:14:52 2024 +0100 hedera app name is now set as default Signed-off-by: Jeromy Cannon <[email protected]> commit c7ce8eb Author: Jeromy Cannon <[email protected]> Date: Wed Jul 17 21:43:17 2024 +0100 fix test cases Signed-off-by: Jeromy Cannon <[email protected]> commit 9c305ca Author: Jeromy Cannon <[email protected]> Date: Wed Jul 17 19:58:22 2024 +0100 fix lint issues Signed-off-by: Jeromy Cannon <[email protected]> commit 60a364d Author: Jeromy Cannon <[email protected]> Date: Wed Jul 17 19:56:24 2024 +0100 some fixes Signed-off-by: Jeromy Cannon <[email protected]> commit a2e6186 Author: Jeromy Cannon <[email protected]> Date: Wed Jul 17 13:31:11 2024 +0100 Squashed commit of the following: commit c2342d1 Author: Jeromy Cannon <[email protected]> Date: Wed Jun 5 10:35:53 2024 +0100 add ability for a flag to be disabled from prompt Signed-off-by: Jeromy Cannon <[email protected]> commit 86fb0b1 Author: Jeromy Cannon <[email protected]> Date: Wed Jun 5 10:35:08 2024 +0100 sort flagsList and add typedef to flags.mjs Signed-off-by: Jeromy Cannon <[email protected]> commit b9abf97 Author: Jeromy Cannon <[email protected]> Date: Tue Jun 4 17:17:25 2024 +0100 TODO Signed-off-by: Jeromy Cannon <[email protected]> commit 4fafe80 Author: Jeromy Cannon <[email protected]> Date: Tue Jun 4 16:34:53 2024 +0100 added TODO Signed-off-by: Jeromy Cannon <[email protected]> commit 257ed76 Author: Jeromy Cannon <[email protected]> Date: Mon Jun 3 20:04:20 2024 +0100 saving progress Signed-off-by: Jeromy Cannon <[email protected]> commit 43ab636 Author: Jeromy Cannon <[email protected]> Date: Mon Jun 3 19:56:27 2024 +0100 restructured network.mjs to remove duplication of flags list and be easier to match up with prepare config Signed-off-by: Jeromy Cannon <[email protected]> commit 4ec2ce1 Author: Jeromy Cannon <[email protected]> Date: Mon Jun 3 18:42:00 2024 +0100 we don't need to specifically request applicationEnv, it can just be provided optionally Signed-off-by: Jeromy Cannon <[email protected]> commit d36252f Author: Jeromy Cannon <[email protected]> Date: Mon Jun 3 18:41:13 2024 +0100 added chain id and app name defaults to flags Signed-off-by: Jeromy Cannon <[email protected]> commit d21abb7 Author: Jeromy Cannon <[email protected]> Date: Fri May 31 23:09:51 2024 +0100 TODO design Signed-off-by: Jeromy Cannon <[email protected]> Signed-off-by: Jeromy Cannon <[email protected]> Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 11395ba commit 5216b08

13 files changed

+375
-374
lines changed

resources/templates/bootstrap.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# TODO: bootstrap.properties is scheduled to go away, will need to delete this and related code
12
ledger.id=0x01
23
netty.mode=DEV
4+
# TODO: if chain ID is passed in as a flag, this is not getting updated
35
contracts.chainId=298
46
hedera.recordStream.logPeriod=1
57
balances.exportPeriodSecs=400

src/commands/flags.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export const chainId = {
309309
name: 'ledger-id',
310310
definition: {
311311
describe: 'Ledger ID (a.k.a. Chain ID)',
312-
defaultValue: '298', // Ref: https://github.com/hashgraph/hedera-json-rpc-relay#configuration
312+
defaultValue: constants.HEDERA_CHAIN_ID, // Ref: https://github.com/hashgraph/hedera-json-rpc-relay#configuration
313313
alias: 'l',
314314
type: 'string'
315315
}
@@ -510,7 +510,7 @@ export const app = {
510510
name: 'app',
511511
definition: {
512512
describe: 'Testing app name',
513-
defaultValue: '',
513+
defaultValue: constants.HEDERA_APP_NAME,
514514
type: 'string'
515515
}
516516
}

src/commands/network.mjs

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ export class NetworkCommand extends BaseCommand {
3939

4040
static get DEPLOY_FLAGS_LIST () {
4141
return [
42+
flags.apiPermissionProperties,
43+
flags.app,
4244
flags.applicationEnv,
45+
flags.applicationProperties,
46+
flags.bootstrapProperties,
47+
flags.chainId,
4348
flags.chartDirectory,
4449
flags.deployHederaExplorer,
4550
flags.deployMirrorNode,
@@ -48,11 +53,13 @@ export class NetworkCommand extends BaseCommand {
4853
flags.fstChartVersion,
4954
flags.hederaExplorerTlsHostName,
5055
flags.hederaExplorerTlsLoadBalancerIp,
56+
flags.log4j2Xml,
5157
flags.namespace,
5258
flags.nodeIDs,
5359
flags.profileFile,
5460
flags.profileName,
5561
flags.releaseTag,
62+
flags.settingTxt,
5663
flags.tlsClusterIssuerType,
5764
flags.valuesFile
5865
]
@@ -98,7 +105,7 @@ export class NetworkCommand extends BaseCommand {
98105
}
99106

100107
const profileName = this.configManager.getFlag(flags.profileName)
101-
this.profileValuesFile = await this.profileManager.prepareValuesForFstChart(profileName, config.applicationEnv)
108+
this.profileValuesFile = await this.profileManager.prepareValuesForFstChart(profileName)
102109
if (this.profileValuesFile) {
103110
valuesArg += this.prepareValuesFiles(this.profileValuesFile)
104111
}
@@ -127,10 +134,17 @@ export class NetworkCommand extends BaseCommand {
127134

128135
// disable the prompts that we don't want to prompt the user for
129136
prompts.disablePrompts([
137+
flags.apiPermissionProperties,
138+
flags.app,
130139
flags.applicationEnv,
140+
flags.applicationProperties,
141+
flags.bootstrapProperties,
142+
flags.chainId,
131143
flags.deployHederaExplorer,
132144
flags.deployMirrorNode,
133-
flags.hederaExplorerTlsLoadBalancerIp
145+
flags.hederaExplorerTlsLoadBalancerIp,
146+
flags.log4j2Xml,
147+
flags.settingTxt
134148
])
135149

136150
await prompts.execute(task, this.configManager, NetworkCommand.DEPLOY_FLAGS_LIST)
@@ -196,32 +210,34 @@ export class NetworkCommand extends BaseCommand {
196210
{
197211
title: 'Initialize',
198212
task: async (ctx, task) => {
199-
ctx.config = await self.prepareConfig(task, argv)
213+
ctx.config = /** @type {NetworkDeployConfigClass} **/ await self.prepareConfig(task, argv)
200214
}
201215
},
202216
{
203217
title: `Install chart '${constants.FULLSTACK_DEPLOYMENT_CHART}'`,
204218
task: async (ctx, _) => {
205-
if (await self.chartManager.isChartInstalled(ctx.config.namespace, constants.FULLSTACK_DEPLOYMENT_CHART)) {
206-
await self.chartManager.uninstall(ctx.config.namespace, constants.FULLSTACK_DEPLOYMENT_CHART)
219+
const config = /** @type {NetworkDeployConfigClass} **/ ctx.config
220+
if (await self.chartManager.isChartInstalled(config.namespace, constants.FULLSTACK_DEPLOYMENT_CHART)) {
221+
await self.chartManager.uninstall(config.namespace, constants.FULLSTACK_DEPLOYMENT_CHART)
207222
}
208223

209224
await this.chartManager.install(
210-
ctx.config.namespace,
225+
config.namespace,
211226
constants.FULLSTACK_DEPLOYMENT_CHART,
212-
ctx.config.chartPath,
213-
ctx.config.fstChartVersion,
214-
ctx.config.valuesArg)
227+
config.chartPath,
228+
config.fstChartVersion,
229+
config.valuesArg)
215230
}
216231
},
217232
{
218233
title: 'Check node pods are running',
219234
task:
220235
async (ctx, task) => {
221236
const subTasks = []
237+
const config = /** @type {NetworkDeployConfigClass} **/ ctx.config
222238

223239
// nodes
224-
for (const nodeId of ctx.config.nodeIds) {
240+
for (const nodeId of config.nodeIds) {
225241
subTasks.push({
226242
title: `Check Node: ${chalk.yellow(nodeId)}`,
227243
task: () =>
@@ -246,9 +262,10 @@ export class NetworkCommand extends BaseCommand {
246262
task:
247263
async (ctx, task) => {
248264
const subTasks = []
265+
const config = /** @type {NetworkDeployConfigClass} **/ ctx.config
249266

250267
// HAProxy
251-
for (const nodeId of ctx.config.nodeIds) {
268+
for (const nodeId of config.nodeIds) {
252269
subTasks.push({
253270
title: `Check HAProxy for: ${chalk.yellow(nodeId)}`,
254271
task: () =>
@@ -259,7 +276,7 @@ export class NetworkCommand extends BaseCommand {
259276
}
260277

261278
// Envoy Proxy
262-
for (const nodeId of ctx.config.nodeIds) {
279+
for (const nodeId of config.nodeIds) {
263280
subTasks.push({
264281
title: `Check Envoy Proxy for: ${chalk.yellow(nodeId)}`,
265282
task: () =>
@@ -418,12 +435,13 @@ export class NetworkCommand extends BaseCommand {
418435
{
419436
title: `Upgrade chart '${constants.FULLSTACK_DEPLOYMENT_CHART}'`,
420437
task: async (ctx, _) => {
438+
const config = ctx.config
421439
await this.chartManager.upgrade(
422-
ctx.config.namespace,
440+
config.namespace,
423441
constants.FULLSTACK_DEPLOYMENT_CHART,
424-
ctx.config.chartPath,
425-
ctx.config.valuesArg,
426-
ctx.config.fstChartVersion
442+
config.chartPath,
443+
config.valuesArg,
444+
config.fstChartVersion
427445
)
428446
}
429447
},

0 commit comments

Comments
 (0)