Adds command to remove chain_data (#2954)
This commit is contained in:
committed by
Antioch Peverell
parent
2ae76d39bb
commit
45cf1d96df
@@ -169,6 +169,16 @@ fn real_main() -> i32 {
|
||||
// client commands and options
|
||||
("client", Some(client_args)) => cmd::client_command(client_args, node_config.unwrap()),
|
||||
|
||||
// clean command
|
||||
("clean", _) => {
|
||||
let db_root_path = node_config.unwrap().members.unwrap().server.db_root;
|
||||
println!("Cleaning chain data directory: {}", db_root_path);
|
||||
match std::fs::remove_dir_all(db_root_path) {
|
||||
Ok(_) => 0,
|
||||
Err(_) => 1,
|
||||
}
|
||||
},
|
||||
|
||||
// If nothing is specified, try to just use the config file instead
|
||||
// this could possibly become the way to configure most things
|
||||
// with most command line options being phased out
|
||||
|
||||
@@ -12,6 +12,8 @@ args:
|
||||
long: usernet
|
||||
takes_value: false
|
||||
subcommands:
|
||||
- clean:
|
||||
about: Clean Grin chain data
|
||||
- wallet:
|
||||
about: As of v1.1.0, the wallet has been split into a separate executable. See https://github.com/mimblewimble/grin-wallet/releases
|
||||
usage: As of v1.1.0, the wallet has been split into a separate executable. See https://github.com/mimblewimble/grin-wallet/releases to download
|
||||
|
||||
Reference in New Issue
Block a user