From ba958f0b52413ea6e9e6f3bb7693267e07d1df5e Mon Sep 17 00:00:00 2001 From: creating2morrow Date: Thu, 22 Jun 2023 10:53:53 -0400 Subject: [PATCH] force monero remote connections over i2p --- neveko-core/src/monero.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/neveko-core/src/monero.rs b/neveko-core/src/monero.rs index 6ba0a78..1c02795 100644 --- a/neveko-core/src/monero.rs +++ b/neveko-core/src/monero.rs @@ -11,6 +11,7 @@ use log::{ debug, error, info, + warn, }; use std::process::Command; @@ -200,8 +201,9 @@ pub fn start_rpc() { std::env::var("USER").unwrap_or(String::from("user")), ); let release_env = utils::get_release_env(); + let cli_args = args::Args::parse(); if release_env == utils::ReleaseEnvironment::Development { - let args = [ + let mut args = vec![ "--rpc-bind-port", &port, "--wallet-dir", @@ -212,6 +214,13 @@ pub fn start_rpc() { &daemon_address, "--stagenet", ]; + if cli_args.remote_node { + if !&cli_args.i2p_proxy_host.contains(".i2p") { + warn!("invalid i2p monero remote node detected"); + } + args.push("--proxy"); + args.push(&cli_args.i2p_proxy_host); + } let output = Command::new(format!("{}/monero-wallet-rpc", bin_dir)) .args(args) .spawn() @@ -222,7 +231,7 @@ pub fn start_rpc() { "/home/{}/.neveko/wallet/", std::env::var("USER").unwrap_or(String::from("user")), ); - let args = [ + let mut args = vec![ "--rpc-bind-port", &port, "--wallet-dir", @@ -232,6 +241,10 @@ pub fn start_rpc() { "--daemon-address", &daemon_address, ]; + if cli_args.remote_node { + args.push("--proxy"); + args.push(&cli_args.i2p_proxy_host); + } let output = Command::new(format!("{}/monero-wallet-rpc", bin_dir)) .args(args) .spawn()