Skip to content

Commit

Permalink
chore(rpc): Fix default rpc, to use api domain
Browse files Browse the repository at this point in the history
  • Loading branch information
vldm committed Sep 15, 2021
1 parent 7be5209 commit ed98acd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions clap-utils/src/input_validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ where

pub fn normalize_to_url_if_moniker<T: AsRef<str>>(url_or_moniker: T) -> String {
match url_or_moniker.as_ref() {
"m" | "mainnet-beta" => "https://mainnet.velas.com/rpc",
"t" | "testnet" => "https://testnet.velas.com/rpc",
"d" | "devnet" => "https://devnet.velas.com/rpc",
"m" | "mainnet" => "https://api.mainnet.velas.com",
"t" | "testnet" => "https://api.testnet.velas.com",
"d" | "devnet" => "https://api.devnet.velas.com",
"l" | "localhost" => "http://localhost:8899",
url => url,
}
Expand Down
10 changes: 5 additions & 5 deletions cli-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl Default for Config {
keypair_path.extend(&[".config", "velas", "id.json"]);
keypair_path.to_str().unwrap().to_string()
};
let json_rpc_url = "https://mainnet.velas.com/rpc".to_string();
let json_rpc_url = "https://api.mainnet.velas.com".to_string();

// Empty websocket_url string indicates the client should
// `Config::compute_websocket_url(&json_rpc_url)`
Expand Down Expand Up @@ -107,13 +107,13 @@ mod test {
#[test]
fn compute_websocket_url() {
assert_eq!(
Config::compute_websocket_url("http://devnet.velas.com/rpc"),
"ws://devnet.velas.com/rpc".to_string()
Config::compute_websocket_url("http://api.devnet.velas.com"),
"ws://api.devnet.velas.com/".to_string()
);

assert_eq!(
Config::compute_websocket_url("https://devnet.velas.com"),
"wss://devnet.velas.com/".to_string()
Config::compute_websocket_url("https://api.devnet.velas.com"),
"wss://api.devnet.velas.com/".to_string()
);

assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion install/src/defaults.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const JSON_RPC_URL: &str = "http://devnet.velas.com/rpc";
pub const JSON_RPC_URL: &str = "http://api.devnet.velas.com";

/// Returns last 30 releases from GitHub Release REST API, could be
/// increased up to 100 (?per_page=100). If we need a list with more
Expand Down
2 changes: 1 addition & 1 deletion stake-accounts/src/arg_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ where
.global(true)
.takes_value(true)
.value_name("URL")
.help("RPC entrypoint address. i.e. https://devnet.velas.com/rpc"),
.help("RPC entrypoint address. i.e. https://api.devnet.velas.com"),
)
.subcommand(
SubCommand::with_name("new")
Expand Down
6 changes: 3 additions & 3 deletions stake-o-matic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,14 @@ fn get_config() -> Config {
let min_release_version = release_version_of(&matches, "min_release_version");

let (json_rpc_url, validator_list) = match cluster.as_str() {
"mainnet-beta" => (
"mainnet" => (
value_t!(matches, "json_rpc_url", String)
.unwrap_or_else(|_| "https://mainnet.velas.com/rpc".into()),
.unwrap_or_else(|_| "https://api.mainnet.velas.com".into()),
validator_list::mainnet_beta_validators(),
),
"testnet" => (
value_t!(matches, "json_rpc_url", String)
.unwrap_or_else(|_| "https://testnet.velas.com/rpc".into()),
.unwrap_or_else(|_| "https://api.testnet.velas.com".into()),
validator_list::testnet_validators(),
),
"unknown" => {
Expand Down
2 changes: 1 addition & 1 deletion tokens/src/arg_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ where
.global(true)
.takes_value(true)
.value_name("URL")
.help("RPC entrypoint address. i.e. https://devnet.velas.com/rpc"),
.help("RPC entrypoint address. i.e. https://api.devnet.velas.com"),
)
.subcommand(
SubCommand::with_name("distribute-tokens")
Expand Down

0 comments on commit ed98acd

Please sign in to comment.