cli: Print common cluster urls
This commit is contained in:
parent
7fcb45e702
commit
218c2d25ce
|
@ -123,6 +123,11 @@ pub enum Command {
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
url: Option<String>,
|
url: Option<String>,
|
||||||
},
|
},
|
||||||
|
/// Cluster commands.
|
||||||
|
Cluster {
|
||||||
|
#[clap(subcommand)]
|
||||||
|
subcmd: ClusterCommand,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clap)]
|
#[derive(Debug, Clap)]
|
||||||
|
@ -197,6 +202,12 @@ pub enum IdlCommand {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clap)]
|
||||||
|
pub enum ClusterCommand {
|
||||||
|
/// Prints common cluster urls.
|
||||||
|
List,
|
||||||
|
}
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let opts = Opts::parse();
|
let opts = Opts::parse();
|
||||||
match opts.command {
|
match opts.command {
|
||||||
|
@ -223,6 +234,7 @@ fn main() -> Result<()> {
|
||||||
} => test(skip_deploy, skip_local_validator, file),
|
} => test(skip_deploy, skip_local_validator, file),
|
||||||
#[cfg(feature = "dev")]
|
#[cfg(feature = "dev")]
|
||||||
Command::Airdrop { url } => airdrop(url),
|
Command::Airdrop { url } => airdrop(url),
|
||||||
|
Command::Cluster { subcmd } => cluster(subcmd),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1493,3 +1505,12 @@ fn airdrop(url: Option<String>) -> Result<()> {
|
||||||
std::thread::sleep(std::time::Duration::from_millis(10000));
|
std::thread::sleep(std::time::Duration::from_millis(10000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn cluster(_cmd: ClusterCommand) -> Result<()> {
|
||||||
|
println!("Cluster Endpoints:\n");
|
||||||
|
println!("* Mainnet - https://solana-api.projectserum.com");
|
||||||
|
println!("* Mainnet - https://api.mainnet-beta.solana.com");
|
||||||
|
println!("* Devnet - https://devnet.solana.com");
|
||||||
|
println!("* Testnet - https://testnet.solana.com");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue