Add ability to prune ledger (#5128)

* Add utility to prune the ledger

* Add tests

* Fix clippy

* Fix off by one

* Rework to force delete every column

* Minor fixup
This commit is contained in:
Sagar Dhawan
2019-07-17 14:42:29 -07:00
committed by GitHub
parent 027ebb6670
commit 6ad9dc18d8
5 changed files with 179 additions and 2 deletions

View File

@ -91,6 +91,7 @@ fn main() {
.long("slot-list")
.value_name("FILENAME")
.takes_value(true)
.required(true)
.help("The location of the YAML file with a list of rollback slot heights and hashes"),
))
.subcommand(SubCommand::with_name("list-roots").about("Output upto last <num-roots> root hashes and their heights starting at the given block height").arg(
@ -191,7 +192,7 @@ fn main() {
.last()
.expect("Failed to find a valid slot");
println!("Prune at slot {:?} hash {:?}", target_slot, target_hash);
// ToDo: Do the actual pruning of the database
blocktree.prune(*target_slot);
}
}
("list-roots", Some(args_matches)) => {