Skip to content

Commit

Permalink
chore: revert
Browse files Browse the repository at this point in the history
Signed-off-by: Ivo Yankov <[email protected]>
  • Loading branch information
Ivo-Yankov committed Oct 10, 2024
1 parent 3778587 commit 4758bfa
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
1 change: 1 addition & 0 deletions src/commands/node/flags.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const COMMON_DELETE_OPTIONAL_FLAGS = [
]

const COMMON_ADD_REQUIRED_FLAGS = [
flags.app,
flags.cacheDir,
flags.chainId,
flags.devMode,
Expand Down
52 changes: 26 additions & 26 deletions src/commands/node/tasks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ export class NodeCommandTasks {
* @private
*/
_generateGossipKeys (generateMultiple) {
return new Task('Generate gossip keys', async (ctx, task) => {
return new Task('Generate gossip keys', (ctx, task) => {
const config = ctx.config
const nodeAliases = generateMultiple ? config.nodeAliases : [config.nodeAlias]
const subTasks = this.keyManager.taskGenerateGossipKeys(this.keytoolDepManager, nodeAliases, config.keysDir, config.curDate)
Expand All @@ -411,7 +411,7 @@ export class NodeCommandTasks {
* @private
*/
_generateGrpcTlsKeys (generateMultiple) {
return new Task('Generate gRPC TLS Keys', async (ctx, task) => {
return new Task('Generate gRPC TLS Keys', (ctx, task) => {
const config = ctx.config
const nodeAliases = generateMultiple ? config.nodeAliases : [config.nodeAlias]
const subTasks = this.keyManager.taskGenerateTLSKeys(nodeAliases, config.keysDir, config.curDate)
Expand Down Expand Up @@ -490,7 +490,7 @@ export class NodeCommandTasks {
}

loadAdminKey () {
return new Task('Load node admin key', async (ctx, task) => {
return new Task('Load node admin key', (ctx, task) => {
const config = ctx.config
config.adminKey = PrivateKey.fromStringED25519(constants.GENESIS_KEY)
})
Expand Down Expand Up @@ -682,13 +682,13 @@ export class NodeCommandTasks {
}

identifyNetworkPods () {
return new Task('Identify network pods', async (ctx, task) => {
return new Task('Identify network pods', (ctx, task) => {
return this.taskCheckNetworkNodePods(ctx, task, ctx.config.nodeAliases)
})
}

fetchPlatformSoftware () {
return new Task('Fetch platform software into network nodes', async (ctx, task) => {
return new Task('Fetch platform software into network nodes', (ctx, task) => {
const { nodeAliases, podNames, releaseTag, localBuildPath } = ctx.config

if (localBuildPath !== '') {
Expand All @@ -713,7 +713,7 @@ export class NodeCommandTasks {
* @returns {Task}
*/
setupNetworkNodes (nodeAliasesProperty) {
return new Task('Setup network nodes', async (ctx, task) => {
return new Task('Setup network nodes', (ctx, task) => {
const subTasks = []
for (const nodeAlias of ctx.config[nodeAliasesProperty]) {
const podName = ctx.config.podNames[nodeAlias]
Expand All @@ -733,7 +733,7 @@ export class NodeCommandTasks {
}

prepareStagingDirectory (nodeAliasesProperty) {
return new Task('Prepare staging directory', async (ctx, task) => {
return new Task('Prepare staging directory', (ctx, task) => {
const config = ctx.config
const nodeAliases = config[nodeAliasesProperty]
const subTasks = [
Expand Down Expand Up @@ -761,7 +761,7 @@ export class NodeCommandTasks {
}

startNodes (nodeAliasesProperty) {
return new Task('Starting nodes', async (ctx, task) => {
return new Task('Starting nodes', (ctx, task) => {
const config = ctx.config
const nodeAliases = config[nodeAliasesProperty]

Expand Down Expand Up @@ -798,27 +798,27 @@ export class NodeCommandTasks {
}

checkAllNodesAreActive (nodeAliasesProperty) {
return new Task('Check all nodes are ACTIVE', async (ctx, task) => {
return new Task('Check all nodes are ACTIVE', (ctx, task) => {
return this._checkNodeActivenessTask(ctx, task, ctx.config[nodeAliasesProperty])
})
}

checkAllNodesAreFrozen (nodeAliasesProperty) {
return new Task('Check all nodes are ACTIVE', async (ctx, task) => {
return new Task('Check all nodes are ACTIVE', (ctx, task) => {
return this._checkNodeActivenessTask(ctx, task, ctx.config[nodeAliasesProperty], NodeStatusCodes.FREEZE_COMPLETE)
})
}

checkNodeProxiesAreActive (skip) {
return new Task('Check node proxies are ACTIVE', async (ctx, task) => {
return new Task('Check node proxies are ACTIVE', (ctx, task) => {
// this is more reliable than checking the nodes logs for ACTIVE, as the
// logs will have a lot of white noise from being behind
return this._checkNodesProxiesTask(ctx, task, ctx.config.nodeAliases)
}, skip)
}

checkAllNodeProxiesAreActive () {
return new Task('Check all node proxies are ACTIVE', async (ctx, task) => {
return new Task('Check all node proxies are ACTIVE', (ctx, task) => {
// this is more reliable than checking the nodes logs for ACTIVE, as the
// logs will have a lot of white noise from being behind
return this._checkNodesProxiesTask(ctx, task, ctx.config.allNodeAliases)
Expand Down Expand Up @@ -851,7 +851,7 @@ export class NodeCommandTasks {
}

addNodeStakes () {
return new Task('Add node stakes', async (ctx, task) => {
return new Task('Add node stakes', (ctx, task) => {
if (ctx.config.app === '' || ctx.config.app === constants.HEDERA_APP_NAME) {
const subTasks = []
const accountMap = getNodeAccountMap(ctx.config.nodeAliases)
Expand Down Expand Up @@ -881,7 +881,7 @@ export class NodeCommandTasks {
}

stopNodes () {
return new Task('Stopping nodes', async (ctx, task) => {
return new Task('Stopping nodes', (ctx, task) => {
const subTasks = []
for (const nodeAlias of ctx.config.nodeAliases) {
const podName = ctx.config.podNames[nodeAlias]
Expand All @@ -903,7 +903,7 @@ export class NodeCommandTasks {
}

finalize () {
return new Task('Finalize', async (ctx, task) => {
return new Task('Finalize', (ctx, task) => {
// reset flags so that keys are not regenerated later
this.configManager.setFlag(flags.generateGossipKeys, false)
this.configManager.setFlag(flags.generateTlsKeys, false)
Expand All @@ -912,7 +912,7 @@ export class NodeCommandTasks {
}

dumpNetworkNodesSaveState () {
return new Task('Dump network nodes saved state', async (ctx, task) => {
return new Task('Dump network nodes saved state', (ctx, task) => {
const config = /** @type {NodeRefreshConfigClass} **/ ctx.config
const subTasks = []
for (const nodeAlias of config.nodeAliases) {
Expand Down Expand Up @@ -941,15 +941,15 @@ export class NodeCommandTasks {
}

checkPVCsEnabled () {
return new Task('Check that PVCs are enabled', async (ctx, task) => {
return new Task('Check that PVCs are enabled', (ctx, task) => {
if (!this.configManager.getFlag(flags.persistentVolumeClaims)) {
throw new SoloError('PVCs are not enabled. Please enable PVCs before adding a node')
}
})
}

determineNewNodeAccountNumber () {
return new Task('Determine new node account number', async (ctx, task) => {
return new Task('Determine new node account number', (ctx, task) => {
const config = /** @type {NodeAddConfigClass} **/ ctx.config
const values = { hedera: { nodes: [] } }
let maxNum = 0
Expand Down Expand Up @@ -1000,7 +1000,7 @@ export class NodeCommandTasks {
}

loadSigningKeyCertificate () {
return new Task('Load signing key certificate', async (ctx, task) => {
return new Task('Load signing key certificate', (ctx, task) => {
const config = ctx.config
const signingCertFile = Templates.renderGossipPemPublicKeyFile(constants.SIGNING_KEY_PREFIX, config.nodeAlias)
const signingCertFullPath = path.join(config.keysDir, signingCertFile)

Check warning on line 1006 in src/commands/node/tasks.mjs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/commands/node/tasks.mjs#L1006

Detected possible user input going into a `path.join` or `path.resolve` function.
Expand All @@ -1009,7 +1009,7 @@ export class NodeCommandTasks {
}

computeMTLSCertificateHash () {
return new Task('Compute mTLS certificate hash', async (ctx, task) => {
return new Task('Compute mTLS certificate hash', (ctx, task) => {
const config = ctx.config
const tlsCertFile = Templates.renderTLSPemPublicKeyFile(config.nodeAlias)
const tlsCertFullPath = path.join(config.keysDir, tlsCertFile)

Check warning on line 1015 in src/commands/node/tasks.mjs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/commands/node/tasks.mjs#L1015

Detected possible user input going into a `path.join` or `path.resolve` function.
Expand All @@ -1019,7 +1019,7 @@ export class NodeCommandTasks {
}

prepareGossipEndpoints () {
return new Task('Prepare gossip endpoints', async (ctx, task) => {
return new Task('Prepare gossip endpoints', (ctx, task) => {
const config = ctx.config
let endpoints = []
if (!config.gossipEndpoints) {
Expand All @@ -1040,7 +1040,7 @@ export class NodeCommandTasks {
}

prepareGrpcServiceEndpoints () {
return new Task('Prepare grpc service endpoints', async (ctx, task) => {
return new Task('Prepare grpc service endpoints', (ctx, task) => {
const config = ctx.config
let endpoints = []

Expand Down Expand Up @@ -1123,7 +1123,7 @@ export class NodeCommandTasks {
}

copyNodeKeysToSecrets () {
return new Task('Copy node keys to secrets', async (ctx, task) => {
return new Task('Copy node keys to secrets', (ctx, task) => {
const subTasks = this.platformInstaller.copyNodeKeys(ctx.config.stagingDir, ctx.config.allNodeAliases)

// set up the sub-tasks for copying node keys to staging directory
Expand Down Expand Up @@ -1186,7 +1186,7 @@ export class NodeCommandTasks {
}

saveContextData (argv, targetFile, parser) {
return new Task('Save context data', async (ctx, task) => {
return new Task('Save context data', (ctx, task) => {
const outputDir = argv[flags.outputDir.name]
if (!outputDir) {
throw new SoloError(`Path to export context data not specified. Please set a value for --${flags.outputDir.name}`)
Expand All @@ -1201,7 +1201,7 @@ export class NodeCommandTasks {
}

loadContextData (argv, targetFile, parser) {
return new Task('Load context data', async (ctx, task) => {
return new Task('Load context data', (ctx, task) => {
const inputDir = argv[flags.inputDir.name]
if (!inputDir) {
throw new SoloError(`Path to context data not specified. Please set a value for --${flags.inputDir.name}`)
Expand Down Expand Up @@ -1243,7 +1243,7 @@ export class NodeCommandTasks {
}

checkNodePodsAreRunning () {
return new Task('Check node pods are running', async (ctx, task) => {
return new Task('Check node pods are running', (ctx, task) => {
const config = /** @type {NodeUpdateConfigClass} **/ ctx.config
const subTasks = []
for (const nodeAlias of config.allNodeAliases) {
Expand Down

0 comments on commit 4758bfa

Please sign in to comment.