From bdd5c0c7767e02755015d647c175806fefb294a5 Mon Sep 17 00:00:00 2001 From: Byron Hambly Date: Wed, 1 Dec 2021 12:35:16 +0200 Subject: [PATCH] fix!: separate peer seeds to common.network --- .../tari_app_utilities/src/initialization.rs | 11 +-- .../tari_stratum_transcoder/src/main.rs | 2 +- common/config/presets/common.toml | 87 +++++++++++-------- common/config/presets/merge_mining_proxy.toml | 1 - common/src/configuration/global.rs | 80 +++++++++-------- common/src/configuration/utils.rs | 85 ++++++++++++++---- common/src/exit_codes.rs | 6 ++ 7 files changed, 172 insertions(+), 100 deletions(-) diff --git a/applications/tari_app_utilities/src/initialization.rs b/applications/tari_app_utilities/src/initialization.rs index 8d84ef4240..49e3b03ddd 100644 --- a/applications/tari_app_utilities/src/initialization.rs +++ b/applications/tari_app_utilities/src/initialization.rs @@ -31,8 +31,7 @@ pub fn init_configuration( log::info!(target: LOG_TARGET, "{} ({})", application_type, consts::APP_VERSION); // Populate the configuration struct - let mut global_config = GlobalConfig::convert_from(application_type, cfg.clone()) - .map_err(|err| ExitCodes::ConfigError(err.to_string()))?; + let mut global_config = GlobalConfig::convert_from(application_type, cfg.clone(), bootstrap.network.clone())?; if let Some(str) = bootstrap.network.clone() { log::info!(target: LOG_TARGET, "Network selection requested"); @@ -54,11 +53,9 @@ pub fn init_configuration( global_config.wallet_peer_db_path = global_config.data_dir.join("wallet_peer_db"); global_config.console_wallet_peer_db_path = global_config.data_dir.join("console_wallet_peer_db"); }, - Err(_) => { - log::warn!( - target: LOG_TARGET, - "Network selection was invalid, continuing with default network." - ); + Err(e) => { + log::error!(target: LOG_TARGET, "Network selection was invalid, exiting."); + return Err(e.into()); }, } } diff --git a/applications/tari_stratum_transcoder/src/main.rs b/applications/tari_stratum_transcoder/src/main.rs index 61e0da2d88..5c8b52c1fd 100644 --- a/applications/tari_stratum_transcoder/src/main.rs +++ b/applications/tari_stratum_transcoder/src/main.rs @@ -95,6 +95,6 @@ fn initialize() -> Result { #[cfg(not(feature = "envlog"))] bootstrap.initialize_logging()?; - let cfg = GlobalConfig::convert_from(application_type, cfg)?; + let cfg = GlobalConfig::convert_from(application_type, cfg, bootstrap.network)?; Ok(cfg) } diff --git a/common/config/presets/common.toml b/common/config/presets/common.toml index c114713bf7..e046132364 100644 --- a/common/config/presets/common.toml +++ b/common/config/presets/common.toml @@ -10,40 +10,6 @@ # weatherwax - the Tari testnet network = "weatherwax" -# When first logging onto the Tari network, you need to find a few peers to bootstrap the process. In the absence of -# any servers, this is a little more challenging than usual. Our best strategy is just to try and connect to the peers -# you knew about last time you ran the software. But what about when you run the software for the first time? That's -# where this allowlist comes in. It's a list of known Tari nodes that are likely to be around for a long time and that -# new nodes can use to introduce themselves to the network. -# peer_seeds = ["public_key1::address1", "public_key2::address2",... ] -peer_seeds = [ - # weatherwax - "98bc76afc1c35ad4651bdc9ef57bbe0655a2ea3cd86c0e19b5fd5890546eb040::/onion3/33izgtjkrlxhxybj6luqowkpiy2wvte43osejnbqyieqtdfhovzghxad:18141", #jozi - "9a26e910288213d649b26f9a7a7ee51fe2b2a67ff7d42334523463bf4be94312::/onion3/56kq54ylttnbl5ikotqex3oqvtzlxdpn7zlx4v56rvzf4kq7eezlclid:18141", #london - "6afd5b3c7772ad7d4bb26e0c19668fe04f2d68f99de9e132bee50a6c1846946d::/onion3/may4ajbmcn4dlnzf6fanvqlklxzqiw6qwu6ywqwkjc3bb354rc2i5wid:18141", #ncal - "8e7beec9becdc44fe6015a00d97a77fa3dbafe65127dcc988df6326bd9fd040d::/onion3/3pise36l4imoopsbjic5rtw67adx7rms6w5pgjmccpdwiqx66j7oqcqd:18141", #nvir - "80bb590d943a46e63ae79af5dc2c7d35a3dcd7922c182b28f619dc4cfc366f44::/onion3/oaxwahri7r3h5qjlcdbveyjmg4jsttausik66bicmhixft73nmvecdad:18141", #oregon - "981cc8cd1e4fe2f99ea1bd3e0ab1e7821ca0bfab336a4967cfec053fee86254c::/onion3/7hxpnxrxycdfevirddau7ybofwedaamjrg2ijm57k2kevh5q46ixamid:18141", #seoul - "f2ce179fb733725961a5f7e1e45dacdd443dd43ba6237438d6abe344fb717058::/onion3/nvgdmjf4wucgatz7vemzvi2u4sw5o4gyzwuikagpepoj4w7mkii47zid:18141", #stockholm - "909c0160f4d8e815aba5c2bbccfcceb448877e7b38759fb160f3e9494484d515::/onion3/qw5uxv533sqdn2qoncfyqo35dgecy4rt4x27rexi2her6q6pcpxbm4qd:18141", #sydney - # igor - "8e7eb81e512f3d6347bf9b1ca9cd67d2c8e29f2836fc5bd608206505cc72af34::/onion3/l4wouomx42nezhzexjdzfh7pcou5l7df24ggmwgekuih7tkv2rsaokqd:18141", - "00b35047a341401bcd336b2a3d564280a72f6dc72ec4c739d30c502acce4e803::/onion3/ojhxd7z6ga7qrvjlr3px66u7eiwasmffnuklscbh5o7g6wrbysj45vid:18141", - "40a9d8573745072534bce7d0ecafe882b1c79570375a69841c08a98dee9ecb5f::/onion3/io37fylc2pupg4cte4siqlsmuszkeythgjsxs2i3prm6jyz2dtophaad:18141", - "126c7ee64f71aca36398b977dd31fbbe9f9dad615df96473fb655bef5709c540::/onion3/6ilmgndocop7ybgmcvivbdsetzr5ggj4hhsivievoa2dx2b43wqlrlid:18141", -] - -# DNS seeds -# The DNS records in these hostnames should provide TXT records as per https://github.com/tari-project/tari/pull/2319 -# Enter a domain name for the TXT records: seeds.tari.com -dns_seeds =["seeds.weatherwax.tari.com"] -# The name server used to resolve DNS seeds format: {socket address}/{tls sni dns name} (Default: cloudflare) -# dns_seeds_name_server = "1.1.1.1:853/cloudfare-dns.com" -# Servers addresses, majority of them have to agree. -# autoupdate_dns_hosts = [#server1, #server2, ...] -# Set to true to only accept DNS records that pass DNSSEC validation (Default: true) -dns_seeds_use_dnssec = false - # Tari is a 100% peer-to-peer network, so there are no servers to hold messages for you while you're offline. # Instead, we rely on our peers to hold messages for us while we're offline. This settings sets maximum size of the # message cache that for holding our peers' messages, in MB. @@ -92,13 +58,60 @@ dedup_cache_capacity = 25000 # sessions. rpc_max_simultaneous_sessions = 10000 +[common.weatherwax] +# When first logging onto the Tari network, you need to find a few peers to bootstrap the process. In the absence of +# any servers, this is a little more challenging than usual. Our best strategy is just to try and connect to the peers +# you knew about last time you ran the software. But what about when you run the software for the first time? That's +# where this allowlist comes in. It's a list of known Tari nodes that are likely to be around for a long time and that +# new nodes can use to introduce themselves to the network. +# peer_seeds = ["public_key1::address1", "public_key2::address2",... ] +peer_seeds = [ + # weatherwax + "98bc76afc1c35ad4651bdc9ef57bbe0655a2ea3cd86c0e19b5fd5890546eb040::/onion3/33izgtjkrlxhxybj6luqowkpiy2wvte43osejnbqyieqtdfhovzghxad:18141", #jozi + "9a26e910288213d649b26f9a7a7ee51fe2b2a67ff7d42334523463bf4be94312::/onion3/56kq54ylttnbl5ikotqex3oqvtzlxdpn7zlx4v56rvzf4kq7eezlclid:18141", #london + "6afd5b3c7772ad7d4bb26e0c19668fe04f2d68f99de9e132bee50a6c1846946d::/onion3/may4ajbmcn4dlnzf6fanvqlklxzqiw6qwu6ywqwkjc3bb354rc2i5wid:18141", #ncal + "8e7beec9becdc44fe6015a00d97a77fa3dbafe65127dcc988df6326bd9fd040d::/onion3/3pise36l4imoopsbjic5rtw67adx7rms6w5pgjmccpdwiqx66j7oqcqd:18141", #nvir + "80bb590d943a46e63ae79af5dc2c7d35a3dcd7922c182b28f619dc4cfc366f44::/onion3/oaxwahri7r3h5qjlcdbveyjmg4jsttausik66bicmhixft73nmvecdad:18141", #oregon + "981cc8cd1e4fe2f99ea1bd3e0ab1e7821ca0bfab336a4967cfec053fee86254c::/onion3/7hxpnxrxycdfevirddau7ybofwedaamjrg2ijm57k2kevh5q46ixamid:18141", #seoul + "f2ce179fb733725961a5f7e1e45dacdd443dd43ba6237438d6abe344fb717058::/onion3/nvgdmjf4wucgatz7vemzvi2u4sw5o4gyzwuikagpepoj4w7mkii47zid:18141", #stockholm + "909c0160f4d8e815aba5c2bbccfcceb448877e7b38759fb160f3e9494484d515::/onion3/qw5uxv533sqdn2qoncfyqo35dgecy4rt4x27rexi2her6q6pcpxbm4qd:18141", #sydney +] + +# DNS seeds +# The DNS records in these hostnames should provide TXT records as per https://github.com/tari-project/tari/pull/2319 +# Enter a domain name for the TXT records: +dns_seeds =["seeds.weatherwax.tari.com"] +# The name server used to resolve DNS seeds format: {socket address}/{tls sni dns name} (Default: cloudflare) +# dns_seeds_name_server = "1.1.1.1:853/cloudfare-dns.com" +# Servers addresses, majority of them have to agree. +# autoupdate_dns_hosts = [#server1, #server2, ...] +# Set to true to only accept DNS records that pass DNSSEC validation (Default: true) +dns_seeds_use_dnssec = false + # Auto Update # # This interval in seconds to check for software updates. Setting this to 0 disables checking. # auto_update.check_interval = 300 # Customize the hosts that are used to check for updates. These hosts must contain update information in DNS TXT records. -# auto_update.dns_hosts = ["updates.taripulse.com"] +# "auto_update.dns_hosts" = ["updates.weatherwax.taripulse.com"] # Customize the location of the update SHA hashes and maintainer-signed signature. -# auto_update.hashes_url = "https://
/hashes.txt" -# auto_update.hashes_sig_url = "https://
/hashes.txt.sig" +# "auto_update.hashes_url" = "https://
/hashes.txt" +# "auto_update.hashes_sig_url" = "https://
/hashes.txt.sig" + +[common.igor] +peer_seeds = [ + # igor + "8e7eb81e512f3d6347bf9b1ca9cd67d2c8e29f2836fc5bd608206505cc72af34::/onion3/l4wouomx42nezhzexjdzfh7pcou5l7df24ggmwgekuih7tkv2rsaokqd:18141", + "00b35047a341401bcd336b2a3d564280a72f6dc72ec4c739d30c502acce4e803::/onion3/ojhxd7z6ga7qrvjlr3px66u7eiwasmffnuklscbh5o7g6wrbysj45vid:18141", + "40a9d8573745072534bce7d0ecafe882b1c79570375a69841c08a98dee9ecb5f::/onion3/io37fylc2pupg4cte4siqlsmuszkeythgjsxs2i3prm6jyz2dtophaad:18141", + "126c7ee64f71aca36398b977dd31fbbe9f9dad615df96473fb655bef5709c540::/onion3/6ilmgndocop7ybgmcvivbdsetzr5ggj4hhsivievoa2dx2b43wqlrlid:18141", +] +dns_seeds =["seeds.igor.tari.com"] +# dns_seeds_name_server = "1.1.1.1:853/cloudfare-dns.com" +dns_seeds_use_dnssec = false + +# auto_update.check_interval = 300 +# "auto_update.dns_hosts" = ["updates.igor.taripulse.com"] +# "auto_update.hashes_url" = "https://
/hashes.txt" +# "auto_update.hashes_sig_url" = "https://
/hashes.txt.sig" \ No newline at end of file diff --git a/common/config/presets/merge_mining_proxy.toml b/common/config/presets/merge_mining_proxy.toml index 2a9d93a11c..ffc10048b8 100644 --- a/common/config/presets/merge_mining_proxy.toml +++ b/common/config/presets/merge_mining_proxy.toml @@ -34,4 +34,3 @@ monerod_password = "" # or not. If merge mining starts before the base node has achieved initial sync, those Tari mined blocks will not be # accepted. (Default value = true; will wait for base node initial sync). #wait_for_initial_sync_at_startup = true - diff --git a/common/src/configuration/global.rs b/common/src/configuration/global.rs index 51bee7b6c3..c497dd05a8 100644 --- a/common/src/configuration/global.rs +++ b/common/src/configuration/global.rs @@ -145,27 +145,37 @@ pub struct GlobalConfig { } impl GlobalConfig { - pub fn convert_from(application: ApplicationType, mut cfg: Config) -> Result { + pub fn convert_from( + application: ApplicationType, + mut cfg: Config, + network: Option, + ) -> Result { // Add in settings from the environment (with a prefix of TARI_NODE) // Eg.. `TARI_NODE_DEBUG=1 ./target/app` would set the `debug` key let env = Environment::with_prefix("tari").separator("__"); cfg.merge(env) .map_err(|e| ConfigurationError::new("environment variable", &e.to_string()))?; - let network = one_of::(&cfg, &[ - &format!("{}.network", application.as_config_str()), - "common.network", - // TODO: Remove this once some time has passed and folks have upgraded their configs - "base_node.network", - ])?; - - convert_node_config(application, network, cfg) + + // network override from command line + let network = match network { + Some(s) => Network::from_str(&s)?, + None => { + // otherwise specified from config + one_of::(&cfg, &[ + "common.network", + &format!("{}.network", application.as_config_str()), + ])? + }, + }; + + convert_node_config(application, cfg, network) } } fn convert_node_config( application: ApplicationType, - network: Network, cfg: Config, + network: Network, ) -> Result { let net_str = network.as_str(); @@ -353,38 +363,35 @@ fn convert_node_config( .map(|addr| socket_or_multi(&addr).map_err(|e| ConfigurationError::new(key, &e.to_string())))??; // Peer and DNS seeds - let key = "common.peer_seeds"; + let key = config_string("common", net_str, "peer_seeds"); // Peer seeds can be an array or a comma separated list (e.g. in an ENVVAR) - let peer_seeds = match cfg.get_array(key) { + let peer_seeds = match cfg.get_array(&key) { Ok(seeds) => seeds.into_iter().map(|v| v.into_str().unwrap()).collect(), - Err(..) => optional(cfg.get_str(key))? + Err(..) => optional(cfg.get_str(&key))? .map(|s| s.split(',').map(|v| v.trim().to_string()).collect()) .unwrap_or_default(), }; // TODO: dns resolver presets e.g. "cloudflare", "quad9", "custom" (maybe just in toml) and // add support for multiple addresses - let key = "common.dns_seeds_name_server"; + let key = config_string("common", net_str, "dns_seeds_name_server"); let dns_seeds_name_server = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, &e.to_string())) + .get_str(&key) + .map_err(|e| ConfigurationError::new(&key, &e.to_string())) .and_then(|s| { s.parse::() - .map_err(|e| ConfigurationError::new(key, &e.to_string())) + .map_err(|e| ConfigurationError::new(&key, &e.to_string())) })?; - let key = config_string("base_node", net_str, "bypass_range_proof_verification"); - let base_node_bypass_range_proof_verification = cfg.get_bool(&key).unwrap_or(false); - - let key = "common.dns_seeds_use_dnssec"; + let key = config_string("common", net_str, "dns_seeds_use_dnssec"); let dns_seeds_use_dnssec = cfg - .get_bool(key) - .map_err(|e| ConfigurationError::new(key, &e.to_string()))?; + .get_bool(&key) + .map_err(|e| ConfigurationError::new(&key, &e.to_string()))?; - let key = "common.dns_seeds"; - let dns_seeds = match cfg.get_array(key) { + let key = config_string("common", net_str, "dns_seeds"); + let dns_seeds = match cfg.get_array(&key) { Ok(seeds) => seeds.into_iter().map(|v| v.into_str().unwrap()).collect(), - Err(..) => optional(cfg.get_str(key))? + Err(..) => optional(cfg.get_str(&key))? .map(|s| { s.split(',') .map(|v| v.trim().to_string()) @@ -394,6 +401,9 @@ fn convert_node_config( .unwrap_or_default(), }; + let key = config_string("base_node", net_str, "bypass_range_proof_verification"); + let base_node_bypass_range_proof_verification = cfg.get_bool(&key).unwrap_or(false); + // Peer DB path let peer_db_path = data_dir.join("peer_db"); let wallet_peer_db_path = data_dir.join("wallet_peer_db"); @@ -668,8 +678,8 @@ fn convert_node_config( let validate_tip_timeout_sec = optional(cfg.get_int(key))?.unwrap_or(0) as u64; // Auto update - let key = "common.auto_update.check_interval"; - let autoupdate_check_interval = optional(cfg.get_int(key))?.and_then(|secs| { + let key = config_string("common", net_str, "auto_update.check_interval"); + let autoupdate_check_interval = optional(cfg.get_int(&key))?.and_then(|secs| { if secs > 0 { Some(Duration::from_secs(secs as u64)) } else { @@ -677,20 +687,20 @@ fn convert_node_config( } }); - let key = "common.auto_update.dns_hosts"; + let key = config_string("common", net_str, "auto_update.dns_hosts"); let autoupdate_dns_hosts = cfg - .get_array(key) + .get_array(&key) .and_then(|arr| arr.into_iter().map(|s| s.into_str()).collect::, _>>()) .or_else(|_| { - cfg.get_str(key) + cfg.get_str(&key) .map(|s| s.split(',').map(ToString::to_string).collect()) })?; - let key = "common.auto_update.hashes_url"; - let autoupdate_hashes_url = cfg.get_str(key)?; + let key = config_string("common", net_str, "auto_update.hashes_url"); + let autoupdate_hashes_url = cfg.get_str(&key)?; - let key = "common.auto_update.hashes_sig_url"; - let autoupdate_hashes_sig_url = cfg.get_str(key)?; + let key = config_string("common", net_str, "auto_update.hashes_sig_url"); + let autoupdate_hashes_sig_url = cfg.get_str(&key)?; let key = "mining_node.mining_pool_address"; let mining_pool_address = cfg.get_str(key).unwrap_or_else(|_| "".to_string()); diff --git a/common/src/configuration/utils.rs b/common/src/configuration/utils.rs index db72daa146..04d6770f7c 100644 --- a/common/src/configuration/utils.rs +++ b/common/src/configuration/utils.rs @@ -81,25 +81,6 @@ pub fn default_config(bootstrap: &ConfigBootstrap) -> Config { cfg.set_default("common.fetch_utxos_timeout", 600).unwrap(); cfg.set_default("common.service_request_timeout", 180).unwrap(); - cfg.set_default("common.auto_update.dns_hosts", vec!["versions.tari.com"]) - .unwrap(); - // TODO: Change to a more permanent link - cfg.set_default( - "common.auto_update.hashes_url", - "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt", - ) - .unwrap(); - cfg.set_default( - "common.auto_update.hashes_sig_url", - "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt.sig", - ) - .unwrap(); - cfg.set_default("common.peer_seeds", Vec::::new()).unwrap(); - cfg.set_default("common.dns_seeds", Vec::::new()).unwrap(); - cfg.set_default("common.dns_seeds_name_server", "1.1.1.1:853/cloudflare-dns.com") - .unwrap(); - cfg.set_default("common.dns_seeds_use_dnssec", true).unwrap(); - // Wallet settings cfg.set_default("wallet.grpc_enabled", false).unwrap(); cfg.set_default("wallet.grpc_address", "127.0.0.1:18040").unwrap(); @@ -179,6 +160,26 @@ pub fn default_config(bootstrap: &ConfigBootstrap) -> Config { cfg.set_default("base_node.mainnet.flood_ban_max_msg_count", 10000) .unwrap(); + cfg.set_default("common.mainnet.peer_seeds", Vec::::new()) + .unwrap(); + cfg.set_default("common.mainnet.dns_seeds", Vec::::new()) + .unwrap(); + cfg.set_default("common.mainnet.dns_seeds_name_server", "1.1.1.1:853/cloudflare-dns.com") + .unwrap(); + cfg.set_default("common.mainnet.dns_seeds_use_dnssec", true).unwrap(); + cfg.set_default("common.mainnet.auto_update.dns_hosts", vec!["versions.tari.com"]) + .unwrap(); + cfg.set_default( + "common.mainnet.auto_update.hashes_url", + "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt", + ) + .unwrap(); + cfg.set_default( + "common.mainnet.auto_update.hashes_sig_url", + "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt.sig", + ) + .unwrap(); + //---------------------------------- Weatherwax Defaults --------------------------------------------// cfg.set_default("base_node.weatherwax.db_type", "lmdb").unwrap(); @@ -235,6 +236,29 @@ pub fn default_config(bootstrap: &ConfigBootstrap) -> Config { cfg.set_default("wallet.base_node_service_peers", Vec::::new()) .unwrap(); + + cfg.set_default("common.weatherwax.peer_seeds", Vec::::new()) + .unwrap(); + cfg.set_default("common.weatherwax.dns_seeds", Vec::::new()) + .unwrap(); + cfg.set_default( + "common.weatherwax.dns_seeds_name_server", + "1.1.1.1:853/cloudflare-dns.com", + ) + .unwrap(); + cfg.set_default("common.weatherwax.dns_seeds_use_dnssec", true).unwrap(); + cfg.set_default("common.weatherwax.auto_update.dns_hosts", vec!["versions.tari.com"]) + .unwrap(); + cfg.set_default( + "common.weatherwax.auto_update.hashes_url", + "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt", + ) + .unwrap(); + cfg.set_default( + "common.weatherwax.auto_update.hashes_sig_url", + "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt.sig", + ) + .unwrap(); //---------------------------------- Igor Defaults --------------------------------------------// cfg.set_default("base_node.igor.db_type", "lmdb").unwrap(); @@ -253,6 +277,24 @@ pub fn default_config(bootstrap: &ConfigBootstrap) -> Config { cfg.set_default("base_node.igor.dns_seeds_use_dnssec", true).unwrap(); cfg.set_default("base_node.igor.auto_ping_interval", 30).unwrap(); + cfg.set_default("common.igor.peer_seeds", Vec::::new()).unwrap(); + cfg.set_default("common.igor.dns_seeds", Vec::::new()).unwrap(); + cfg.set_default("common.igor.dns_seeds_name_server", "1.1.1.1:853/cloudflare-dns.com") + .unwrap(); + cfg.set_default("common.igor.dns_seeds_use_dnssec", true).unwrap(); + cfg.set_default("common.igor.auto_update.dns_hosts", vec!["versions.tari.com"]) + .unwrap(); + cfg.set_default( + "common.igor.auto_update.hashes_url", + "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt", + ) + .unwrap(); + cfg.set_default( + "common.igor.auto_update.hashes_sig_url", + "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt.sig", + ) + .unwrap(); + set_transport_defaults(&mut cfg).unwrap(); set_merge_mining_defaults(&mut cfg); set_mining_node_defaults(&mut cfg); @@ -306,6 +348,11 @@ fn set_merge_mining_defaults(cfg: &mut Config) { .unwrap(); cfg.set_default("merge_mining_proxy.weatherwax.wait_for_initial_sync_at_startup", true) .unwrap(); + cfg.set_default( + "merge_mining_proxy.igor.monerod_url", + "http://monero-stagenet.exan.tech:38081", + ) + .unwrap(); cfg.set_default("merge_mining_proxy.igor.proxy_host_address", "127.0.0.1:7878") .unwrap(); cfg.set_default("merge_mining_proxy.igor.proxy_submit_to_origin", true) diff --git a/common/src/exit_codes.rs b/common/src/exit_codes.rs index ffd4790406..7ab4a9ca9d 100644 --- a/common/src/exit_codes.rs +++ b/common/src/exit_codes.rs @@ -86,6 +86,12 @@ impl From for ExitCodes { } } +impl From for ExitCodes { + fn from(err: crate::ConfigurationError) -> Self { + Self::ConfigError(err.to_string()) + } +} + impl ExitCodes { pub fn grpc(err: M) -> Self { ExitCodes::GrpcError(format!("GRPC connection error: {}", err))