Skip to content

Commit 507a2cf

Browse files
committed
chore: apply changes from main
1 parent 801e317 commit 507a2cf

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/commands/node/tasks.mjs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ export class NodeCommandTasks {
143143
const config = ctx.config
144144

145145
// Transfer some hbar to the node for staking purpose
146-
const accountMap = getNodeAccountMap(config.existingNodeIds)
147-
for (const nodeId of config.existingNodeIds) {
148-
const accountId = accountMap.get(nodeId)
146+
const accountMap = getNodeAccountMap(config.existingNodeAliases)
147+
for (const nodeAlias of config.existingNodeAliases) {
148+
const accountId = accountMap.get(nodeAlias)
149149
await this.accountManager.transferAmount(constants.TREASURY_ACCOUNT_ID, accountId, 1)
150150
}
151151
})
@@ -231,7 +231,7 @@ export class NodeCommandTasks {
231231
downloadNodeGeneratedFiles () {
232232
return new Task('Download generated files from an existing node', async (ctx, task) => {
233233
const config = ctx.config
234-
const node1FullyQualifiedPodName = Templates.renderNetworkPodName(config.existingNodeIds[0])
234+
const node1FullyQualifiedPodName = Templates.renderNetworkPodName(config.existingNodeAliases[0])
235235

236236
// copy the config.txt file from the node1 upgrade directory
237237
await this.k8.copyFrom(node1FullyQualifiedPodName, constants.ROOT_CONTAINER, `${constants.HEDERA_HAPI_PATH}/data/upgrade/current/config.txt`, config.stagingDir)
@@ -257,22 +257,22 @@ export class NodeCommandTasks {
257257
* Return task for checking for all network node pods
258258
* @param {any} ctx
259259
* @param {TaskWrapper} task
260-
* @param {string[]} nodeIds
260+
* @param {string[]} nodeAliases
261261
* @returns {*}
262262
*/
263-
taskCheckNetworkNodePods (ctx, task, nodeIds) {
263+
taskCheckNetworkNodePods (ctx, task, nodeAliases) {
264264
if (!ctx.config) {
265265
ctx.config = {}
266266
}
267267

268268
ctx.config.podNames = {}
269269

270270
const subTasks = []
271-
for (const nodeId of nodeIds) {
271+
for (const nodeAlias of nodeAliases) {
272272
subTasks.push({
273-
title: `Check network pod: ${chalk.yellow(nodeId)}`,
273+
title: `Check network pod: ${chalk.yellow(nodeAlias)}`,
274274
task: async (ctx) => {
275-
ctx.config.podNames[nodeId] = await this.checkNetworkNodePod(ctx.config.namespace, nodeId)
275+
ctx.config.podNames[nodeAlias] = await this.checkNetworkNodePod(ctx.config.namespace, nodeAlias)
276276
}
277277
})
278278
}
@@ -289,43 +289,43 @@ export class NodeCommandTasks {
289289
/**
290290
* Check if the network node pod is running
291291
* @param {string} namespace
292-
* @param {string} nodeId
292+
* @param {string} nodeAlias
293293
* @param {number} [maxAttempts]
294294
* @param {number} [delay]
295295
* @returns {Promise<string>}
296296
*/
297-
async checkNetworkNodePod (namespace, nodeId, maxAttempts = 60, delay = 2000) {
298-
nodeId = nodeId.trim()
299-
const podName = Templates.renderNetworkPodName(nodeId)
297+
async checkNetworkNodePod (namespace, nodeAlias, maxAttempts = 60, delay = 2000) {
298+
nodeAlias = nodeAlias.trim()
299+
const podName = Templates.renderNetworkPodName(nodeAlias)
300300

301301
try {
302302
await this.k8.waitForPods([constants.POD_PHASE_RUNNING], [
303303
'fullstack.hedera.com/type=network-node',
304-
`fullstack.hedera.com/node-name=${nodeId}`
304+
`fullstack.hedera.com/node-name=${nodeAlias}`
305305
], 1, maxAttempts, delay)
306306

307307
return podName
308308
} catch (e) {
309-
throw new SoloError(`no pod found for nodeId: ${nodeId}`, e)
309+
throw new SoloError(`no pod found for nodeAlias: ${nodeAlias}`, e)
310310
}
311311
}
312312

313313
identifyExistingNodes () {
314314
return new Task('Identify existing network nodes', async (ctx, task) => {
315315
const config = ctx.config
316-
config.existingNodeIds = []
316+
config.existingNodeAliases = []
317317
config.serviceMap = await this.accountManager.getNodeServiceMap(config.namespace)
318318
for (/** @type {NetworkNodeServices} **/ const networkNodeServices of config.serviceMap.values()) {
319-
config.existingNodeIds.push(networkNodeServices.nodeName)
319+
config.existingNodeAliases.push(networkNodeServices.nodeName)
320320
}
321-
config.allNodeIds = [...config.existingNodeIds]
322-
return this.taskCheckNetworkNodePods(ctx, task, config.existingNodeIds)
321+
config.allnodeAliases = [...config.existingNodeAliases]
322+
return this.taskCheckNetworkNodePods(ctx, task, config.existingNodeAliases)
323323
})
324324
}
325325

326326
identifyNetworkPods () {
327327
return new Task('Identify network pods', async (ctx, task) => {
328-
return this.taskCheckNetworkNodePods(ctx, task, ctx.config.nodeIds)
328+
return this.taskCheckNetworkNodePods(ctx, task, ctx.config.nodeAliases)
329329
})
330330
}
331331

0 commit comments

Comments
 (0)