|
|
@ -155,14 +155,7 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
|
|
|
.default_value("15")
|
|
|
|
.default_value("15")
|
|
|
|
.help("Wait up to timeout seconds for transaction confirmation"),
|
|
|
|
.help("Wait up to timeout seconds for transaction confirmation"),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.arg(
|
|
|
|
.arg(commitment_arg()),
|
|
|
|
Arg::with_name(COMMITMENT_ARG.name)
|
|
|
|
|
|
|
|
.long(COMMITMENT_ARG.long)
|
|
|
|
|
|
|
|
.takes_value(true)
|
|
|
|
|
|
|
|
.possible_values(&["default", "max", "recent", "root"])
|
|
|
|
|
|
|
|
.value_name("COMMITMENT_LEVEL")
|
|
|
|
|
|
|
|
.help("Wait until the transaction is confirmed at selected commitment level"),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.subcommand(
|
|
|
|
.subcommand(
|
|
|
|
SubCommand::with_name("live-slots")
|
|
|
|
SubCommand::with_name("live-slots")
|
|
|
@ -252,8 +245,7 @@ pub fn parse_cluster_ping(
|
|
|
|
None
|
|
|
|
None
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let timeout = Duration::from_secs(value_t_or_exit!(matches, "timeout", u64));
|
|
|
|
let timeout = Duration::from_secs(value_t_or_exit!(matches, "timeout", u64));
|
|
|
|
let commitment_config =
|
|
|
|
let commitment_config = commitment_of(matches, COMMITMENT_ARG.long).unwrap();
|
|
|
|
commitment_of(matches, COMMITMENT_ARG.long).unwrap_or_else(CommitmentConfig::recent);
|
|
|
|
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
command: CliCommand::Ping {
|
|
|
|
command: CliCommand::Ping {
|
|
|
|
lamports,
|
|
|
|
lamports,
|
|
|
@ -280,8 +272,7 @@ pub fn parse_get_block_time(matches: &ArgMatches<'_>) -> Result<CliCommandInfo,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn parse_get_epoch_info(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
pub fn parse_get_epoch_info(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
let commitment_config =
|
|
|
|
let commitment_config = commitment_of(matches, COMMITMENT_ARG.long).unwrap();
|
|
|
|
commitment_of(matches, COMMITMENT_ARG.long).unwrap_or_else(CommitmentConfig::recent);
|
|
|
|
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
command: CliCommand::GetEpochInfo { commitment_config },
|
|
|
|
command: CliCommand::GetEpochInfo { commitment_config },
|
|
|
|
signers: vec![],
|
|
|
|
signers: vec![],
|
|
|
@ -289,8 +280,7 @@ pub fn parse_get_epoch_info(matches: &ArgMatches<'_>) -> Result<CliCommandInfo,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn parse_get_slot(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
pub fn parse_get_slot(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
let commitment_config =
|
|
|
|
let commitment_config = commitment_of(matches, COMMITMENT_ARG.long).unwrap();
|
|
|
|
commitment_of(matches, COMMITMENT_ARG.long).unwrap_or_else(CommitmentConfig::recent);
|
|
|
|
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
command: CliCommand::GetSlot { commitment_config },
|
|
|
|
command: CliCommand::GetSlot { commitment_config },
|
|
|
|
signers: vec![],
|
|
|
|
signers: vec![],
|
|
|
@ -298,8 +288,7 @@ pub fn parse_get_slot(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliErr
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn parse_get_epoch(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
pub fn parse_get_epoch(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
let commitment_config =
|
|
|
|
let commitment_config = commitment_of(matches, COMMITMENT_ARG.long).unwrap();
|
|
|
|
commitment_of(matches, COMMITMENT_ARG.long).unwrap_or_else(CommitmentConfig::recent);
|
|
|
|
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
command: CliCommand::GetEpoch { commitment_config },
|
|
|
|
command: CliCommand::GetEpoch { commitment_config },
|
|
|
|
signers: vec![],
|
|
|
|
signers: vec![],
|
|
|
@ -307,8 +296,7 @@ pub fn parse_get_epoch(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliEr
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn parse_get_transaction_count(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
pub fn parse_get_transaction_count(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
let commitment_config =
|
|
|
|
let commitment_config = commitment_of(matches, COMMITMENT_ARG.long).unwrap();
|
|
|
|
commitment_of(matches, COMMITMENT_ARG.long).unwrap_or_else(CommitmentConfig::recent);
|
|
|
|
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
command: CliCommand::GetTransactionCount { commitment_config },
|
|
|
|
command: CliCommand::GetTransactionCount { commitment_config },
|
|
|
|
signers: vec![],
|
|
|
|
signers: vec![],
|
|
|
@ -334,8 +322,7 @@ pub fn parse_show_stakes(
|
|
|
|
|
|
|
|
|
|
|
|
pub fn parse_show_validators(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
pub fn parse_show_validators(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
|
|
|
let use_lamports_unit = matches.is_present("lamports");
|
|
|
|
let use_lamports_unit = matches.is_present("lamports");
|
|
|
|
let commitment_config =
|
|
|
|
let commitment_config = commitment_of(matches, COMMITMENT_ARG.long).unwrap();
|
|
|
|
commitment_of(matches, COMMITMENT_ARG.long).unwrap_or_else(CommitmentConfig::recent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
Ok(CliCommandInfo {
|
|
|
|
command: CliCommand::ShowValidators {
|
|
|
|
command: CliCommand::ShowValidators {
|
|
|
|