Add bigtable transaction-history --query-chunk-size
argument
This commit is contained in:
@ -134,6 +134,7 @@ pub async fn transaction_history(
|
|||||||
until: Option<Signature>,
|
until: Option<Signature>,
|
||||||
verbose: bool,
|
verbose: bool,
|
||||||
show_transactions: bool,
|
show_transactions: bool,
|
||||||
|
query_chunk_size: usize,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let bigtable = solana_storage_bigtable::LedgerStorage::new(true).await?;
|
let bigtable = solana_storage_bigtable::LedgerStorage::new(true).await?;
|
||||||
|
|
||||||
@ -143,7 +144,7 @@ pub async fn transaction_history(
|
|||||||
address,
|
address,
|
||||||
before.as_ref(),
|
before.as_ref(),
|
||||||
until.as_ref(),
|
until.as_ref(),
|
||||||
limit.min(1000),
|
limit.min(query_chunk_size),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
@ -323,6 +324,19 @@ impl BigTableSubCommand for App<'_, '_> {
|
|||||||
.default_value("18446744073709551615")
|
.default_value("18446744073709551615")
|
||||||
.help("Maximum number of transaction signatures to return"),
|
.help("Maximum number of transaction signatures to return"),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("query_chunk_size")
|
||||||
|
.long("query-chunk-size")
|
||||||
|
.takes_value(true)
|
||||||
|
.value_name("AMOUNT")
|
||||||
|
.validator(is_slot)
|
||||||
|
.default_value("1000")
|
||||||
|
.help(
|
||||||
|
"Number of transaction signatures to query at once. \
|
||||||
|
Smaller: more responsive/lower throughput. \
|
||||||
|
Larger: less responsive/higher throughput",
|
||||||
|
),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("before")
|
Arg::with_name("before")
|
||||||
.long("before")
|
.long("before")
|
||||||
@ -397,6 +411,7 @@ pub fn bigtable_process_command(ledger_path: &Path, matches: &ArgMatches<'_>) {
|
|||||||
("transaction-history", Some(arg_matches)) => {
|
("transaction-history", Some(arg_matches)) => {
|
||||||
let address = pubkey_of(arg_matches, "address").unwrap();
|
let address = pubkey_of(arg_matches, "address").unwrap();
|
||||||
let limit = value_t_or_exit!(arg_matches, "limit", usize);
|
let limit = value_t_or_exit!(arg_matches, "limit", usize);
|
||||||
|
let query_chunk_size = value_t_or_exit!(arg_matches, "query_chunk_size", usize);
|
||||||
let before = arg_matches
|
let before = arg_matches
|
||||||
.value_of("before")
|
.value_of("before")
|
||||||
.map(|signature| signature.parse().expect("Invalid signature"));
|
.map(|signature| signature.parse().expect("Invalid signature"));
|
||||||
@ -413,6 +428,7 @@ pub fn bigtable_process_command(ledger_path: &Path, matches: &ArgMatches<'_>) {
|
|||||||
until,
|
until,
|
||||||
verbose,
|
verbose,
|
||||||
show_transactions,
|
show_transactions,
|
||||||
|
query_chunk_size,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
|
Reference in New Issue
Block a user