4949 Name : "removedb" ,
5050 Usage : "Remove blockchain and state databases" ,
5151 ArgsUsage : "" ,
52- Flags : []cli.Flag {
53- utils .DataDirFlag ,
54- },
55- Category : "DATABASE COMMANDS" ,
52+ Flags : utils .DatabasePathFlags ,
53+ Category : "DATABASE COMMANDS" ,
5654 Description : `
5755Remove blockchain and state databases` ,
5856 }
@@ -80,48 +78,29 @@ Remove blockchain and state databases`,
8078 Action : utils .MigrateFlags (inspect ),
8179 Name : "inspect" ,
8280 ArgsUsage : "<prefix> <start>" ,
83- Flags : []cli.Flag {
84- utils .DataDirFlag ,
85- utils .AncientFlag ,
81+ Flags : append ([]cli.Flag {
8682 utils .SyncModeFlag ,
87- utils .MainnetFlag ,
88- utils .RopstenFlag ,
89- utils .SepoliaFlag ,
90- utils .RinkebyFlag ,
91- utils .GoerliFlag ,
92- },
83+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
9384 Usage : "Inspect the storage size for each type of data in the database" ,
9485 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.` ,
9586 }
9687 dbStatCmd = cli.Command {
9788 Action : utils .MigrateFlags (dbStats ),
9889 Name : "stats" ,
9990 Usage : "Print leveldb statistics" ,
100- Flags : []cli.Flag {
101- utils .DataDirFlag ,
91+ Flags : append ([]cli.Flag {
10292 utils .SyncModeFlag ,
103- utils .MainnetFlag ,
104- utils .RopstenFlag ,
105- utils .SepoliaFlag ,
106- utils .RinkebyFlag ,
107- utils .GoerliFlag ,
108- },
93+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
10994 }
11095 dbCompactCmd = cli.Command {
11196 Action : utils .MigrateFlags (dbCompact ),
11297 Name : "compact" ,
11398 Usage : "Compact leveldb database. WARNING: May take a very long time" ,
114- Flags : []cli.Flag {
115- utils .DataDirFlag ,
99+ Flags : append ([]cli.Flag {
116100 utils .SyncModeFlag ,
117- utils .MainnetFlag ,
118- utils .RopstenFlag ,
119- utils .SepoliaFlag ,
120- utils .RinkebyFlag ,
121- utils .GoerliFlag ,
122101 utils .CacheFlag ,
123102 utils .CacheDatabaseFlag ,
124- },
103+ }, utils . GroupFlags ( utils . NetworkFlags , utils . DatabasePathFlags ) ... ),
125104 Description : `This command performs a database compaction.
126105WARNING: This operation may take a very long time to finish, and may cause database
127106corruption if it is aborted during execution'!` ,
@@ -131,31 +110,19 @@ corruption if it is aborted during execution'!`,
131110 Name : "get" ,
132111 Usage : "Show the value of a database key" ,
133112 ArgsUsage : "<hex-encoded key>" ,
134- Flags : []cli.Flag {
135- utils .DataDirFlag ,
113+ Flags : append ([]cli.Flag {
136114 utils .SyncModeFlag ,
137- utils .MainnetFlag ,
138- utils .RopstenFlag ,
139- utils .SepoliaFlag ,
140- utils .RinkebyFlag ,
141- utils .GoerliFlag ,
142- },
115+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
143116 Description : "This command looks up the specified database key from the database." ,
144117 }
145118 dbDeleteCmd = cli.Command {
146119 Action : utils .MigrateFlags (dbDelete ),
147120 Name : "delete" ,
148121 Usage : "Delete a database key (WARNING: may corrupt your database)" ,
149122 ArgsUsage : "<hex-encoded key>" ,
150- Flags : []cli.Flag {
151- utils .DataDirFlag ,
123+ Flags : append ([]cli.Flag {
152124 utils .SyncModeFlag ,
153- utils .MainnetFlag ,
154- utils .RopstenFlag ,
155- utils .SepoliaFlag ,
156- utils .RinkebyFlag ,
157- utils .GoerliFlag ,
158- },
125+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
159126 Description : `This command deletes the specified database key from the database.
160127WARNING: This is a low-level operation which may cause database corruption!` ,
161128 }
@@ -164,15 +131,9 @@ WARNING: This is a low-level operation which may cause database corruption!`,
164131 Name : "put" ,
165132 Usage : "Set the value of a database key (WARNING: may corrupt your database)" ,
166133 ArgsUsage : "<hex-encoded key> <hex-encoded value>" ,
167- Flags : []cli.Flag {
168- utils .DataDirFlag ,
134+ Flags : append ([]cli.Flag {
169135 utils .SyncModeFlag ,
170- utils .MainnetFlag ,
171- utils .RopstenFlag ,
172- utils .SepoliaFlag ,
173- utils .RinkebyFlag ,
174- utils .GoerliFlag ,
175- },
136+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
176137 Description : `This command sets a given database key to the given value.
177138WARNING: This is a low-level operation which may cause database corruption!` ,
178139 }
@@ -181,92 +142,58 @@ WARNING: This is a low-level operation which may cause database corruption!`,
181142 Name : "dumptrie" ,
182143 Usage : "Show the storage key/values of a given storage trie" ,
183144 ArgsUsage : "<hex-encoded storage trie root> <hex-encoded start (optional)> <int max elements (optional)>" ,
184- Flags : []cli.Flag {
185- utils .DataDirFlag ,
145+ Flags : append ([]cli.Flag {
186146 utils .SyncModeFlag ,
187- utils .MainnetFlag ,
188- utils .RopstenFlag ,
189- utils .SepoliaFlag ,
190- utils .RinkebyFlag ,
191- utils .GoerliFlag ,
192- },
147+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
193148 Description : "This command looks up the specified database key from the database." ,
194149 }
195150 dbDumpFreezerIndex = cli.Command {
196151 Action : utils .MigrateFlags (freezerInspect ),
197152 Name : "freezer-index" ,
198153 Usage : "Dump out the index of a given freezer type" ,
199154 ArgsUsage : "<type> <start (int)> <end (int)>" ,
200- Flags : []cli.Flag {
201- utils .DataDirFlag ,
155+ Flags : append ([]cli.Flag {
202156 utils .SyncModeFlag ,
203- utils .MainnetFlag ,
204- utils .RopstenFlag ,
205- utils .SepoliaFlag ,
206- utils .RinkebyFlag ,
207- utils .GoerliFlag ,
208- },
157+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
209158 Description : "This command displays information about the freezer index." ,
210159 }
211160 dbImportCmd = cli.Command {
212161 Action : utils .MigrateFlags (importLDBdata ),
213162 Name : "import" ,
214163 Usage : "Imports leveldb-data from an exported RLP dump." ,
215164 ArgsUsage : "<dumpfile> <start (optional)" ,
216- Flags : []cli.Flag {
217- utils .DataDirFlag ,
165+ Flags : append ([]cli.Flag {
218166 utils .SyncModeFlag ,
219- utils .MainnetFlag ,
220- utils .RopstenFlag ,
221- utils .RinkebyFlag ,
222- utils .GoerliFlag ,
223- },
167+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
224168 Description : "The import command imports the specific chain data from an RLP encoded stream." ,
225169 }
226170 dbExportCmd = cli.Command {
227171 Action : utils .MigrateFlags (exportChaindata ),
228172 Name : "export" ,
229173 Usage : "Exports the chain data into an RLP dump. If the <dumpfile> has .gz suffix, gzip compression will be used." ,
230174 ArgsUsage : "<type> <dumpfile>" ,
231- Flags : []cli.Flag {
232- utils .DataDirFlag ,
175+ Flags : append ([]cli.Flag {
233176 utils .SyncModeFlag ,
234- utils .MainnetFlag ,
235- utils .RopstenFlag ,
236- utils .RinkebyFlag ,
237- utils .GoerliFlag ,
238- },
177+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
239178 Description : "Exports the specified chain data to an RLP encoded stream, optionally gzip-compressed." ,
240179 }
241180 dbMetadataCmd = cli.Command {
242181 Action : utils .MigrateFlags (showMetaData ),
243182 Name : "metadata" ,
244183 Usage : "Shows metadata about the chain status." ,
245- Flags : []cli.Flag {
246- utils .DataDirFlag ,
184+ Flags : append ([]cli.Flag {
247185 utils .SyncModeFlag ,
248- utils .MainnetFlag ,
249- utils .RopstenFlag ,
250- utils .SepoliaFlag ,
251- utils .RinkebyFlag ,
252- utils .GoerliFlag ,
253- },
186+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
254187 Description : "Shows metadata about the chain status." ,
255188 }
256189 dbMigrateFreezerCmd = cli.Command {
257190 Action : utils .MigrateFlags (freezerMigrate ),
258191 Name : "freezer-migrate" ,
259192 Usage : "Migrate legacy parts of the freezer. (WARNING: may take a long time)" ,
260193 ArgsUsage : "" ,
261- Flags : []cli.Flag {
262- utils .DataDirFlag ,
194+ Flags : append ([]cli.Flag {
263195 utils .SyncModeFlag ,
264- utils .MainnetFlag ,
265- utils .RopstenFlag ,
266- utils .SepoliaFlag ,
267- utils .RinkebyFlag ,
268- utils .GoerliFlag ,
269- },
196+ }, utils .GroupFlags (utils .NetworkFlags , utils .DatabasePathFlags )... ),
270197 Description : `The freezer-migrate command checks your database for receipts in a legacy format and updates those.
271198WARNING: please back-up the receipt files in your ancients before running this command.` ,
272199 }
0 commit comments