Skip to content

Commit

Permalink
Adds command to remove chain_data (#2954)
Browse files Browse the repository at this point in the history
  • Loading branch information
pharazen authored and antiochp committed Jul 25, 2019
1 parent 2ae76d3 commit 45cf1d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bin/grin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/bin/grin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 45cf1d9

Please sign in to comment.