From 6bf80575b15c13e75c77070e05edb20872ab3f9e Mon Sep 17 00:00:00 2001 From: Hansie Odendaal Date: Wed, 2 Feb 2022 14:33:54 +0200 Subject: [PATCH] Fix merge mining proxy pool mining Fixed merge mining proxy pool mining: - config file was not read correctly; - global config exited prematurely ; - round robin for monerod_url - start at the next entry in the list when encountering connection errors instead of always starting at the beginning; - updated cucumber integration test. --- .../tari_merge_mining_proxy/src/main.rs | 2 + .../tari_merge_mining_proxy/src/proxy.rs | 99 ++++++++++++++--- common/config/presets/merge_mining_proxy.toml | 67 ++++++------ common/src/configuration/global.rs | 103 ++++++++---------- .../src/configuration/merge_mining_config.rs | 6 +- common/src/configuration/utils.rs | 60 ++++------ integration_tests/helpers/baseNodeProcess.js | 2 +- integration_tests/helpers/config.js | 12 +- .../helpers/mergeMiningProxyProcess.js | 5 +- .../helpers/miningNodeProcess.js | 2 +- .../helpers/stratumTranscoderProcess.js | 2 +- .../helpers/validatorNodeProcess.js | 2 +- integration_tests/helpers/walletProcess.js | 2 +- integration_tests/package-lock.json | 56 +++++----- 14 files changed, 234 insertions(+), 186 deletions(-) diff --git a/applications/tari_merge_mining_proxy/src/main.rs b/applications/tari_merge_mining_proxy/src/main.rs index 2413d648cd..462c4416e4 100644 --- a/applications/tari_merge_mining_proxy/src/main.rs +++ b/applications/tari_merge_mining_proxy/src/main.rs @@ -60,6 +60,8 @@ async fn main() -> Result<(), anyhow::Error> { return Ok(()); }, }; + println!("\n{}\n", config); + let addr = config.proxy_host_address; let client = reqwest::Client::builder() .connect_timeout(Duration::from_secs(5)) diff --git a/applications/tari_merge_mining_proxy/src/proxy.rs b/applications/tari_merge_mining_proxy/src/proxy.rs index 81135b0bd4..88ffb3588b 100644 --- a/applications/tari_merge_mining_proxy/src/proxy.rs +++ b/applications/tari_merge_mining_proxy/src/proxy.rs @@ -23,6 +23,7 @@ use std::{ cmp, convert::TryFrom, + fmt::{Display, Error, Formatter}, future::Future, net::SocketAddr, pin::Pin, @@ -82,6 +83,8 @@ impl TryFrom for MergeMiningProxyConfig { let merge_mining_config = config .merge_mining_config .ok_or_else(|| "Merge mining config settings are missing".to_string())?; + let proxy_host_address = multiaddr_to_socketaddr(&merge_mining_config.proxy_host_address) + .map_err(|e| format!("Invalid proxy_host_address: {}", e))?; let grpc_base_node_address = multiaddr_to_socketaddr(&merge_mining_config.base_node_grpc_address) .map_err(|e| format!("Invalid base_node_grpc_address: {}", e))?; let grpc_console_wallet_address = multiaddr_to_socketaddr(&merge_mining_config.wallet_grpc_address) @@ -94,13 +97,35 @@ impl TryFrom for MergeMiningProxyConfig { monerod_use_auth: merge_mining_config.monerod_use_auth, grpc_base_node_address, grpc_console_wallet_address, - proxy_host_address: merge_mining_config.proxy_host_address, - proxy_submit_to_origin: config.proxy_submit_to_origin, - wait_for_initial_sync_at_startup: config.wait_for_initial_sync_at_startup, + proxy_host_address, + proxy_submit_to_origin: merge_mining_config.proxy_submit_to_origin, + wait_for_initial_sync_at_startup: merge_mining_config.wait_for_initial_sync_at_startup, }) } } +impl Display for MergeMiningProxyConfig { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + writeln!( + f, + "Configuration:\n network ({})\n proxy_host_address ({})\n grpc_base_node_address ({})\n \ + grpc_console_wallet_address ({})\n proxy_submit_to_origin ({})\n wait_for_initial_sync_at_startup \ + ({})\n monerod_url ({:?})\n monerod_password ({})\n monerod_username ({})\n monerod_use_auth ({})", + self.network, + self.proxy_host_address, + self.grpc_base_node_address, + self.grpc_console_wallet_address, + self.proxy_submit_to_origin, + self.wait_for_initial_sync_at_startup, + self.monerod_url, + self.monerod_password, + self.monerod_username, + self.monerod_use_auth + )?; + Ok(()) + } +} + #[derive(Debug, Clone)] pub struct MergeMiningProxyService { inner: InnerService, @@ -114,6 +139,7 @@ impl MergeMiningProxyService { wallet_client: grpc::wallet_client::WalletClient, block_templates: BlockTemplateRepository, ) -> Self { + debug!(target: LOG_TARGET, "Config: {:?}", config); Self { inner: InnerService { config, @@ -305,6 +331,12 @@ impl InnerService { if !self.config.proxy_submit_to_origin { // self-select related, do not change. json_resp = json_rpc::default_block_accept_response(request["id"].as_i64()); + trace!( + target: LOG_TARGET, + "pool merged mining proxy_submit_to_origin({}) json_resp: {}", + self.config.proxy_submit_to_origin, + json_resp + ); } else { json_resp = json_rpc::success_response( request["id"].as_i64(), @@ -348,7 +380,12 @@ impl InnerService { self.block_templates.remove_outdated().await; } - debug!(target: LOG_TARGET, "Sending submit_block response {}", json_resp); + debug!( + target: LOG_TARGET, + "Sending submit_block response (proxy_submit_to_origin({})): {}", + self.config.proxy_submit_to_origin, + json_resp + ); Ok(proxy::into_response(parts, &json_resp)) } @@ -605,20 +642,41 @@ impl InnerService { } } - for monerod_url in self.config.monerod_url.iter() { - let uri = format!("{}{}", monerod_url, uri.path()).parse::()?; - match reqwest::get(uri.clone()).await { - Ok(_) => { - let mut lock = self.last_available_server.write().expect("Write lock should not fail"); - *lock = Some(monerod_url.to_string()); - info!(target: LOG_TARGET, "Monerod server available: {:?}", uri.clone()); - return Ok(uri); - }, - Err(_) => { - warn!(target: LOG_TARGET, "Monerod server unavailable: {:?}", uri); - continue; - }, + let current_url = { + let lock = self + .last_available_server + .read() + .expect("Read lock should not fail") + .clone(); + match lock { + Some(url) => url, + None => "".to_string(), } + }; + let mut iter = self.config.monerod_url.iter(); + let _ = iter.find(|&x| x == ¤t_url); + let mut count = 0; + loop { + count += 1; + if count > self.config.monerod_url.len() * 2 { + break; + } + if let Some(next_url) = iter.next() { + let uri = format!("{}{}", next_url, uri.path()).parse::()?; + match reqwest::get(uri.clone()).await { + Ok(_) => { + let mut lock = self.last_available_server.write().expect("Write lock should not fail"); + *lock = Some(next_url.to_string()); + info!(target: LOG_TARGET, "Monerod server available: {:?}", uri.clone()); + return Ok(uri); + }, + Err(_) => { + warn!(target: LOG_TARGET, "Monerod server unavailable: {:?}", uri); + }, + } + } else { + iter = self.config.monerod_url.iter(); + }; } Err(MmProxyError::ServersUnavailable) @@ -666,12 +724,19 @@ impl InnerService { let body: Bytes = request.body().clone(); let json = json::from_slice::(&body[..]).unwrap_or_default(); if let Some(method) = json["method"].as_str() { + trace!(target: LOG_TARGET, "json[\"method\"]: {}", method); match method { "submitblock" | "submit_block" => { submit_block = true; }, _ => {}, } + trace!( + target: LOG_TARGET, + "submitblock({}), proxy_submit_to_origin({})", + submit_block, + self.config.proxy_submit_to_origin + ); } let json_response; diff --git a/common/config/presets/merge_mining_proxy.toml b/common/config/presets/merge_mining_proxy.toml index 0ea4082c86..80ef01e3e8 100644 --- a/common/config/presets/merge_mining_proxy.toml +++ b/common/config/presets/merge_mining_proxy.toml @@ -4,47 +4,52 @@ # # ######################################################################################################################## -[merge_mining_proxy.dibbler] +[merge_mining_proxy] -# URL to monerod -monerod_url = [ # stagenet - "http://stagenet.xmr-tw.org:38081", - "http://stagenet.community.xmr.to:38081", - "http://monero-stagenet.exan.tech:38081", - "http://xmr-lux.boldsuck.org:38081", - "http://singapore.node.xmr.pm:38081", -] -#monerod_url = [ # mainnet -# "http://18.132.124.81:18081", -# "http://xmr.support:18081", -# "http://node1.xmr-tw.org:18081", -# "http://xmr.nthrow.nyc:18081", -#] +# Address of the tari_merge_mining_proxy application. (default = "127.0.0.1:7878") +#proxy_host_address = "/ip4/127.0.0.1/tcp/7878" + +# GRPC address of base node. (default = "/ip4/127.0.0.1/tcp/18142") +#base_node_grpc_address = "/ip4/127.0.0.1/tcp/18142" -# Address of the tari_merge_mining_proxy application -proxy_host_address = "127.0.0.1:7878" +# GRPC address of console wallet. (default = "/ip4/127.0.0.1/tcp/18143") +#wallet_grpc_address = "/ip4/127.0.0.1/tcp/18143" # In sole merged mining, the block solution is usually submitted to the Monero blockchain # (monerod) as well as to the Tari blockchain, then this setting should be "true". With pool # merged mining, there is no sense in submitting the solution to the Monero blockchain as the # pool does that, then this setting should be "false". (default = true). -proxy_submit_to_origin = true - -# If authentication is being used for curl -monerod_use_auth = false - -# Username for curl -monerod_username = "" - -# Password for curl -monerod_password = "" +#proxy_submit_to_origin = true # The merge mining proxy can either wait for the base node to achieve initial sync at startup before it enables mining, # 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 -[merge_mining_proxy] -monerod_use_auth = false -monerod_username = "" -monerod_password = "" +[merge_mining_proxy.dibbler] + +# URL to monerod (default = stagenet) +#monerod_url = [ # stagenet +# "http://stagenet.xmr-tw.org:38081", +# "http://stagenet.community.xmr.to:38081", +# "http://monero-stagenet.exan.tech:38081", +# "http://xmr-lux.boldsuck.org:38081", +# "http://singapore.node.xmr.pm:38081", +#] +#monerod_url = [ # mainnet +# "http://xmr.support:18081", +# "http://node1.xmr-tw.org:18081", +# "http://xmr.nthrow.nyc:18081", +# "http://node.xmrig.com:18081", +# "http://monero.exan.tech:18081", +# "http://18.132.124.81:18081", +#] + +# If authentication is being used for curl. (default = false). +#monerod_use_auth = false + +# Username for curl. (default = ""). +#monerod_username = "" + +# Password for curl. (default = ""). +#monerod_password = "" diff --git a/common/src/configuration/global.rs b/common/src/configuration/global.rs index 545ceb83e6..ef683c5b4f 100644 --- a/common/src/configuration/global.rs +++ b/common/src/configuration/global.rs @@ -129,9 +129,7 @@ pub struct GlobalConfig { pub wallet_balance_enquiry_cooldown_period: u64, pub prevent_fee_gt_amount: bool, pub transcoder_host_address: SocketAddr, - pub proxy_submit_to_origin: bool, pub force_sync_peers: Vec, - pub wait_for_initial_sync_at_startup: bool, pub max_randomx_vms: usize, pub console_wallet_notify_file: Option, pub auto_ping_interval: u64, @@ -656,14 +654,47 @@ fn convert_node_config( let merge_mining_config = match application { ApplicationType::MergeMiningProxy => { - let key = "merge_mining_proxy.monerod_url"; + //---------------------------------- Common merge_mining_proxy defaults -------------------------------// + let key = "merge_mining_proxy.proxy_host_address"; + let addr = cfg + .get_str(key) + .unwrap_or_else(|_| "/ip4/127.0.0.1/tcp/7878".to_string()); + // .unwrap_or_else(|_| "127.0.0.1:7878".to_string()); + let proxy_host_address = addr.parse::() + // let proxy_host_address = addr.parse::() + .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string()))?; + + let key = "merge_mining_proxy.base_node_grpc_address"; + let addr = cfg + .get_str(key) + .unwrap_or_else(|_| "/ip4/127.0.0.1/tcp/18142".to_string()); + let base_node_grpc_address = addr + .parse::() + .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string()))?; + + let key = "merge_mining_proxy.wallet_grpc_address"; + let addr = cfg + .get_str(key) + .unwrap_or_else(|_| "/ip4/127.0.0.1/tcp/18143".to_string()); + let wallet_grpc_address = addr + .parse::() + .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string()))?; + + let key = "merge_mining_proxy.proxy_submit_to_origin"; + let proxy_submit_to_origin = cfg.get_bool(key).unwrap_or(true); + + let key = "merge_mining_proxy.wait_for_initial_sync_at_startup"; + let wait_for_initial_sync_at_startup = cfg.get_bool(key).unwrap_or(true); + + //---------------------------------- Network specific merge_mining_proxy defaults ----------------------// + let key = config_string("merge_mining_proxy", net_str, "monerod_url"); let mut monerod_url: Vec = cfg - .get_array(key) + .get_array(&key) .unwrap_or_default() .into_iter() .map(|v| { v.into_str() - .map_err(|err| ConfigurationError::new(key, None, &err.to_string())) + .map_err(|err| ConfigurationError::new(&key, None, &err.to_string())) }) .collect::>()?; @@ -671,53 +702,21 @@ fn convert_node_config( if monerod_url.is_empty() { monerod_url = vec![ "http://stagenet.xmr-tw.org:38081".to_string(), - "http://singapore.node.xmr.pm:38081".to_string(), - "http://xmr-lux.boldsuck.org:38081".to_string(), + "http://stagenet.community.xmr.to:38081".to_string(), "http://monero-stagenet.exan.tech:38081".to_string(), + "http://xmr-lux.boldsuck.org:38081".to_string(), + "http://singapore.node.xmr.pm:38081".to_string(), ]; } - let key = "merge_mining_proxy.monerod_use_auth"; - let monerod_use_auth = cfg - .get_bool(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string()))?; - - let key = "merge_mining_proxy.monerod_username"; - let monerod_username = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string()))?; - - let key = "merge_mining_proxy.monerod_password"; - let monerod_password = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string()))?; - - let key = "merge_mining_proxy.proxy_host_address"; - let proxy_host_address = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string())) - .and_then(|addr| { - addr.parse::() - .map_err(|e| ConfigurationError::new(key, None, &e.to_string())) - })?; + let key = config_string("merge_mining_proxy", net_str, "monerod_use_auth"); + let monerod_use_auth = cfg.get_bool(&key).unwrap_or(false); - let key = "merge_mining_proxy.base_node_grpc_address"; - let base_node_grpc_address = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string())) - .and_then(|addr| { - addr.parse::() - .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string())) - })?; + let key = config_string("merge_mining_proxy", net_str, "monerod_username"); + let monerod_username = cfg.get_str(&key).unwrap_or_else(|_| "".to_string()); - let key = "merge_mining_proxy.wallet_grpc_address"; - let wallet_grpc_address = cfg - .get_str(key) - .map_err(|e| ConfigurationError::new(key, None, &e.to_string())) - .and_then(|addr| { - addr.parse::() - .map_err(|e| ConfigurationError::new(key, Some(addr), &e.to_string())) - })?; + let key = config_string("merge_mining_proxy", net_str, "monerod_password"); + let monerod_password = cfg.get_str(&key).unwrap_or_else(|_| "".to_string()); Some(MergeMiningConfig { monerod_url, @@ -727,6 +726,8 @@ fn convert_node_config( proxy_host_address, base_node_grpc_address, wallet_grpc_address, + proxy_submit_to_origin, + wait_for_initial_sync_at_startup, }) }, _ => None, @@ -741,14 +742,6 @@ fn convert_node_config( .map_err(|e| ConfigurationError::new(&key, Some(addr), &e.to_string())) })?; - let key = config_string("merge_mining_proxy", net_str, "wait_for_initial_sync_at_startup"); - let wait_for_initial_sync_at_startup = cfg - .get_bool(&key) - .map_err(|e| ConfigurationError::new(&key, None, &e.to_string()))?; - - let key = config_string("merge_mining_proxy", net_str, "proxy_submit_to_origin"); - let proxy_submit_to_origin = cfg.get_bool(&key).unwrap_or(true); - let key = "mining_node.num_mining_threads"; let num_mining_threads = optional(cfg.get_int(key))?.unwrap_or(1) as usize; @@ -862,9 +855,7 @@ fn convert_node_config( wallet_balance_enquiry_cooldown_period, prevent_fee_gt_amount, transcoder_host_address, - proxy_submit_to_origin, force_sync_peers, - wait_for_initial_sync_at_startup, max_randomx_vms, console_wallet_notify_file, auto_ping_interval, diff --git a/common/src/configuration/merge_mining_config.rs b/common/src/configuration/merge_mining_config.rs index fbe49b1a66..d4cabe4c4b 100644 --- a/common/src/configuration/merge_mining_config.rs +++ b/common/src/configuration/merge_mining_config.rs @@ -20,8 +20,6 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use std::net::SocketAddr; - use multiaddr::Multiaddr; #[derive(Debug, Clone)] @@ -30,7 +28,9 @@ pub struct MergeMiningConfig { pub monerod_use_auth: bool, pub monerod_username: String, pub monerod_password: String, - pub proxy_host_address: SocketAddr, + pub proxy_host_address: Multiaddr, pub base_node_grpc_address: Multiaddr, pub wallet_grpc_address: Multiaddr, + pub proxy_submit_to_origin: bool, + pub wait_for_initial_sync_at_startup: bool, } diff --git a/common/src/configuration/utils.rs b/common/src/configuration/utils.rs index 8d15322bbd..56d3acc0d0 100644 --- a/common/src/configuration/utils.rs +++ b/common/src/configuration/utils.rs @@ -292,65 +292,51 @@ fn set_stratum_transcoder_defaults(cfg: &mut Config) { } fn set_merge_mining_defaults(cfg: &mut Config) { - cfg.set_default( - "merge_mining_proxy.mainnet.monerod_url", - "http://monero-stagenet.exan.tech:38081", - ) - .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.proxy_host_address", "127.0.0.1:7878") - .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.monerod_use_auth", "false") - .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.monerod_username", "") + //---------------------------------- common defaults --------------------------------------------// + cfg.set_default("merge_mining_proxy.proxy_host_address", "/ip4/127.0.0.1/tcp/7878") .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.monerod_password", "") + cfg.set_default("merge_mining_proxy.base_node_grpc_address", "/ip4/127.0.0.1/tcp/18142") .unwrap(); - cfg.set_default("merge_mining_proxy.mainnet.wait_for_initial_sync_at_startup", true) + cfg.set_default("merge_mining_proxy.wallet_grpc_address", "/ip4/127.0.0.1/tcp/18143") .unwrap(); - cfg.set_default( - "merge_mining_proxy.weatherwax.monerod_url", - "http://monero-stagenet.exan.tech:38081", - ) - .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.proxy_host_address", "127.0.0.1:7878") + cfg.set_default("merge_mining_proxy.proxy_submit_to_origin", true) .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.proxy_submit_to_origin", true) + cfg.set_default("merge_mining_proxy.wait_for_initial_sync_at_startup", true) .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.monerod_use_auth", "false") + + //---------------------------------- mainnet defaults --------------------------------------------// + cfg.set_default("merge_mining_proxy.mainnet.monerod_url", "http://xmr.support:18081") .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.monerod_username", "") + cfg.set_default("merge_mining_proxy.mainnet.monerod_use_auth", false) .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.monerod_password", "") + cfg.set_default("merge_mining_proxy.mainnet.monerod_username", "") .unwrap(); - cfg.set_default("merge_mining_proxy.weatherwax.wait_for_initial_sync_at_startup", true) + cfg.set_default("merge_mining_proxy.mainnet.monerod_password", "") .unwrap(); + + //---------------------------------- igor defaults --------------------------------------------// 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) - .unwrap(); - cfg.set_default("merge_mining_proxy.igor.monerod_use_auth", "false") + cfg.set_default("merge_mining_proxy.igor.monerod_use_auth", false) .unwrap(); cfg.set_default("merge_mining_proxy.igor.monerod_username", "").unwrap(); cfg.set_default("merge_mining_proxy.igor.monerod_password", "").unwrap(); - cfg.set_default("merge_mining_proxy.igor.wait_for_initial_sync_at_startup", true) - .unwrap(); - cfg.set_default("merge_mining_proxy.dibbler.proxy_host_address", "127.0.0.1:7878") - .unwrap(); - cfg.set_default("merge_mining_proxy.dibbler.proxy_submit_to_origin", true) - .unwrap(); - cfg.set_default("merge_mining_proxy.dibbler.monerod_use_auth", "false") + + //---------------------------------- dibbler defaults --------------------------------------------// + cfg.set_default( + "merge_mining_proxy.dibbler.monerod_url", + "http://monero-stagenet.exan.tech:38081", + ) + .unwrap(); + cfg.set_default("merge_mining_proxy.dibbler.monerod_use_auth", false) .unwrap(); cfg.set_default("merge_mining_proxy.dibbler.monerod_username", "") .unwrap(); cfg.set_default("merge_mining_proxy.dibbler.monerod_password", "") .unwrap(); - cfg.set_default("merge_mining_proxy.dibbler.wait_for_initial_sync_at_startup", true) - .unwrap(); } fn set_mining_node_defaults(cfg: &mut Config) { diff --git a/integration_tests/helpers/baseNodeProcess.js b/integration_tests/helpers/baseNodeProcess.js index 4c0319bd19..f17c321299 100644 --- a/integration_tests/helpers/baseNodeProcess.js +++ b/integration_tests/helpers/baseNodeProcess.js @@ -123,7 +123,7 @@ class BaseNodeProcess { "127.0.0.1", this.grpcPort, this.port, - "127.0.0.1:8080", + "/ip4/127.0.0.1/tcp/8080", "127.0.0.1:8085", this.options, this.peerSeeds, diff --git a/integration_tests/helpers/config.js b/integration_tests/helpers/config.js index f5064df5a9..c74d9b5e8f 100644 --- a/integration_tests/helpers/config.js +++ b/integration_tests/helpers/config.js @@ -94,7 +94,7 @@ function baseEnvs(peerSeeds = [], forceSyncPeers = [], committee = []) { TARI_BASE_NODE__LOCALNET__MAX_RANDOMX_VMS: "1", TARI_BASE_NODE__LOCALNET__AUTO_PING_INTERVAL: "15", TARI_BASE_NODE__LOCALNET__FLOOD_BAN_MAX_MSG_COUNT: "100000", - TARI_MERGE_MINING_PROXY__MONEROD_URL: [ + TARI_MERGE_MINING_PROXY__LOCALNET__MONEROD_URL: [ "http://stagenet.xmr-tw.org:38081", "http://stagenet.community.xmr.to:38081", "http://monero-stagenet.exan.tech:38081", @@ -104,10 +104,10 @@ function baseEnvs(peerSeeds = [], forceSyncPeers = [], committee = []) { TARI_MERGE_MINING_PROXY__LOCALNET__MONEROD_USE_AUTH: false, TARI_MERGE_MINING_PROXY__LOCALNET__MONEROD_USERNAME: '""', TARI_MERGE_MINING_PROXY__LOCALNET__MONEROD_PASSWORD: '""', + TARI_MERGE_MINING_PROXY__WAIT_FOR_INITIAL_SYNC_AT_STARTUP: false, TARI_BASE_NODE__LOCALNET__DB_INIT_SIZE_MB: 100, TARI_BASE_NODE__LOCALNET__DB_RESIZE_THRESHOLD_MB: 10, TARI_BASE_NODE__LOCALNET__DB_GROW_SIZE_MB: 20, - TARI_MERGE_MINING_PROXY__LOCALNET__WAIT_FOR_INITIAL_SYNC_AT_STARTUP: false, TARI_MINING_NODE__NUM_MINING_THREADS: "1", TARI_MINING_NODE__MINE_ON_TIP_ONLY: true, TARI_MINING_NODE__VALIDATE_TIP_TIMEOUT_SEC: 1, @@ -137,8 +137,8 @@ function createEnv( baseNodeGrpcAddress = "127.0.0.1", baseNodeGrpcPort = "8080", baseNodePort = "8081", - proxyFullAddress = "127.0.0.1:8084", - transcoderFullAddress = "127.0.0.1:8085", + proxyMultiAddress = "/ip4/127.0.0.1/tcp/8084", + transcoderMultiAddress = "/ip4/127.0.0.1/tcp/8085", options, peerSeeds = [], _txnSendingMechanism = "DirectAndStoreAndForward", @@ -167,8 +167,8 @@ function createEnv( [`TARI_WALLET__${network}__TCP_LISTENER_ADDRESS`]: `/ip4/127.0.0.1/tcp/${walletPort}`, [`TARI_WALLET__${network}__PUBLIC_ADDRESS`]: `/ip4/127.0.0.1/tcp/${walletPort}`, - [`TARI_MERGE_MINING_PROXY__PROXY_HOST_ADDRESS`]: `${proxyFullAddress}`, - [`TARI_STRATUM_TRANSCODER__${network}__TRANSCODER_HOST_ADDRESS`]: `${transcoderFullAddress}`, + [`TARI_MERGE_MINING_PROXY__PROXY_HOST_ADDRESS`]: `${proxyMultiAddress}`, + [`TARI_STRATUM_TRANSCODER__${network}__TRANSCODER_HOST_ADDRESS`]: `${transcoderMultiAddress}`, }; return { ...envs, ...configEnvs, ...mapEnvs(options || {}) }; diff --git a/integration_tests/helpers/mergeMiningProxyProcess.js b/integration_tests/helpers/mergeMiningProxyProcess.js index f31d85dde5..09ac5ca853 100644 --- a/integration_tests/helpers/mergeMiningProxyProcess.js +++ b/integration_tests/helpers/mergeMiningProxyProcess.js @@ -47,7 +47,7 @@ class MergeMiningProxyProcess { fs.mkdirSync(this.baseDir + "/log", { recursive: true }); } - const proxyAddress = "127.0.0.1:" + this.port; + const proxyAddress = "/ip4/127.0.0.1/tcp/" + this.port; const envs = createEnv( this.name, @@ -65,8 +65,7 @@ class MergeMiningProxyProcess { [] ); const extraEnvs = { - TARI_MERGE_MINING_PROXY__LOCALNET__PROXY_SUBMIT_TO_ORIGIN: - this.submitOrigin, + TARI_MERGE_MINING_PROXY__PROXY_SUBMIT_TO_ORIGIN: this.submitOrigin, }; const completeEnvs = { ...envs, ...extraEnvs }; console.log(completeEnvs); diff --git a/integration_tests/helpers/miningNodeProcess.js b/integration_tests/helpers/miningNodeProcess.js index 0dd6ec0055..3268e284fc 100644 --- a/integration_tests/helpers/miningNodeProcess.js +++ b/integration_tests/helpers/miningNodeProcess.js @@ -73,7 +73,7 @@ class MiningNodeProcess { this.nodeAddress, this.nodeGrpcPort, this.baseNodePort, - "127.0.0.1:8084", + "/ip4/127.0.0.1/tcp/8084", "127.0.0.1:8085", { mineOnTipOnly: this.mineOnTipOnly, diff --git a/integration_tests/helpers/stratumTranscoderProcess.js b/integration_tests/helpers/stratumTranscoderProcess.js index 1c000a2fed..200342eb07 100644 --- a/integration_tests/helpers/stratumTranscoderProcess.js +++ b/integration_tests/helpers/stratumTranscoderProcess.js @@ -48,7 +48,7 @@ class StratumTranscoderProcess { this.nodeAddress, this.nodeGrpcPort, this.baseNodePort, - "127.0.0.1:8085", + "/ip4/127.0.0.1/tcp/8085", transcoderAddress, [], [] diff --git a/integration_tests/helpers/validatorNodeProcess.js b/integration_tests/helpers/validatorNodeProcess.js index 418d513447..c3182a3dc0 100644 --- a/integration_tests/helpers/validatorNodeProcess.js +++ b/integration_tests/helpers/validatorNodeProcess.js @@ -132,7 +132,7 @@ class ValidatorNodeProcess { "127.0.0.1", this.grpcPort, this.port, - "127.0.0.1:8080", + "/ip4/127.0.0.1/tcp/8080", "127.0.0.1:8085", this.options, this.peerSeeds, diff --git a/integration_tests/helpers/walletProcess.js b/integration_tests/helpers/walletProcess.js index d3bcb31860..19710d2743 100644 --- a/integration_tests/helpers/walletProcess.js +++ b/integration_tests/helpers/walletProcess.js @@ -83,7 +83,7 @@ class WalletProcess { "127.0.0.1", "8080", "8081", - "127.0.0.1:8084", + "/ip4/127.0.0.1/tcp/8084", "127.0.0.1:8085", this.options, this.peerSeeds diff --git a/integration_tests/package-lock.json b/integration_tests/package-lock.json index 868ccd2cda..6edebd6a5c 100644 --- a/integration_tests/package-lock.json +++ b/integration_tests/package-lock.json @@ -653,7 +653,7 @@ }, "any-promise": { "version": "1.3.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", "dev": true }, @@ -747,7 +747,7 @@ }, "assert-plus": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, @@ -759,7 +759,7 @@ }, "assertion-error-formatter": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/assertion-error-formatter/-/assertion-error-formatter-3.0.0.tgz", "integrity": "sha512-6YyAVLrEze0kQ7CmJfUgrLHb+Y7XghmL2Ie7ijVa2Y9ynP3LV+VDiwFk62Dn0qtqbmY0BT0ss6p1xxpiF2PYbQ==", "dev": true, "requires": { @@ -993,7 +993,7 @@ }, "colors": { "version": "1.4.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" }, "commander": { @@ -1088,7 +1088,7 @@ }, "d": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "dev": true, "requires": { @@ -1152,7 +1152,7 @@ }, "diff": { "version": "4.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, @@ -1167,7 +1167,7 @@ }, "duration": { "version": "0.2.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/duration/-/duration-0.2.2.tgz", "integrity": "sha512-06kgtea+bGreF5eKYgI/36A6pLXggY7oR4p1pq4SmdFBn1ReOL5D8RhG64VrqfTTKNucqqtBAwEj8aB88mcqrg==", "dev": true, "requires": { @@ -1259,7 +1259,7 @@ }, "es5-ext": { "version": "0.10.53", - "resolved": false, + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", "dev": true, "requires": { @@ -1270,7 +1270,7 @@ }, "es6-iterator": { "version": "2.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, "requires": { @@ -1281,7 +1281,7 @@ }, "es6-symbol": { "version": "3.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "dev": true, "requires": { @@ -1704,7 +1704,7 @@ }, "ext": { "version": "1.6.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", "dev": true, "requires": { @@ -1713,7 +1713,7 @@ "dependencies": { "type": { "version": "2.5.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==", "dev": true } @@ -1765,7 +1765,7 @@ }, "figures": { "version": "3.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "requires": { "escape-string-regexp": "^1.0.5" @@ -2042,7 +2042,7 @@ }, "indent-string": { "version": "4.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, @@ -2175,7 +2175,7 @@ }, "is-stream": { "version": "2.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, @@ -2328,7 +2328,7 @@ }, "knuth-shuffle-seeded": { "version": "1.0.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/knuth-shuffle-seeded/-/knuth-shuffle-seeded-1.0.6.tgz", "integrity": "sha1-AfG2VzOqdUDuCNiwF0Fk0iCB5OE=", "dev": true, "requires": { @@ -2504,7 +2504,7 @@ }, "mz": { "version": "2.7.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "dev": true, "requires": { @@ -2521,7 +2521,7 @@ }, "next-tick": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "dev": true }, @@ -2574,7 +2574,7 @@ }, "object-assign": { "version": "4.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-inspect": { @@ -2669,7 +2669,7 @@ }, "pad-right": { "version": "0.2.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", "integrity": "sha1-b7ySQEXSRPKiokRQMGDTv8YAl3Q=", "dev": true, "requires": { @@ -2877,7 +2877,7 @@ }, "repeat-string": { "version": "1.6.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, @@ -2942,7 +2942,7 @@ }, "seed-random": { "version": "2.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", "integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ=", "dev": true }, @@ -3068,7 +3068,7 @@ }, "stack-chain": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/stack-chain/-/stack-chain-2.0.0.tgz", "integrity": "sha512-GGrHXePi305aW7XQweYZZwiRwR7Js3MWoK/EHzzB9ROdc75nCnjSJVi21rdAGxFl+yCx2L2qdfl5y7NO4lTyqg==", "dev": true }, @@ -3118,7 +3118,7 @@ }, "string-argv": { "version": "0.3.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", "dev": true }, @@ -3263,7 +3263,7 @@ }, "thenify": { "version": "3.3.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "dev": true, "requires": { @@ -3272,7 +3272,7 @@ }, "thenify-all": { "version": "1.6.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", "dev": true, "requires": { @@ -3336,7 +3336,7 @@ }, "type": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", "dev": true }, @@ -3398,7 +3398,7 @@ }, "util-arity": { "version": "1.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/util-arity/-/util-arity-1.1.0.tgz", "integrity": "sha1-WdAa8f2z/t4KxOYysKtfbOl8kzA=", "dev": true },