diff --git a/ANONYMITY_NETWORKS.md b/ANONYMITY_NETWORKS.md index 6eede44aa..cb0e378c3 100644 --- a/ANONYMITY_NETWORKS.md +++ b/ANONYMITY_NETWORKS.md @@ -43,11 +43,11 @@ additional peers can be found through typical p2p peerlist sharing. ### Outbound Connections Connecting to an anonymous address requires the command line option -`--proxy` which tells `monerod` the ip/port of a socks proxy provided by a +`--tx-proxy` which tells `monerod` the ip/port of a socks proxy provided by a separate process. On most systems the configuration will look like: -> `--proxy tor,127.0.0.1:9050,10` -> `--proxy i2p,127.0.0.1:9000` +> `--tx-proxy tor,127.0.0.1:9050,10` +> `--tx-proxy i2p,127.0.0.1:9000` which tells `monerod` that ".onion" p2p addresses can be forwarded to a socks proxy at IP 127.0.0.1 port 9050 with a max of 10 outgoing connections and @@ -114,7 +114,7 @@ encryption. Options `--add-exclusive-node` and `--add-peer` recognize ".onion" and ".b32.i2p" addresses, and will properly forward those addresses to the proxy -provided with `--proxy tor,...` or `--proxy i2p,...`. +provided with `--tx-proxy tor,...` or `--tx-proxy i2p,...`. Option `--anonymous-inbound` also recognizes ".onion" and ".b32.i2p" addresses, and will automatically be sent out to outgoing Tor/I2P connections so the peer diff --git a/src/p2p/net_node.cpp b/src/p2p/net_node.cpp index ae23bb7fd..58c1717e0 100644 --- a/src/p2p/net_node.cpp +++ b/src/p2p/net_node.cpp @@ -144,7 +144,7 @@ namespace nodetool const command_line::arg_descriptor > arg_p2p_add_exclusive_node = {"add-exclusive-node", "Specify list of peers to connect to only." " If this option is given the options add-priority-node and seed-node are ignored"}; const command_line::arg_descriptor > arg_p2p_seed_node = {"seed-node", "Connect to a node to retrieve peer addresses, and disconnect"}; - const command_line::arg_descriptor > arg_proxy = {"proxy", ",[,max_connections][,disable_noise] i.e. \"tor,127.0.0.1:9050,100,disable_noise\""}; + const command_line::arg_descriptor > arg_tx_proxy = {"tx-proxy", "Send local txes through proxy: ,[,max_connections][,disable_noise] i.e. \"tor,127.0.0.1:9050,100,disable_noise\""}; const command_line::arg_descriptor > arg_anonymous_inbound = {"anonymous-inbound", ",<[bind-ip:]port>[,max_connections] i.e. \"x.onion,127.0.0.1:18083,100\""}; const command_line::arg_descriptor arg_p2p_hide_my_port = {"hide-my-port", "Do not announce yourself as peerlist candidate", false, true}; const command_line::arg_descriptor arg_no_sync = {"no-sync", "Don't synchronize the blockchain with other peers", false}; @@ -167,7 +167,7 @@ namespace nodetool std::vector proxies{}; - const std::vector args = command_line::get_arg(vm, arg_proxy); + const std::vector args = command_line::get_arg(vm, arg_tx_proxy); proxies.reserve(args.size()); for (const boost::string_ref arg : args) @@ -175,11 +175,11 @@ namespace nodetool proxies.emplace_back(); auto next = boost::algorithm::make_split_iterator(arg, boost::algorithm::first_finder(",")); - CHECK_AND_ASSERT_MES(!next.eof() && !next->empty(), boost::none, "No network type for --" << arg_proxy.name); + CHECK_AND_ASSERT_MES(!next.eof() && !next->empty(), boost::none, "No network type for --" << arg_tx_proxy.name); const boost::string_ref zone{next->begin(), next->size()}; ++next; - CHECK_AND_ASSERT_MES(!next.eof() && !next->empty(), boost::none, "No ipv4:port given for --" << arg_proxy.name); + CHECK_AND_ASSERT_MES(!next.eof() && !next->empty(), boost::none, "No ipv4:port given for --" << arg_tx_proxy.name); const boost::string_ref proxy{next->begin(), next->size()}; ++next; @@ -187,7 +187,7 @@ namespace nodetool { if (2 <= count) { - MERROR("Too many ',' characters given to --" << arg_proxy.name); + MERROR("Too many ',' characters given to --" << arg_tx_proxy.name); return boost::none; } @@ -198,7 +198,7 @@ namespace nodetool proxies.back().max_connections = get_max_connections(*next); if (proxies.back().max_connections == 0) { - MERROR("Invalid max connections given to --" << arg_proxy.name); + MERROR("Invalid max connections given to --" << arg_tx_proxy.name); return boost::none; } } @@ -213,7 +213,7 @@ namespace nodetool proxies.back().zone = epee::net_utils::zone::i2p; break; default: - MERROR("Invalid network for --" << arg_proxy.name); + MERROR("Invalid network for --" << arg_tx_proxy.name); return boost::none; } @@ -221,7 +221,7 @@ namespace nodetool std::uint16_t port = 0; if (!epee::string_tools::parse_peer_from_string(ip, port, std::string{proxy}) || port == 0) { - MERROR("Invalid ipv4:port given for --" << arg_proxy.name); + MERROR("Invalid ipv4:port given for --" << arg_tx_proxy.name); return boost::none; } proxies.back().address = ip::tcp::endpoint{ip::address_v4{boost::endian::native_to_big(ip)}, port}; @@ -258,7 +258,7 @@ namespace nodetool inbounds.back().max_connections = get_max_connections(*next); if (inbounds.back().max_connections == 0) { - MERROR("Invalid max connections given to --" << arg_proxy.name); + MERROR("Invalid max connections given to --" << arg_tx_proxy.name); return boost::none; } } diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h index 0c9c285e8..65fdb5c0f 100644 --- a/src/p2p/net_node.h +++ b/src/p2p/net_node.h @@ -517,7 +517,7 @@ namespace nodetool extern const command_line::arg_descriptor > arg_p2p_add_priority_node; extern const command_line::arg_descriptor > arg_p2p_add_exclusive_node; extern const command_line::arg_descriptor > arg_p2p_seed_node; - extern const command_line::arg_descriptor > arg_proxy; + extern const command_line::arg_descriptor > arg_tx_proxy; extern const command_line::arg_descriptor > arg_anonymous_inbound; extern const command_line::arg_descriptor arg_p2p_hide_my_port; extern const command_line::arg_descriptor arg_no_sync; diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 9150ebb1b..2e85f21be 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -104,7 +104,7 @@ namespace nodetool command_line::add_arg(desc, arg_p2p_add_priority_node); command_line::add_arg(desc, arg_p2p_add_exclusive_node); command_line::add_arg(desc, arg_p2p_seed_node); - command_line::add_arg(desc, arg_proxy); + command_line::add_arg(desc, arg_tx_proxy); command_line::add_arg(desc, arg_anonymous_inbound); command_line::add_arg(desc, arg_p2p_hide_my_port); command_line::add_arg(desc, arg_no_sync); @@ -475,7 +475,7 @@ namespace nodetool network_zone& zone = add_zone(proxy.zone); if (zone.m_connect != nullptr) { - MERROR("Listed --" << arg_proxy.name << " twice with " << epee::net_utils::zone_to_string(proxy.zone)); + MERROR("Listed --" << arg_tx_proxy.name << " twice with " << epee::net_utils::zone_to_string(proxy.zone)); return false; } zone.m_connect = &socks_connect; @@ -503,7 +503,7 @@ namespace nodetool { if (zone.second.m_connect == nullptr) { - MERROR("Set outgoing peer for " << epee::net_utils::zone_to_string(zone.first) << " but did not set --" << arg_proxy.name); + MERROR("Set outgoing peer for " << epee::net_utils::zone_to_string(zone.first) << " but did not set --" << arg_tx_proxy.name); return false; } } @@ -525,7 +525,7 @@ namespace nodetool if (zone.m_connect == nullptr && tx_relay_zones <= 1) { - MERROR("Listed --" << arg_anonymous_inbound.name << " without listing any --" << arg_proxy.name << ". The latter is necessary for sending origin txes over anonymity networks"); + MERROR("Listed --" << arg_anonymous_inbound.name << " without listing any --" << arg_tx_proxy.name << ". The latter is necessary for sending local txes over anonymity networks"); return false; }