/
chaincmd.go
100 lines (91 loc) · 2.42 KB
/
chaincmd.go
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package launcher
import (
"github.com/ethereum/go-ethereum/cmd/utils"
"gopkg.in/urfave/cli.v1"
)
var (
EventsCheckFlag = cli.BoolTFlag{
Name: "check",
Usage: "true if events should be fully checked before importing",
}
importCommand = cli.Command{
Name: "import",
Usage: "Import a blockchain file",
ArgsUsage: "<filename> (<filename 2> ... <filename N>) [check=false]",
Category: "MISCELLANEOUS COMMANDS",
Description: `
opera import events
The import command imports events from an RLP-encoded files.
Events are fully verified by default, unless overridden by check=false flag.`,
Subcommands: []cli.Command{
{
Action: utils.MigrateFlags(importEvents),
Name: "events",
Usage: "Import blockchain events",
ArgsUsage: "<filename> (<filename 2> ... <filename N>) [--check=false]",
Flags: []cli.Flag{
DataDirFlag,
EventsCheckFlag,
},
Description: `
The import command imports events from RLP-encoded files.
Events are fully verified by default, unless overridden by --check=false flag.`,
},
{
Action: utils.MigrateFlags(importEvm),
Name: "evm",
Usage: "Import EVM storage",
ArgsUsage: "<filename> (<filename 2> ... <filename N>)",
Flags: []cli.Flag{
DataDirFlag,
EventsCheckFlag,
},
Description: `
opera import evm
The import command imports EVM storage (trie nodes, code, preimages) from files.`,
},
},
}
exportCommand = cli.Command{
Name: "export",
Usage: "Export blockchain",
Category: "MISCELLANEOUS COMMANDS",
Subcommands: []cli.Command{
{
Name: "events",
Usage: "Export blockchain events",
ArgsUsage: "<filename> [<epochFrom> <epochTo>]",
Action: utils.MigrateFlags(exportEvents),
Flags: []cli.Flag{
DataDirFlag,
},
Description: `
opera export events
Requires a first argument of the file to write to.
Optional second and third arguments control the first and
last epoch to write. If the file ends with .gz, the output will
be gzipped
`,
},
},
}
checkCommand = cli.Command{
Name: "check",
Usage: "Check blockchain",
Category: "MISCELLANEOUS COMMANDS",
Subcommands: []cli.Command{
{
Name: "evm",
Usage: "Check EVM storage",
Action: utils.MigrateFlags(checkEvm),
Flags: []cli.Flag{
DataDirFlag,
},
Description: `
opera check evm
Checks EVM storage roots and code hashes
`,
},
},
}
)