瀏覽代碼

cli, client, docs: Update solana endpoints (#365)

Tyera Eulberg 4 年之前
父節點
當前提交
f8909effad
共有 3 個文件被更改,包括 9 次插入15 次删除
  1. 3 3
      cli/src/main.rs
  2. 4 10
      client/src/cluster.rs
  3. 2 2
      docs/src/cli/commands.md

+ 3 - 3
cli/src/main.rs

@@ -1582,7 +1582,7 @@ fn set_workspace_dir_or_exit() {
 fn airdrop(cfg_override: &ConfigOverride) -> Result<()> {
     let url = cfg_override
         .cluster
-        .unwrap_or_else(|| "https://devnet.solana.com".to_string());
+        .unwrap_or_else(|| "https://api.devnet.solana.com".to_string());
     loop {
         let exit = std::process::Command::new("solana")
             .arg("airdrop")
@@ -1605,8 +1605,8 @@ 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");
+    println!("* Devnet  - https://api.devnet.solana.com");
+    println!("* Testnet - https://api.testnet.solana.com");
     Ok(())
 }
 

+ 4 - 10
client/src/cluster.rs

@@ -6,7 +6,6 @@ use std::str::FromStr;
 pub enum Cluster {
     Testnet,
     Mainnet,
-    VipMainnet,
     Devnet,
     Localnet,
     Debug,
@@ -25,7 +24,6 @@ impl FromStr for Cluster {
         match s.to_lowercase().as_str() {
             "t" | "testnet" => Ok(Cluster::Testnet),
             "m" | "mainnet" => Ok(Cluster::Mainnet),
-            "v" | "vipmainnet" => Ok(Cluster::VipMainnet),
             "d" | "devnet" => Ok(Cluster::Devnet),
             "l" | "localnet" => Ok(Cluster::Localnet),
             "g" | "debug" => Ok(Cluster::Debug),
@@ -41,7 +39,6 @@ impl std::fmt::Display for Cluster {
         let clust_str = match self {
             Cluster::Testnet => "testnet",
             Cluster::Mainnet => "mainnet",
-            Cluster::VipMainnet => "vipmainnet",
             Cluster::Devnet => "devnet",
             Cluster::Localnet => "localnet",
             Cluster::Debug => "debug",
@@ -54,10 +51,9 @@ impl std::fmt::Display for Cluster {
 impl Cluster {
     pub fn url(&self) -> &str {
         match self {
-            Cluster::Devnet => "https://devnet.solana.com",
-            Cluster::Testnet => "https://testnet.solana.com",
+            Cluster::Devnet => "https://api.devnet.solana.com",
+            Cluster::Testnet => "https://api.testnet.solana.com",
             Cluster::Mainnet => "https://api.mainnet-beta.solana.com",
-            Cluster::VipMainnet => "https://vip-api.mainnet-beta.solana.com",
             Cluster::Localnet => "http://127.0.0.1:8899",
             Cluster::Debug => "http://34.90.18.145:8899",
             Cluster::Custom(url, _ws_url) => url,
@@ -65,10 +61,9 @@ impl Cluster {
     }
     pub fn ws_url(&self) -> &str {
         match self {
-            Cluster::Devnet => "wss://devnet.solana.com",
-            Cluster::Testnet => "wss://testnet.solana.com",
+            Cluster::Devnet => "wss://api.devnet.solana.com",
+            Cluster::Testnet => "wss://api.testnet.solana.com",
             Cluster::Mainnet => "wss://api.mainnet-beta.solana.com",
-            Cluster::VipMainnet => "wss://vip-api.mainnet-beta.solana.com",
             Cluster::Localnet => "ws://127.0.0.1:9000",
             Cluster::Debug => "ws://34.90.18.145:9000",
             Cluster::Custom(_url, ws_url) => ws_url,
@@ -88,7 +83,6 @@ mod tests {
     fn test_cluster_parse() {
         test_cluster("testnet", Cluster::Testnet);
         test_cluster("mainnet", Cluster::Mainnet);
-        test_cluster("vipmainnet", Cluster::VipMainnet);
         test_cluster("devnet", Cluster::Devnet);
         test_cluster("localnet", Cluster::Localnet);
         test_cluster("debug", Cluster::Debug);

+ 2 - 2
docs/src/cli/commands.md

@@ -215,8 +215,8 @@ Cluster Endpoints:
 
 * Mainnet - https://solana-api.projectserum.com
 * Mainnet - https://api.mainnet-beta.solana.com
-* Devnet  - https://devnet.solana.com
-* Testnet - https://testnet.solana.com
+* Devnet  - https://api.devnet.solana.com
+* Testnet - https://api.testnet.solana.com
 ```
 
 ## Verify