/
verify.ts
33 lines (28 loc) · 1.09 KB
/
verify.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { app } from "@arkecosystem/core-container";
import { Logger } from "@arkecosystem/core-interfaces";
import { SnapshotManager } from "@arkecosystem/core-snapshots";
import { flags } from "@oclif/command";
import fs from "fs-extra";
import { setUpLite } from "../utils";
import { BaseCommand } from "./command";
export class VerifyCommand extends BaseCommand {
public static description: string = "check validity of specified snapshot";
public static flags = {
...BaseCommand.flags,
blocks: flags.string({
description: "blocks to verify, corelates to folder name",
}),
codec: flags.string({
description: "codec name, default is msg-lite binary",
}),
signatureVerify: flags.boolean({
description: "signature verification",
}),
};
public async run(): Promise<void> {
// tslint:disable-next-line:no-shadowed-variable
const { flags } = this.parse(VerifyCommand);
await setUpLite(flags);
await app.resolvePlugin<SnapshotManager>("snapshots").verifyData(flags);
}
}