36 #undef ELECTRONEUM_DEFAULT_LOG_CATEGORY 37 #define ELECTRONEUM_DEFAULT_LOG_CATEGORY "daemon" 45 static void init_options(boost::program_options::options_description & option_spec)
54 boost::program_options::variables_map
const & vm
57 ,
const bool restricted
61 : m_server{core.
get(), p2p.
get()}, m_description{description}
63 MGINFO(
"Initializing " << m_description <<
" RPC server...");
65 if (!m_server.
init(vm, restricted,
port))
67 throw std::runtime_error(
"Failed to initialize " + m_description +
" RPC server.");
74 MGINFO(
"Starting " << m_description <<
" RPC server...");
75 if (!m_server.
run(2,
false))
77 throw std::runtime_error(
"Failed to start " + m_description +
" RPC server.");
79 MGINFO(m_description <<
" RPC server started ok");
84 MGINFO(
"Stopping " << m_description <<
" RPC server...");
96 MGINFO(
"Deinitializing " << m_description <<
" RPC server...");
100 MERROR(
"Failed to deinitialize " << m_description <<
" RPC server...");
bool init(const boost::program_options::variables_map &vm, const bool restricted, const std::string &port)
cryptonote::core_rpc_server * get_server()
static void init_options(boost::program_options::options_description &option_spec)
bool run(size_t threads_count, bool wait=true)
boost::endian::big_uint16_t port
t_rpc(boost::program_options::variables_map const &vm, t_core &core, t_p2p &p2p, const bool restricted, const std::string &port, const std::string &description)
bool timed_wait_server_stop(uint64_t ms)
static void init_options(boost::program_options::options_description &desc)