mithril_client_cli/commands/
mod.rspub mod cardano_db;
pub mod cardano_stake_distribution;
pub mod cardano_transaction;
mod deprecation;
pub mod mithril_stake_distribution;
pub use deprecation::{DeprecatedCommand, Deprecation};
use clap::Args;
use mithril_client::{ClientBuilder, MithrilResult};
use crate::configuration::ConfigParameters;
#[derive(Debug, Clone, Args)]
pub struct SharedArgs {
#[clap(long)]
json: bool,
}
pub(crate) fn client_builder(params: &ConfigParameters) -> MithrilResult<ClientBuilder> {
let builder = ClientBuilder::aggregator(
¶ms.require("aggregator_endpoint")?,
¶ms.require("genesis_verification_key")?,
);
Ok(builder)
}
pub(crate) fn client_builder_with_fallback_genesis_key(
params: &ConfigParameters,
) -> MithrilResult<ClientBuilder> {
let fallback_genesis_verification_key = "5b33322c3235332c3138362c3230312c3137372c31312c3131372c3133352c3138372c3136372c3138312c3138\
382c32322c35392c3230362c3130352c3233312c3135302c3231352c33302c37382c3231322c37362c31362c323\
5322c3138302c37322c3133342c3133372c3234372c3136312c36385d";
let builder = ClientBuilder::aggregator(
¶ms.require("aggregator_endpoint")?,
¶ms.get_or(
"genesis_verification_key",
fallback_genesis_verification_key,
),
);
Ok(builder)
}