You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/geth/dbcmd.go
+96-55Lines changed: 96 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,7 @@ import (
28
28
"github.com/ethereum/go-ethereum/console/prompt"
29
29
"github.com/ethereum/go-ethereum/core/rawdb"
30
30
"github.com/ethereum/go-ethereum/ethdb"
31
-
"github.com/ethereum/go-ethereum/ethdb/leveldb"
32
31
"github.com/ethereum/go-ethereum/log"
33
-
"github.com/syndtr/goleveldb/leveldb/opt"
34
32
"gopkg.in/urfave/cli.v1"
35
33
)
36
34
@@ -65,43 +63,98 @@ Remove blockchain and state databases`,
65
63
Action: utils.MigrateFlags(inspect),
66
64
Name: "inspect",
67
65
ArgsUsage: "<prefix> <start>",
68
-
66
+
Flags: []cli.Flag{
67
+
utils.DataDirFlag,
68
+
utils.SyncModeFlag,
69
+
utils.MainnetFlag,
70
+
utils.RopstenFlag,
71
+
utils.RinkebyFlag,
72
+
utils.GoerliFlag,
73
+
utils.YoloV3Flag,
74
+
},
69
75
Usage: "Inspect the storage size for each type of data in the database",
70
76
Description: `This commands iterates the entire database. If the optional 'prefix' and 'start' arguments are provided, then the iteration is limited to the given subset of data.`,
71
77
}
72
78
dbStatCmd= cli.Command{
73
-
Action: dbStats,
79
+
Action: utils.MigrateFlags(dbStats),
74
80
Name: "stats",
75
81
Usage: "Print leveldb statistics",
82
+
Flags: []cli.Flag{
83
+
utils.DataDirFlag,
84
+
utils.SyncModeFlag,
85
+
utils.MainnetFlag,
86
+
utils.RopstenFlag,
87
+
utils.RinkebyFlag,
88
+
utils.GoerliFlag,
89
+
utils.YoloV3Flag,
90
+
},
76
91
}
77
92
dbCompactCmd= cli.Command{
78
-
Action: dbCompact,
93
+
Action: utils.MigrateFlags(dbCompact),
79
94
Name: "compact",
80
95
Usage: "Compact leveldb database. WARNING: May take a very long time",
96
+
Flags: []cli.Flag{
97
+
utils.DataDirFlag,
98
+
utils.SyncModeFlag,
99
+
utils.MainnetFlag,
100
+
utils.RopstenFlag,
101
+
utils.RinkebyFlag,
102
+
utils.GoerliFlag,
103
+
utils.YoloV3Flag,
104
+
utils.CacheFlag,
105
+
utils.CacheDatabaseFlag,
106
+
},
81
107
Description: `This command performs a database compaction.
82
108
WARNING: This operation may take a very long time to finish, and may cause database
83
109
corruption if it is aborted during execution'!`,
84
110
}
85
111
dbGetCmd= cli.Command{
86
-
Action: dbGet,
87
-
Name: "get",
88
-
Usage: "Show the value of a database key",
89
-
ArgsUsage: "<hex-encoded key>",
112
+
Action: utils.MigrateFlags(dbGet),
113
+
Name: "get",
114
+
Usage: "Show the value of a database key",
115
+
ArgsUsage: "<hex-encoded key>",
116
+
Flags: []cli.Flag{
117
+
utils.DataDirFlag,
118
+
utils.SyncModeFlag,
119
+
utils.MainnetFlag,
120
+
utils.RopstenFlag,
121
+
utils.RinkebyFlag,
122
+
utils.GoerliFlag,
123
+
utils.YoloV3Flag,
124
+
},
90
125
Description: "This command looks up the specified database key from the database.",
91
126
}
92
127
dbDeleteCmd= cli.Command{
93
-
Action: dbDelete,
128
+
Action: utils.MigrateFlags(dbDelete),
94
129
Name: "delete",
95
130
Usage: "Delete a database key (WARNING: may corrupt your database)",
96
131
ArgsUsage: "<hex-encoded key>",
132
+
Flags: []cli.Flag{
133
+
utils.DataDirFlag,
134
+
utils.SyncModeFlag,
135
+
utils.MainnetFlag,
136
+
utils.RopstenFlag,
137
+
utils.RinkebyFlag,
138
+
utils.GoerliFlag,
139
+
utils.YoloV3Flag,
140
+
},
97
141
Description: `This command deletes the specified database key from the database.
98
142
WARNING: This is a low-level operation which may cause database corruption!`,
99
143
}
100
144
dbPutCmd= cli.Command{
101
-
Action: dbPut,
145
+
Action: utils.MigrateFlags(dbPut),
102
146
Name: "put",
103
147
Usage: "Set the value of a database key (WARNING: may corrupt your database)",
0 commit comments