moneroexamples 7 years ago
parent 3bf79c0a8e
commit 9905e916e4

@ -44,6 +44,7 @@ main(int ac, const char* av[])
} }
auto port_opt = opts.get_option<string>("port"); auto port_opt = opts.get_option<string>("port");
auto bindaddr_opt = opts.get_option<string>("bindaddr");
auto bc_path_opt = opts.get_option<string>("bc-path"); auto bc_path_opt = opts.get_option<string>("bc-path");
auto deamon_url_opt = opts.get_option<string>("deamon-url"); auto deamon_url_opt = opts.get_option<string>("deamon-url");
auto ssl_crt_file_opt = opts.get_option<string>("ssl-crt-file"); auto ssl_crt_file_opt = opts.get_option<string>("ssl-crt-file");
@ -103,6 +104,8 @@ main(int ac, const char* av[])
//cast port number in string to uint //cast port number in string to uint
uint16_t app_port = boost::lexical_cast<uint16_t>(*port_opt); uint16_t app_port = boost::lexical_cast<uint16_t>(*port_opt);
string bindaddr = *bindaddr_opt;
// cast no_blocks_on_index_opt to uint // cast no_blocks_on_index_opt to uint
uint64_t no_blocks_on_index = boost::lexical_cast<uint64_t>(*no_blocks_on_index_opt); uint64_t no_blocks_on_index = boost::lexical_cast<uint64_t>(*no_blocks_on_index_opt);
@ -766,13 +769,13 @@ main(int ac, const char* av[])
if (use_ssl) if (use_ssl)
{ {
cout << "Staring in ssl mode" << endl; cout << "Staring in ssl mode" << endl;
app.port(app_port).ssl_file(ssl_crt_file, ssl_key_file) app.bindaddr(bindaddr).port(app_port).ssl_file(ssl_crt_file, ssl_key_file)
.multithreaded().run(); .multithreaded().run();
} }
else else
{ {
cout << "Staring in non-ssl mode" << endl; cout << "Staring in non-ssl mode" << endl;
app.port(app_port).multithreaded().run(); app.bindaddr(bindaddr).port(app_port).multithreaded().run();
} }

@ -51,6 +51,8 @@ namespace xmreg
"enable Monero total emission monitoring thread") "enable Monero total emission monitoring thread")
("port,p", value<string>()->default_value("8081"), ("port,p", value<string>()->default_value("8081"),
"default explorer port") "default explorer port")
("bindaddr,x", value<string>()->default_value("0.0.0.0"),
"default bind address for the explorer")
("testnet-url", value<string>()->default_value(""), ("testnet-url", value<string>()->default_value(""),
"you can specify testnet url, if you run it on mainnet or stagenet. link will show on front page to testnet explorer") "you can specify testnet url, if you run it on mainnet or stagenet. link will show on front page to testnet explorer")
("stagenet-url", value<string>()->default_value(""), ("stagenet-url", value<string>()->default_value(""),

Loading…
Cancel
Save