diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index bcf3b80fb..fa0cc8af5 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -891,6 +891,16 @@ fn main() { .value_name("PATHS") .takes_value(true) .help("Comma separated persistent accounts location"); + let accounts_index_path_arg = Arg::with_name("accounts_index_path") + .long("accounts-index-path") + .value_name("PATH") + .takes_value(true) + .multiple(true) + .help( + "Persistent accounts-index location. \ + May be specified multiple times. \ + [default: [ledger]/accounts_index]", + ); let accounts_db_test_hash_calculation_arg = Arg::with_name("accounts_db_test_hash_calculation") .long("accounts-db-test-hash-calculation") .help("Enable hash calculation test"); @@ -1195,6 +1205,7 @@ fn main() { .about("Verify the ledger") .arg(&no_snapshot_arg) .arg(&account_paths_arg) + .arg(&accounts_index_path_arg) .arg(&halt_at_slot_arg) .arg(&limit_load_slot_count_from_snapshot_arg) .arg(&accounts_index_bins) @@ -1925,7 +1936,15 @@ fn main() { } { - let mut accounts_index_paths = vec![]; // will be option + let mut accounts_index_paths: Vec = + if arg_matches.is_present("accounts_index_path") { + values_t_or_exit!(arg_matches, "accounts_index_path", String) + .into_iter() + .map(PathBuf::from) + .collect() + } else { + vec![] + }; if accounts_index_paths.is_empty() { accounts_index_paths = vec![ledger_path.join("accounts_index")]; } diff --git a/validator/src/main.rs b/validator/src/main.rs index 61557aaa9..877de430d 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -2011,6 +2011,16 @@ pub fn main() { .takes_value(true) .help("Number of bins to divide the accounts index into"), ) + .arg( + Arg::with_name("accounts_index_path") + .long("accounts-index-path") + .value_name("PATH") + .takes_value(true) + .multiple(true) + .help("Persistent accounts-index location. \ + May be specified multiple times. \ + [default: [ledger]/accounts_index]"), + ) .arg( Arg::with_name("accounts_db_test_hash_calculation") .long("accounts-db-test-hash-calculation") @@ -2530,7 +2540,14 @@ pub fn main() { } { - let mut accounts_index_paths = vec![]; // will be option soon + let mut accounts_index_paths: Vec = if matches.is_present("accounts_index_path") { + values_t_or_exit!(matches, "accounts_index_path", String) + .into_iter() + .map(PathBuf::from) + .collect() + } else { + vec![] + }; if accounts_index_paths.is_empty() { accounts_index_paths = vec![ledger_path.join("accounts_index")]; }