diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-12-09 10:30:17 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-12-09 10:30:20 +0200 |
commit | e175205e6e6314709aa1a8472f72be583771cd8a (patch) | |
tree | 8f659535b23d0ff35a0559fb274b39472513d25e /src/daemon | |
parent | Merge pull request #526 (diff) | |
parent | Register daemon command line arguments to core if they're used in core (diff) | |
download | monero-e175205e6e6314709aa1a8472f72be583771cd8a.tar.xz |
Merge pull request #527
336b375 Register daemon command line arguments to core if they're used in core (moneromooo-monero)
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/command_line_args.h | 41 | ||||
-rw-r--r-- | src/daemon/main.cpp | 17 |
2 files changed, 3 insertions, 55 deletions
diff --git a/src/daemon/command_line_args.h b/src/daemon/command_line_args.h index 48571cb96..798c34b62 100644 --- a/src/daemon/command_line_args.h +++ b/src/daemon/command_line_args.h @@ -60,47 +60,6 @@ namespace daemon_args "os-version" , "OS for which this executable was compiled" }; - const command_line::arg_descriptor<bool> arg_testnet_on = { - "testnet" - , "Run on testnet. The wallet must be launched with --testnet flag." - , false - }; - const command_line::arg_descriptor<bool> arg_dns_checkpoints = { - "enforce-dns-checkpointing" - , "checkpoints from DNS server will be enforced" - , false - }; - const command_line::arg_descriptor<std::string> arg_db_type = { - "db-type" - , "Specify database type" - , DEFAULT_DB_TYPE - }; - const command_line::arg_descriptor<uint64_t> arg_prep_blocks_threads = { - "prep-blocks-threads" - , "Max number of threads to use when preparing block hashes in groups." - , 4 - }; - const command_line::arg_descriptor<uint64_t> arg_fast_block_sync = { - "fast-block-sync" - , "Sync up most of the way by using embedded, known block hashes." - , 1 - }; - const command_line::arg_descriptor<uint64_t> arg_show_time_stats = { - "show-time-stats" - , "Show time-stats when processing blocks/txs and disk synchronization." - , 0 - }; - const command_line::arg_descriptor<uint64_t> arg_db_auto_remove_logs = { - "db-auto-remove-logs" - , "For BerkeleyDB only. Remove transactions logs automatically." - , 1 - }; - const command_line::arg_descriptor<std::string> arg_db_sync_mode = { - "db-sync-mode" - , "Specify sync option, using format [safe|fast|fastest]:[sync|async]:[nblocks_per_sync]." - , "fastest:async:1000" - }; -; } // namespace daemon_args #endif // DAEMON_COMMAND_LINE_ARGS_H diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index a8369f98d..68e375269 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -73,26 +73,15 @@ int main(int argc, char const * argv[]) command_line::add_arg(visible_options, command_line::arg_help); command_line::add_arg(visible_options, command_line::arg_version); command_line::add_arg(visible_options, daemon_args::arg_os_version); - command_line::add_arg(visible_options, command_line::arg_data_dir, default_data_dir.string()); - command_line::add_arg(visible_options, command_line::arg_testnet_data_dir, default_testnet_data_dir.string()); bf::path default_conf = default_data_dir / std::string(CRYPTONOTE_NAME ".conf"); command_line::add_arg(visible_options, daemon_args::arg_config_file, default_conf.string()); - command_line::add_arg(visible_options, command_line::arg_test_drop_download); command_line::add_arg(visible_options, command_line::arg_test_dbg_lock_sleep); - command_line::add_arg(visible_options, command_line::arg_test_drop_download_height); + cryptonote::core::init_options(core_settings); // Settings bf::path default_log = default_data_dir / std::string(CRYPTONOTE_NAME ".log"); command_line::add_arg(core_settings, daemon_args::arg_log_file, default_log.string()); command_line::add_arg(core_settings, daemon_args::arg_log_level); - command_line::add_arg(core_settings, daemon_args::arg_testnet_on); - command_line::add_arg(core_settings, daemon_args::arg_dns_checkpoints); - command_line::add_arg(core_settings, daemon_args::arg_db_type); - command_line::add_arg(core_settings, daemon_args::arg_prep_blocks_threads); - command_line::add_arg(core_settings, daemon_args::arg_fast_block_sync); - command_line::add_arg(core_settings, daemon_args::arg_db_sync_mode); - command_line::add_arg(core_settings, daemon_args::arg_show_time_stats); - command_line::add_arg(core_settings, daemon_args::arg_db_auto_remove_logs); daemonizer::init_options(hidden_options, visible_options); daemonize::t_executor::init_options(core_settings); @@ -146,7 +135,7 @@ int main(int argc, char const * argv[]) epee::g_test_dbg_lock_sleep = command_line::get_arg(vm, command_line::arg_test_dbg_lock_sleep); - std::string db_type = command_line::get_arg(vm, daemon_args::arg_db_type); + std::string db_type = command_line::get_arg(vm, command_line::arg_db_type); // verify that blockchaindb type is valid if(cryptonote::blockchain_db_types.count(db_type) == 0) @@ -159,7 +148,7 @@ int main(int argc, char const * argv[]) return 0; } - bool testnet_mode = command_line::get_arg(vm, daemon_args::arg_testnet_on); + bool testnet_mode = command_line::get_arg(vm, command_line::arg_testnet_on); auto data_dir_arg = testnet_mode ? command_line::arg_testnet_data_dir : command_line::arg_data_dir; |