#include <daemon.h>
|
| static void | init_options (boost::program_options::options_description &option_spec) |
| |
Definition at line 40 of file daemon.h.
◆ t_daemon() [1/2]
| t_daemon::t_daemon |
( |
boost::program_options::variables_map const & |
vm, |
|
|
uint16_t |
public_rpc_port = 0 |
|
) |
| |
Definition at line 100 of file daemon.cpp.
104 : mp_internals{
new t_internals{vm}},
105 public_rpc_port(public_rpc_port)
const command_line::arg_descriptor< std::string > arg_zmq_rpc_bind_ip
const command_line::arg_descriptor< std::string, false, true, 2 > arg_zmq_rpc_bind_port
const command_line::arg_descriptor< bool > arg_zmq_rpc_disabled
T get_arg(const boost::program_options::variables_map &vm, const arg_descriptor< T, false, true > &arg)
◆ t_daemon() [2/2]
Definition at line 115 of file daemon.cpp.
119 mp_internals =
std::move(other.mp_internals);
120 other.mp_internals.reset(
nullptr);
121 public_rpc_port = other.public_rpc_port;
const T & move(const T &t)
◆ ~t_daemon()
◆ init_options()
| void t_daemon::init_options |
( |
boost::program_options::options_description & |
option_spec | ) |
|
|
static |
Definition at line 93 of file daemon.cpp.
static void init_options(boost::program_options::options_description &option_spec)
static void init_options(boost::program_options::options_description &option_spec)
static void init_options(boost::program_options::options_description &option_spec)
◆ operator=()
Definition at line 126 of file daemon.cpp.
130 mp_internals =
std::move(other.mp_internals);
131 other.mp_internals.reset(
nullptr);
132 public_rpc_port = other.public_rpc_port;
const T & move(const T &t)
◆ run()
Definition at line 137 of file daemon.cpp.
139 if (
nullptr == mp_internals)
141 throw std::runtime_error{
"Can't run stopped daemon"};
144 std::atomic<bool>
stop(
false), shutdown(
false);
145 boost::thread stop_thread = boost::thread([&
stop, &shutdown,
this] {
159 if (!mp_internals->core.run())
162 for(
auto& rpc: mp_internals->rpcs)
165 std::unique_ptr<daemonize::t_command_server> rpc_commands;
166 if (interactive && mp_internals->rpcs.size())
170 rpc_commands->
start_handling(std::bind(&daemonize::t_daemon::stop_p2p,
this));
176 if (!zmq_rpc_disabled)
178 if (!zmq_server.addTCPSocket(zmq_rpc_bind_address, zmq_rpc_bind_port))
181 +
":" + zmq_rpc_bind_port +
") to ZMQ RPC Server");
186 for(
auto& rpc : mp_internals->rpcs)
192 MINFO(
"Starting ZMQ server...");
196 +
":" + zmq_rpc_bind_port +
".");
199 MINFO(
"ZMQ server disabled");
201 if (public_rpc_port > 0)
203 MGINFO(
"Public RPC port " << public_rpc_port <<
" will be advertised to other peers over P2P");
204 mp_internals->p2p.get().set_rpc_port(public_rpc_port);
207 mp_internals->p2p.run();
212 if (!zmq_rpc_disabled)
215 for(
auto& rpc : mp_internals->rpcs)
220 catch (std::exception
const & ex)
222 MFATAL(
"Uncaught exception! " << ex.what());
227 MFATAL(
"Uncaught exception!");
auto_scope_leave_caller create_scope_leave_handler(t_scope_leave_handler f)
boost::shared_ptr< call_befor_die_base > auto_scope_leave_caller
bool start_handling(std::function< void(void)> exit_handler=NULL)
◆ stop()
Definition at line 232 of file daemon.cpp.
234 if (
nullptr == mp_internals)
236 throw std::runtime_error{
"Can't stop stopped daemon"};
238 mp_internals->p2p.stop();
239 for(
auto& rpc : mp_internals->rpcs)
242 mp_internals.reset(
nullptr);
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/electroneum-5.0.0.4/src/daemon/daemon.h
- /home/abuild/rpmbuild/BUILD/electroneum-5.0.0.4/src/daemon/daemon.cpp