This reverts commit eae3166bdc
.
This commit is contained in:
committed by
Tyera Eulberg
parent
704d05f52d
commit
9fff4aa8b8
@ -1,23 +1,26 @@
|
|||||||
/// The `bigtable` subcommand
|
/// The `bigtable` subcommand
|
||||||
use clap::{
|
use {
|
||||||
value_t, value_t_or_exit, values_t_or_exit, App, AppSettings, Arg, ArgMatches, SubCommand,
|
crate::ledger_path::canonicalize_ledger_path,
|
||||||
};
|
clap::{
|
||||||
use solana_clap_utils::{
|
value_t, value_t_or_exit, values_t_or_exit, App, AppSettings, Arg, ArgMatches, SubCommand,
|
||||||
input_parsers::pubkey_of,
|
},
|
||||||
input_validators::{is_slot, is_valid_pubkey},
|
solana_clap_utils::{
|
||||||
};
|
input_parsers::pubkey_of,
|
||||||
use solana_cli_output::{
|
input_validators::{is_slot, is_valid_pubkey},
|
||||||
display::println_transaction, CliBlock, CliTransaction, CliTransactionConfirmation,
|
},
|
||||||
OutputFormat,
|
solana_cli_output::{
|
||||||
};
|
display::println_transaction, CliBlock, CliTransaction, CliTransactionConfirmation,
|
||||||
use solana_ledger::{blockstore::Blockstore, blockstore_db::AccessType};
|
OutputFormat,
|
||||||
use solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature};
|
},
|
||||||
use solana_transaction_status::{ConfirmedBlock, EncodedTransaction, UiTransactionEncoding};
|
solana_ledger::{blockstore::Blockstore, blockstore_db::AccessType},
|
||||||
use std::{
|
solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature},
|
||||||
path::Path,
|
solana_transaction_status::{ConfirmedBlock, EncodedTransaction, UiTransactionEncoding},
|
||||||
process::exit,
|
std::{
|
||||||
result::Result,
|
path::Path,
|
||||||
sync::{atomic::AtomicBool, Arc},
|
process::exit,
|
||||||
|
result::Result,
|
||||||
|
sync::{atomic::AtomicBool, Arc},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
async fn upload(
|
async fn upload(
|
||||||
@ -426,8 +429,11 @@ pub fn bigtable_process_command(ledger_path: &Path, matches: &ArgMatches<'_>) {
|
|||||||
let ending_slot = value_t!(arg_matches, "ending_slot", Slot).ok();
|
let ending_slot = value_t!(arg_matches, "ending_slot", Slot).ok();
|
||||||
let allow_missing_metadata = arg_matches.is_present("allow_missing_metadata");
|
let allow_missing_metadata = arg_matches.is_present("allow_missing_metadata");
|
||||||
let force_reupload = arg_matches.is_present("force_reupload");
|
let force_reupload = arg_matches.is_present("force_reupload");
|
||||||
let blockstore =
|
let blockstore = crate::open_blockstore(
|
||||||
crate::open_blockstore(ledger_path, AccessType::TryPrimaryThenSecondary, None);
|
&canonicalize_ledger_path(ledger_path),
|
||||||
|
AccessType::TryPrimaryThenSecondary,
|
||||||
|
None,
|
||||||
|
);
|
||||||
|
|
||||||
runtime.block_on(upload(
|
runtime.block_on(upload(
|
||||||
blockstore,
|
blockstore,
|
||||||
|
30
ledger-tool/src/ledger_path.rs
Normal file
30
ledger-tool/src/ledger_path.rs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
use {
|
||||||
|
clap::{value_t, ArgMatches},
|
||||||
|
std::{
|
||||||
|
fs,
|
||||||
|
path::{Path, PathBuf},
|
||||||
|
process::exit,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
pub fn parse_ledger_path(matches: &ArgMatches<'_>, name: &str) -> PathBuf {
|
||||||
|
PathBuf::from(value_t!(matches, name, String).unwrap_or_else(|_err| {
|
||||||
|
eprintln!(
|
||||||
|
"Error: Missing --ledger <DIR> argument.\n\n{}",
|
||||||
|
matches.usage()
|
||||||
|
);
|
||||||
|
exit(1);
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Canonicalize ledger path to avoid issues with symlink creation
|
||||||
|
pub fn canonicalize_ledger_path(ledger_path: &Path) -> PathBuf {
|
||||||
|
fs::canonicalize(&ledger_path).unwrap_or_else(|err| {
|
||||||
|
eprintln!(
|
||||||
|
"Unable to access ledger path '{}': {}",
|
||||||
|
ledger_path.display(),
|
||||||
|
err
|
||||||
|
);
|
||||||
|
exit(1);
|
||||||
|
})
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user