|
|
|
@ -65,6 +65,7 @@ main(int ac, const char* av[])
|
|
|
|
|
auto mainnet_url = opts.get_option<string>("mainnet-url");
|
|
|
|
|
auto mempool_info_timeout_opt = opts.get_option<string>("mempool-info-timeout");
|
|
|
|
|
auto mempool_refresh_time_opt = opts.get_option<string>("mempool-refresh-time");
|
|
|
|
|
auto daemon_login_opt = opts.get_option<string>("daemon-login");
|
|
|
|
|
auto testnet_opt = opts.get_option<bool>("testnet");
|
|
|
|
|
auto stagenet_opt = opts.get_option<bool>("stagenet");
|
|
|
|
|
auto enable_key_image_checker_opt = opts.get_option<bool>("enable-key-image-checker");
|
|
|
|
@ -79,7 +80,6 @@ main(int ac, const char* av[])
|
|
|
|
|
auto enable_emission_monitor_opt = opts.get_option<bool>("enable-emission-monitor");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool testnet {*testnet_opt};
|
|
|
|
|
bool stagenet {*stagenet_opt};
|
|
|
|
|
|
|
|
|
@ -123,9 +123,41 @@ main(int ac, const char* av[])
|
|
|
|
|
string ssl_crt_file;
|
|
|
|
|
string ssl_key_file;
|
|
|
|
|
|
|
|
|
|
xmreg::rpccalls::login_opt daemon_rpc_login {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (daemon_login_opt)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string user {};
|
|
|
|
|
epee::wipeable_string pass {};
|
|
|
|
|
|
|
|
|
|
string daemon_login = *daemon_login_opt;
|
|
|
|
|
|
|
|
|
|
size_t colon_location = daemon_login.find_first_of(':');
|
|
|
|
|
|
|
|
|
|
if (colon_location != std::string::npos)
|
|
|
|
|
{
|
|
|
|
|
// have colon for user:password
|
|
|
|
|
user = daemon_login.substr(0, colon_location);
|
|
|
|
|
pass = daemon_login.substr(colon_location + 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
user = *daemon_login_opt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
daemon_rpc_login = epee::net_utils::http::login {user, pass};
|
|
|
|
|
|
|
|
|
|
//cout << "colon_location: " << colon_location << endl;
|
|
|
|
|
// cout << "user: " << user << endl;
|
|
|
|
|
// cout << "pass: " << std::string(pass.data(), pass.size()) << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// check if ssl enabled and files exist
|
|
|
|
|
|
|
|
|
|
if (ssl_crt_file_opt and ssl_key_file_opt)
|
|
|
|
|
if (ssl_crt_file_opt && ssl_key_file_opt)
|
|
|
|
|
{
|
|
|
|
|
if (!boost::filesystem::exists(boost::filesystem::path(*ssl_crt_file_opt)))
|
|
|
|
|
{
|
|
|
|
@ -237,6 +269,8 @@ main(int ac, const char* av[])
|
|
|
|
|
= nettype;
|
|
|
|
|
xmreg::MempoolStatus::deamon_url
|
|
|
|
|
= deamon_url;
|
|
|
|
|
xmreg::MempoolStatus::login
|
|
|
|
|
= daemon_rpc_login;
|
|
|
|
|
xmreg::MempoolStatus::set_blockchain_variables(
|
|
|
|
|
&mcore, core_storage);
|
|
|
|
|
|
|
|
|
@ -281,7 +315,8 @@ main(int ac, const char* av[])
|
|
|
|
|
mempool_info_timeout,
|
|
|
|
|
*testnet_url,
|
|
|
|
|
*stagenet_url,
|
|
|
|
|
*mainnet_url);
|
|
|
|
|
*mainnet_url,
|
|
|
|
|
daemon_rpc_login);
|
|
|
|
|
|
|
|
|
|
// crow instance
|
|
|
|
|
crow::SimpleApp app;
|
|
|
|
|