diff --git a/ironfish-cli/src/commands/chain/readd-block.ts b/ironfish-cli/src/commands/chain/readd-block.ts deleted file mode 100644 index d8e0ce6293..0000000000 --- a/ironfish-cli/src/commands/chain/readd-block.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -import { Args, ux } from '@oclif/core' -import { IronfishCommand } from '../../command' -import { LocalFlags } from '../../flags' - -export default class ReAddBlock extends IronfishCommand { - static description = - 'Remove and readd a block on the chain if it has no other blocks after it' - - static hidden = true - - static flags = { - ...LocalFlags, - } - - static args = { - hash: Args.string({ - required: true, - description: 'The hash of the block in hex format', - }), - } - - async start(): Promise { - const { args } = await this.parse(ReAddBlock) - const hash = Buffer.from(args.hash, 'hex') - - ux.action.start(`Opening node`) - const node = await this.sdk.node() - await node.openDB() - await node.chain.open() - ux.action.stop('done.') - - const block = await node.chain.getBlock(hash) - - if (!block) { - this.log(`No block found with hash ${hash.toString('hex')}`) - return this.exit(0) - } - - await node.chain.removeBlock(hash) - await node.chain.addBlock(block) - - this.log('Block has been reimported.') - } -}