Change monerod --proxy to --tx-proxy

This commit is contained in:
Lee Clagett 2019-10-24 21:06:31 -04:00
parent be6c5afabb
commit 65e8a89e1c
4 changed files with 18 additions and 18 deletions

View File

@ -43,11 +43,11 @@ additional peers can be found through typical p2p peerlist sharing.
### Outbound Connections ### Outbound Connections
Connecting to an anonymous address requires the command line option 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: separate process. On most systems the configuration will look like:
> `--proxy tor,127.0.0.1:9050,10` > `--tx-proxy tor,127.0.0.1:9050,10`
> `--proxy i2p,127.0.0.1:9000` > `--tx-proxy i2p,127.0.0.1:9000`
which tells `monerod` that ".onion" p2p addresses can be forwarded to a socks 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 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 Options `--add-exclusive-node` and `--add-peer` recognize ".onion" and
".b32.i2p" addresses, and will properly forward those addresses to the proxy ".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, Option `--anonymous-inbound` also recognizes ".onion" and ".b32.i2p" addresses,
and will automatically be sent out to outgoing Tor/I2P connections so the peer and will automatically be sent out to outgoing Tor/I2P connections so the peer

View File

@ -144,7 +144,7 @@ namespace nodetool
const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_add_exclusive_node = {"add-exclusive-node", "Specify list of peers to connect to only." const command_line::arg_descriptor<std::vector<std::string> > 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"}; " If this option is given the options add-priority-node and seed-node are ignored"};
const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_seed_node = {"seed-node", "Connect to a node to retrieve peer addresses, and disconnect"}; const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_seed_node = {"seed-node", "Connect to a node to retrieve peer addresses, and disconnect"};
const command_line::arg_descriptor<std::vector<std::string> > arg_proxy = {"proxy", "<network-type>,<socks-ip:port>[,max_connections][,disable_noise] i.e. \"tor,127.0.0.1:9050,100,disable_noise\""}; const command_line::arg_descriptor<std::vector<std::string> > arg_tx_proxy = {"tx-proxy", "Send local txes through proxy: <network-type>,<socks-ip:port>[,max_connections][,disable_noise] i.e. \"tor,127.0.0.1:9050,100,disable_noise\""};
const command_line::arg_descriptor<std::vector<std::string> > arg_anonymous_inbound = {"anonymous-inbound", "<hidden-service-address>,<[bind-ip:]port>[,max_connections] i.e. \"x.onion,127.0.0.1:18083,100\""}; const command_line::arg_descriptor<std::vector<std::string> > arg_anonymous_inbound = {"anonymous-inbound", "<hidden-service-address>,<[bind-ip:]port>[,max_connections] i.e. \"x.onion,127.0.0.1:18083,100\""};
const command_line::arg_descriptor<bool> arg_p2p_hide_my_port = {"hide-my-port", "Do not announce yourself as peerlist candidate", false, true}; const command_line::arg_descriptor<bool> arg_p2p_hide_my_port = {"hide-my-port", "Do not announce yourself as peerlist candidate", false, true};
const command_line::arg_descriptor<bool> arg_no_sync = {"no-sync", "Don't synchronize the blockchain with other peers", false}; const command_line::arg_descriptor<bool> arg_no_sync = {"no-sync", "Don't synchronize the blockchain with other peers", false};
@ -167,7 +167,7 @@ namespace nodetool
std::vector<proxy> proxies{}; std::vector<proxy> proxies{};
const std::vector<std::string> args = command_line::get_arg(vm, arg_proxy); const std::vector<std::string> args = command_line::get_arg(vm, arg_tx_proxy);
proxies.reserve(args.size()); proxies.reserve(args.size());
for (const boost::string_ref arg : args) for (const boost::string_ref arg : args)
@ -175,11 +175,11 @@ namespace nodetool
proxies.emplace_back(); proxies.emplace_back();
auto next = boost::algorithm::make_split_iterator(arg, boost::algorithm::first_finder(",")); 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()}; const boost::string_ref zone{next->begin(), next->size()};
++next; ++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()}; const boost::string_ref proxy{next->begin(), next->size()};
++next; ++next;
@ -187,7 +187,7 @@ namespace nodetool
{ {
if (2 <= count) 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; return boost::none;
} }
@ -198,7 +198,7 @@ namespace nodetool
proxies.back().max_connections = get_max_connections(*next); proxies.back().max_connections = get_max_connections(*next);
if (proxies.back().max_connections == 0) 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; return boost::none;
} }
} }
@ -213,7 +213,7 @@ namespace nodetool
proxies.back().zone = epee::net_utils::zone::i2p; proxies.back().zone = epee::net_utils::zone::i2p;
break; break;
default: default:
MERROR("Invalid network for --" << arg_proxy.name); MERROR("Invalid network for --" << arg_tx_proxy.name);
return boost::none; return boost::none;
} }
@ -221,7 +221,7 @@ namespace nodetool
std::uint16_t port = 0; std::uint16_t port = 0;
if (!epee::string_tools::parse_peer_from_string(ip, port, std::string{proxy}) || 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; return boost::none;
} }
proxies.back().address = ip::tcp::endpoint{ip::address_v4{boost::endian::native_to_big(ip)}, port}; 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); inbounds.back().max_connections = get_max_connections(*next);
if (inbounds.back().max_connections == 0) 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; return boost::none;
} }
} }

View File

@ -517,7 +517,7 @@ namespace nodetool
extern const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_add_priority_node; extern const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_add_priority_node;
extern const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_add_exclusive_node; extern const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_add_exclusive_node;
extern const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_seed_node; extern const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_seed_node;
extern const command_line::arg_descriptor<std::vector<std::string> > arg_proxy; extern const command_line::arg_descriptor<std::vector<std::string> > arg_tx_proxy;
extern const command_line::arg_descriptor<std::vector<std::string> > arg_anonymous_inbound; extern const command_line::arg_descriptor<std::vector<std::string> > arg_anonymous_inbound;
extern const command_line::arg_descriptor<bool> arg_p2p_hide_my_port; extern const command_line::arg_descriptor<bool> arg_p2p_hide_my_port;
extern const command_line::arg_descriptor<bool> arg_no_sync; extern const command_line::arg_descriptor<bool> arg_no_sync;

View File

@ -104,7 +104,7 @@ namespace nodetool
command_line::add_arg(desc, arg_p2p_add_priority_node); 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_add_exclusive_node);
command_line::add_arg(desc, arg_p2p_seed_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_anonymous_inbound);
command_line::add_arg(desc, arg_p2p_hide_my_port); command_line::add_arg(desc, arg_p2p_hide_my_port);
command_line::add_arg(desc, arg_no_sync); command_line::add_arg(desc, arg_no_sync);
@ -475,7 +475,7 @@ namespace nodetool
network_zone& zone = add_zone(proxy.zone); network_zone& zone = add_zone(proxy.zone);
if (zone.m_connect != nullptr) 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; return false;
} }
zone.m_connect = &socks_connect; zone.m_connect = &socks_connect;
@ -503,7 +503,7 @@ namespace nodetool
{ {
if (zone.second.m_connect == nullptr) 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; return false;
} }
} }
@ -525,7 +525,7 @@ namespace nodetool
if (zone.m_connect == nullptr && tx_relay_zones <= 1) 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; return false;
} }