Fix API endpoint

This commit is contained in:
Pranav Gaddamadugu 2024-06-07 10:19:32 -07:00 committed by evan-schott
parent c42485d89f
commit f5f186790b
2 changed files with 9 additions and 5 deletions

View File

@ -132,7 +132,11 @@ pub trait Command {
/// require Build command output as their input.
#[derive(Parser, Clone, Debug)]
pub struct BuildOptions {
#[clap(long, help = "Endpoint to retrieve network state from.", default_value = "http://api.explorer.aleo.org/v1")]
#[clap(
long,
help = "Endpoint to retrieve network state from.",
default_value = "https://api.explorer.aleo.org/v1"
)]
pub endpoint: String,
#[clap(long, help = "Network to broadcast to. Defaults to mainnet.", default_value = "mainnet")]
pub(crate) network: String,

View File

@ -49,8 +49,8 @@ pub struct Query {
short,
long,
global = true,
help = "Endpoint to retrieve network state from. Defaults to http://api.explorer.aleo.org/v1.",
default_value = "http://api.explorer.aleo.org/v1"
help = "Endpoint to retrieve network state from. Defaults to https://api.explorer.aleo.org/v1.",
default_value = "https://api.explorer.aleo.org/v1"
)]
pub endpoint: String,
#[clap(short, long, global = true, help = "Network to use. Defaults to mainnet.", default_value = "mainnet")]
@ -79,7 +79,7 @@ impl Command for Query {
QueryCommands::Stateroot { command } => command.apply(context, ())?,
QueryCommands::Committee { command } => command.apply(context, ())?,
QueryCommands::Mempool { command } => {
if self.endpoint == "http://api.explorer.aleo.org/v1" {
if self.endpoint == "https://api.explorer.aleo.org/v1" {
tracing::warn!(
"⚠️ `leo query mempool` is only valid when using a custom endpoint. Specify one using `--endpoint`."
);
@ -87,7 +87,7 @@ impl Command for Query {
command.apply(context, ())?
}
QueryCommands::Peers { command } => {
if self.endpoint == "http://api.explorer.aleo.org/v1" {
if self.endpoint == "https://api.explorer.aleo.org/v1" {
tracing::warn!(
"⚠️ `leo query peers` is only valid when using a custom endpoint. Specify one using `--endpoint`."
);