diff options
author | Zachary Michaels <mikezackles@gmail.com> | 2014-07-16 13:30:15 -0400 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-09-15 15:53:01 +0200 |
commit | 07470fd400ee30b84f6227edffb24094d03781cb (patch) | |
tree | 6399848a2020528971884f5f625d0a2403f92327 /src/daemon/daemon.cpp | |
parent | increase ABSTRACT_SERVER_SEND_QUE_MAX_COUNT to a more sane value (diff) | |
download | monero-07470fd400ee30b84f6227edffb24094d03781cb.tar.xz |
Add testnet flag
Source: cryptonotefoundation
Diffstat (limited to 'src/daemon/daemon.cpp')
-rw-r--r-- | src/daemon/daemon.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index 187970359..1041aa439 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -62,6 +62,8 @@ namespace const command_line::arg_descriptor<std::string> arg_log_file = {"log-file", "", ""}; const command_line::arg_descriptor<int> arg_log_level = {"log-level", "", LOG_LEVEL_0}; const command_line::arg_descriptor<bool> arg_console = {"no-console", "Disable daemon console commands"}; + const command_line::arg_descriptor<bool> arg_testnet_on = {"testnet", "Used to deploy test nets. Checkpoints and hardcoded seeds are ignored, " + "network id is changed. Use it with --data-dir flag. The wallet must be launched with --testnet flag.", false}; } bool command_line_preprocessor(const boost::program_options::variables_map& vm) @@ -123,7 +125,7 @@ int main(int argc, char* argv[]) command_line::add_arg(desc_cmd_sett, arg_log_file); command_line::add_arg(desc_cmd_sett, arg_log_level); command_line::add_arg(desc_cmd_sett, arg_console); - + command_line::add_arg(desc_cmd_sett, arg_testnet_on); cryptonote::core::init_options(desc_cmd_sett); cryptonote::core_rpc_server::init_options(desc_cmd_sett); @@ -191,7 +193,14 @@ int main(int argc, char* argv[]) //create objects and link them cryptonote::core ccore(NULL); - ccore.set_checkpoints(std::move(checkpoints)); + + bool testnet_mode = command_line::get_arg(vm, arg_testnet_on); + if (testnet_mode) { + LOG_PRINT_L0("Starting in testnet mode!"); + } else { + ccore.set_checkpoints(std::move(checkpoints)); + } + cryptonote::t_cryptonote_protocol_handler<cryptonote::core> cprotocol(ccore, NULL); nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core> > p2psrv(cprotocol); cryptonote::core_rpc_server rpc_server(ccore, p2psrv); @@ -201,7 +210,7 @@ int main(int argc, char* argv[]) //initialize objects LOG_PRINT_L0("Initializing P2P server..."); - res = p2psrv.init(vm); + res = p2psrv.init(vm, testnet_mode); CHECK_AND_ASSERT_MES(res, 1, "Failed to initialize P2P server."); LOG_PRINT_L0("P2P server initialized OK"); @@ -217,7 +226,7 @@ int main(int argc, char* argv[]) //initialize core here LOG_PRINT_L0("Initializing core..."); - res = ccore.init(vm); + res = ccore.init(vm, testnet_mode); CHECK_AND_ASSERT_MES(res, 1, "Failed to initialize core"); LOG_PRINT_L0("Core initialized OK"); |