Nym connect use config from env (mainnet defaulted (#1471)

This commit is contained in:
Bogdan-Ștefan Neacşu
2022-07-21 17:03:14 +03:00
committed by GitHub
parent b901655591
commit 5a7b19aeb6
7 changed files with 13 additions and 7 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ pub(crate) async fn execute(args: &Cli) {
}
}
fn parse_validators(raw: &str) -> Vec<Url> {
pub fn parse_validators(raw: &str) -> Vec<Url> {
raw.split(',')
.map(|raw_validator| {
raw_validator
-1
View File
@@ -3199,7 +3199,6 @@ dependencies = [
"cosmwasm-std",
"fixed",
"log",
"network-defaults",
"schemars",
"serde",
"serde_repr",
+1 -1
View File
@@ -39,7 +39,7 @@ tokio = { version = "1.19.1", features = ["sync", "time"] }
url = "2.2"
client-core = { path = "../../clients/client-core" }
config = { path = "../../common/config" }
config-common = { path = "../../common/config", package = "config" }
nym-socks5-client = { path = "../../clients/socks5" }
topology = { path = "../../common/topology" }
+7 -2
View File
@@ -6,8 +6,8 @@ use tap::TapFallible;
use tokio::sync::RwLock;
use client_core::config::Config as BaseConfig;
use config::NymConfig;
use nym_socks5::client::config::Config as Socks5Config;
use config_common::NymConfig;
use nym_socks5::{client::config::Config as Socks5Config, commands::parse_validators};
use crate::{
error::{BackendError, Result},
@@ -134,6 +134,11 @@ pub async fn init_socks5_config(provider_address: String, chosen_gateway_id: Str
config
.get_base_mut()
.with_eth_private_key(DEFAULT_ETH_PRIVATE_KEY);
if let Ok(raw_validators) = std::env::var(config_common::defaults::var_names::API_VALIDATOR) {
config
.get_base_mut()
.set_custom_validator_apis(parse_validators(&raw_validators));
}
let gateway = setup_gateway(
&id,
+2
View File
@@ -5,6 +5,7 @@
use std::sync::Arc;
use config_common::defaults::setup_env;
use tauri::Menu;
use tokio::sync::RwLock;
@@ -24,6 +25,7 @@ mod window;
fn main() {
setup_logging();
setup_env(None);
println!("Starting up...");
// As per breaking change description here
+1 -1
View File
@@ -1,6 +1,6 @@
use std::time::Duration;
use ::config::NymConfig;
use ::config_common::NymConfig;
use futures::SinkExt;
use tap::TapFallible;
use tauri::Manager;
+1 -1
View File
@@ -4,7 +4,7 @@ use std::sync::Arc;
use tap::TapFallible;
use tokio::sync::RwLock;
use config::NymConfig;
use config_common::NymConfig;
#[cfg(not(feature = "coconut"))]
use nym_socks5::client::NymClient as Socks5NymClient;
use nym_socks5::client::{config::Config as Socks5Config, Socks5ControlMessageSender};