Skip to content

Commit

Permalink
Fix API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
d0cd committed Jun 7, 2024
1 parent c1dae37 commit c3b474a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion leo/cli/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions leo/cli/commands/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -79,15 +79,15 @@ 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`."
);
}
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`."
);
Expand Down
2 changes: 1 addition & 1 deletion leo/cli/commands/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct Remove {
#[clap(short = 'l', long, help = "Path to local dependency")]
pub(crate) local: Option<PathBuf>,

#[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")]
Expand Down

0 comments on commit c3b474a

Please sign in to comment.