From c3b474aba33cb61736909fb04aa0fc177d82501a Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:19:32 -0700 Subject: [PATCH] Fix API endpoint --- leo/cli/commands/mod.rs | 6 +++++- leo/cli/commands/query/mod.rs | 10 +++++----- leo/cli/commands/remove.rs | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/leo/cli/commands/mod.rs b/leo/cli/commands/mod.rs index 9c17d20c3c..317fda611a 100644 --- a/leo/cli/commands/mod.rs +++ b/leo/cli/commands/mod.rs @@ -128,7 +128,11 @@ pub trait Command { /// require Build command output as their input. #[derive(Parser, Clone, Debug, Default)] 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 = "Does not recursively compile dependencies.")] pub non_recursive: bool, diff --git a/leo/cli/commands/query/mod.rs b/leo/cli/commands/query/mod.rs index f5030f378f..8b7de74eb2 100644 --- a/leo/cli/commands/query/mod.rs +++ b/leo/cli/commands/query/mod.rs @@ -49,11 +49,11 @@ 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 testnet3.", default_value = "testnet3")] + #[clap(short, long, global = true, help = "Network to use. Defaults to testnet.", default_value = "testnet")] pub(crate) network: String, #[clap(subcommand)] command: QueryCommands, @@ -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`." ); diff --git a/leo/cli/commands/remove.rs b/leo/cli/commands/remove.rs index 07170fc119..80a6c42e26 100644 --- a/leo/cli/commands/remove.rs +++ b/leo/cli/commands/remove.rs @@ -32,7 +32,7 @@ pub struct Remove { #[clap(short = 'l', long, help = "Path to local dependency")] pub(crate) local: Option, - #[clap(short = 'n', long, help = "Name of the network to use", default_value = "testnet3")] + #[clap(short = 'n', long, help = "Name of the network to use", default_value = "testnet")] pub(crate) network: String, #[clap(long, help = "Clear all previous dependencies.", default_value = "false")]