mirror of
https://github.com/monero-project/monero.git
synced 2026-01-13 05:16:48 -08:00
daemon: add --public-node mode, RPC port propagation over P2P
This commit is contained in:
@@ -96,9 +96,11 @@ void t_daemon::init_options(boost::program_options::options_description & option
|
||||
}
|
||||
|
||||
t_daemon::t_daemon(
|
||||
boost::program_options::variables_map const & vm
|
||||
boost::program_options::variables_map const & vm,
|
||||
uint16_t public_rpc_port
|
||||
)
|
||||
: mp_internals{new t_internals{vm}}
|
||||
: mp_internals{new t_internals{vm}},
|
||||
public_rpc_port(public_rpc_port)
|
||||
{
|
||||
zmq_rpc_bind_port = command_line::get_arg(vm, daemon_args::arg_zmq_rpc_bind_port);
|
||||
zmq_rpc_bind_address = command_line::get_arg(vm, daemon_args::arg_zmq_rpc_bind_ip);
|
||||
@@ -186,6 +188,12 @@ bool t_daemon::run(bool interactive)
|
||||
MINFO(std::string("ZMQ server started at ") + zmq_rpc_bind_address
|
||||
+ ":" + zmq_rpc_bind_port + ".");
|
||||
|
||||
if (public_rpc_port > 0)
|
||||
{
|
||||
MGINFO("Public RPC port " << public_rpc_port << " will be advertised to other peers over P2P");
|
||||
mp_internals->p2p.get().set_rpc_port(public_rpc_port);
|
||||
}
|
||||
|
||||
mp_internals->p2p.run(); // blocks until p2p goes down
|
||||
|
||||
if (rpc_commands)
|
||||
|
||||
Reference in New Issue
Block a user