|
|
@ -24,7 +24,8 @@ int main(int ac, const char* av[]) {
|
|
|
|
// get command line options
|
|
|
|
// get command line options
|
|
|
|
xmreg::CmdLineOptions opts {ac, av};
|
|
|
|
xmreg::CmdLineOptions opts {ac, av};
|
|
|
|
|
|
|
|
|
|
|
|
auto help_opt = opts.get_option<bool>("help");
|
|
|
|
auto help_opt = opts.get_option<bool>("help");
|
|
|
|
|
|
|
|
auto testnet_opt = opts.get_option<bool>("testnet");
|
|
|
|
|
|
|
|
|
|
|
|
// if help was chosen, display help text and finish
|
|
|
|
// if help was chosen, display help text and finish
|
|
|
|
if (*help_opt)
|
|
|
|
if (*help_opt)
|
|
|
@ -32,6 +33,8 @@ int main(int ac, const char* av[]) {
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool testnet {*testnet_opt};
|
|
|
|
|
|
|
|
|
|
|
|
auto port_opt = opts.get_option<string>("port");
|
|
|
|
auto port_opt = opts.get_option<string>("port");
|
|
|
|
auto bc_path_opt = opts.get_option<string>("bc-path");
|
|
|
|
auto bc_path_opt = opts.get_option<string>("bc-path");
|
|
|
|
auto custom_db_path_opt = opts.get_option<string>("custom-db-path");
|
|
|
|
auto custom_db_path_opt = opts.get_option<string>("custom-db-path");
|
|
|
@ -43,12 +46,14 @@ int main(int ac, const char* av[]) {
|
|
|
|
// get blockchain path
|
|
|
|
// get blockchain path
|
|
|
|
path blockchain_path;
|
|
|
|
path blockchain_path;
|
|
|
|
|
|
|
|
|
|
|
|
if (!xmreg::get_blockchain_path(bc_path_opt, blockchain_path))
|
|
|
|
if (!xmreg::get_blockchain_path(bc_path_opt, blockchain_path, testnet))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cerr << "Error getting blockchain path." << endl;
|
|
|
|
cerr << "Error getting blockchain path." << endl;
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cout << blockchain_path << endl;
|
|
|
|
|
|
|
|
|
|
|
|
// enable basic monero log output
|
|
|
|
// enable basic monero log output
|
|
|
|
xmreg::enable_monero_log();
|
|
|
|
xmreg::enable_monero_log();
|
|
|
|
|
|
|
|
|
|
|
@ -94,10 +99,18 @@ int main(int ac, const char* av[]) {
|
|
|
|
custom_db_path_str = xmreg::remove_trailing_path_separator(custom_db_path_str);
|
|
|
|
custom_db_path_str = xmreg::remove_trailing_path_separator(custom_db_path_str);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string deamon_url {*deamon_url_opt};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (testnet)
|
|
|
|
|
|
|
|
deamon_url = "http:://127.0.0.1:28081";
|
|
|
|
|
|
|
|
|
|
|
|
// create instance of page class which
|
|
|
|
// create instance of page class which
|
|
|
|
// contains logic for the website
|
|
|
|
// contains logic for the website
|
|
|
|
xmreg::page xmrblocks(&mcore, core_storage,
|
|
|
|
xmreg::page xmrblocks(&mcore, core_storage,
|
|
|
|
*deamon_url_opt, custom_db_path_str);
|
|
|
|
deamon_url,
|
|
|
|
|
|
|
|
custom_db_path_str,
|
|
|
|
|
|
|
|
testnet);
|
|
|
|
|
|
|
|
|
|
|
|
// crow instance
|
|
|
|
// crow instance
|
|
|
|
crow::SimpleApp app;
|
|
|
|
crow::SimpleApp app;
|
|
|
|