fix monerod RPC connectivity issues

master
moneroexamples 2 years ago
parent 2f514c758a
commit b0a0afc44c

@ -194,7 +194,7 @@ xmrblocks, Onion Monero Blockchain Explorer:
functionality
--ssl-key-file arg path to key file for ssl (https)
functionality
-d [ --deamon-url ] arg (=http:://127.0.0.1:18081)
-d [ --deamon-url ] arg (=127.0.0.1:18081)
Monero daemon url
--daemon-login arg Specify username[:password] for daemon
RPC client

@ -208,10 +208,10 @@ main(int ac, const char* av[])
string deamon_url {*deamon_url_opt};
if (testnet && deamon_url == "http:://127.0.0.1:18081")
deamon_url = "http:://127.0.0.1:28081";
if (stagenet && deamon_url == "http:://127.0.0.1:18081")
deamon_url = "http:://127.0.0.1:38081";
if (testnet && deamon_url == "127.0.0.1:18081")
deamon_url = "127.0.0.1:28081";
if (stagenet && deamon_url == "127.0.0.1:18081")
deamon_url = "127.0.0.1:38081";
uint64_t mempool_info_timeout {5000};

@ -71,7 +71,7 @@ namespace xmreg
"path to key file for ssl (https) functionality")
("daemon-login", value<string>(),
"Specify username[:password] for daemon RPC client")
("deamon-url,d", value<string>()->default_value("http:://127.0.0.1:18081"),
("deamon-url,d", value<string>()->default_value("127.0.0.1:18081"),
"Monero daemon url")
("enable-mixin-guess", value<bool>()->default_value(false)->implicit_value(true),
"enable guessing real outputs in key images based on viewkey");

@ -227,7 +227,10 @@ MempoolStatus::read_network_info()
COMMAND_RPC_GET_INFO::response rpc_network_info;
if (!rpc.get_network_info(rpc_network_info))
{
cerr << "rpc.get_network_info(rpc_network_info) failed";
return false;
}
uint64_t fee_estimated;

@ -578,21 +578,6 @@ page(MicroCore* _mcore,
string
index2(uint64_t page_no = 0, bool refresh_page = false)
{
// we get network info, such as current hash rate
// but since this makes a rpc call to deamon, we make it as an async
// call. this way we dont have to wait with execution of the rest of the
// index2 method, until deamon gives as the required result.
std::future<json> network_info_ftr = std::async(std::launch::async, [&]
{
json j_info;
get_monero_network_info(j_info);
return j_info;
});
// get mempool for the front page also using async future
std::future<string> mempool_ftr = std::async(std::launch::async, [&]
{

@ -21,7 +21,7 @@ rpccalls::rpccalls(
timeout_time_ms = std::chrono::milliseconds {timeout_time};
m_http_client.set_server(
m_http_client.set_server(
deamon_url,
login,
epee::net_utils::ssl_support_t::e_ssl_support_disabled);
@ -183,7 +183,7 @@ rpccalls::get_network_info(COMMAND_RPC_GET_INFO::response& response)
{
if (resp_t.result.status == CORE_RPC_STATUS_BUSY)
{
err = "daemon is busy. Please try again later.";
err = "Daemon is busy. Please try again later.";
}
else if (resp_t.result.status != CORE_RPC_STATUS_OK)
{

@ -77,6 +77,7 @@ class rpccalls
epee::net_utils::http::url_content url;
epee::net_utils::http::http_simple_client m_http_client;
std::mutex m_daemon_rpc_mutex;
string port;

Loading…
Cancel
Save