Add ability to prune ledger (bp #5128) (#5158)

automerge
This commit is contained in:
mergify[bot]
2019-07-17 17:14:38 -07:00
committed by Grimes
parent 5f1d86c040
commit 4244a0f716
5 changed files with 172 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ license = "Apache-2.0"
homepage = "https://solana.com/"
[dependencies]
bincode = "1.1.4"
clap = "2.33.0"
serde = "1.0.94"
serde_derive = "1.0.94"

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)) => {