cli: Print common cluster urls

This commit is contained in:
armaniferrante 2021-04-14 21:03:08 -07:00
parent 7fcb45e702
commit 218c2d25ce
No known key found for this signature in database
GPG Key ID: 58BEF301E91F7828
1 changed files with 21 additions and 0 deletions

View File

@ -123,6 +123,11 @@ pub enum Command {
#[clap(short, long)]
url: Option<String>,
},
/// Cluster commands.
Cluster {
#[clap(subcommand)]
subcmd: ClusterCommand,
},
}
#[derive(Debug, Clap)]
@ -197,6 +202,12 @@ pub enum IdlCommand {
},
}
#[derive(Debug, Clap)]
pub enum ClusterCommand {
/// Prints common cluster urls.
List,
}
fn main() -> Result<()> {
let opts = Opts::parse();
match opts.command {
@ -223,6 +234,7 @@ fn main() -> Result<()> {
} => test(skip_deploy, skip_local_validator, file),
#[cfg(feature = "dev")]
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));
}
}
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(())
}