diff --git a/packages/dashmate/src/commands/restart.js b/packages/dashmate/src/commands/restart.js index 903fafd73f..a035239216 100644 --- a/packages/dashmate/src/commands/restart.js +++ b/packages/dashmate/src/commands/restart.js @@ -10,7 +10,8 @@ export default class RestartCommand extends ConfigBaseCommand { static flags = { ...ConfigBaseCommand.flags, platform: Flags.boolean({ char: 'p', description: 'restart only platform', default: false }), - safe: Flags.boolean({ char: 's', description: 'wait for dkg before stop', default: false }), + safe: Flags.boolean({ char: 's', description: 'wait for DKG before stop', default: false }), + force: Flags.boolean({ char: 'f', description: 'ignore DKG (masternode might be banned)', default: false }), }; /** @@ -27,6 +28,7 @@ export default class RestartCommand extends ConfigBaseCommand { verbose: isVerbose, platform: platformOnly, safe: isSafe, + force: isForce, }, dockerCompose, restartNodeTask, @@ -54,6 +56,7 @@ export default class RestartCommand extends ConfigBaseCommand { await tasks.run({ isVerbose, isSafe, + isForce, platformOnly: platformOnly === true, }); } catch (e) { diff --git a/packages/dashmate/src/commands/stop.js b/packages/dashmate/src/commands/stop.js index 1d182ad4ea..dc9f3fe177 100644 --- a/packages/dashmate/src/commands/stop.js +++ b/packages/dashmate/src/commands/stop.js @@ -11,7 +11,7 @@ export default class StopCommand extends ConfigBaseCommand { ...ConfigBaseCommand.flags, force: Flags.boolean({ char: 'f', - description: 'force stop even if any service is running', + description: 'force stop even if any service is running or DKG is in progress', default: false, }), platform: Flags.boolean({ diff --git a/packages/dashmate/src/listr/tasks/stopNodeTaskFactory.js b/packages/dashmate/src/listr/tasks/stopNodeTaskFactory.js index 29bf6c175e..e57101c96b 100644 --- a/packages/dashmate/src/listr/tasks/stopNodeTaskFactory.js +++ b/packages/dashmate/src/listr/tasks/stopNodeTaskFactory.js @@ -39,7 +39,7 @@ export default function stopNodeTaskFactory( }, { title: 'Check node is participating in DKG', - enabled: (ctx) => config.get('core.masternode.enable') && !ctx.isForce && !ctx.isSafe, + enabled: (ctx) => config.get('core.masternode.enable') && !ctx.isForce && !ctx.isSafe && !ctx.platformOnly, task: async () => { const rpcClient = createRpcClient({ port: config.get('core.rpc.port'), @@ -59,7 +59,7 @@ export default function stopNodeTaskFactory( }, { title: 'Wait for DKG window to pass', - enabled: (ctx) => config.get('core.masternode.enable') && !ctx.isForce && ctx.isSafe, + enabled: (ctx) => config.get('core.masternode.enable') && !ctx.isForce && ctx.isSafe && !ctx.platformOnly, task: async () => waitForDKGWindowPass(createRpcClient({ port: config.get('core.rpc.port'), user: 'dashmate',