aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-03-05 19:11:20 +0200
committerRiccardo Spagni <ric@spagni.net>2018-03-05 19:11:20 +0200
commit4f93f745284c10f12e2524f5211030085d9626cf (patch)
tree29b5f359a8f346305bcf7bf82f459f421bfaa7a7 /src/blockchain_utilities
parentMerge pull request #3273 (diff)
parentWallet API: generalize 'bool testnet' to 'NetworkType nettype' (diff)
downloadmonero-4f93f745284c10f12e2524f5211030085d9626cf.tar.xz
Merge pull request #3277
0e7ad2e2 Wallet API: generalize 'bool testnet' to 'NetworkType nettype' (stoffu) af773211 Stagenet (stoffu) cc9a0bee command_line: allow args to depend on more than one args (stoffu) 55f8d917 command_line::get_arg: remove 'required' for dependent args as they're always optional (stoffu) 450306a0 command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318 (stoffu) 9f9e095a Use `genesis_tx` parameter in `generate_genesis_block`. #3261 (Jean Pierre Dudey)
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_export.cpp10
-rw-r--r--src/blockchain_utilities/blockchain_import.cpp11
2 files changed, 16 insertions, 5 deletions
diff --git a/src/blockchain_utilities/blockchain_export.cpp b/src/blockchain_utilities/blockchain_export.cpp
index b3e11605d..5a49f3478 100644
--- a/src/blockchain_utilities/blockchain_export.cpp
+++ b/src/blockchain_utilities/blockchain_export.cpp
@@ -58,7 +58,6 @@ int main(int argc, char* argv[])
tools::on_startup();
- boost::filesystem::path default_data_path {tools::get_default_data_dir()};
boost::filesystem::path output_file_path;
po::options_description desc_cmd_only("Command line options");
@@ -75,6 +74,7 @@ int main(int argc, char* argv[])
command_line::add_arg(desc_cmd_sett, cryptonote::arg_data_dir);
command_line::add_arg(desc_cmd_sett, arg_output_file);
command_line::add_arg(desc_cmd_sett, cryptonote::arg_testnet_on);
+ command_line::add_arg(desc_cmd_sett, cryptonote::arg_stagenet_on);
command_line::add_arg(desc_cmd_sett, arg_log_level);
command_line::add_arg(desc_cmd_sett, arg_database);
command_line::add_arg(desc_cmd_sett, arg_block_stop);
@@ -112,6 +112,12 @@ int main(int argc, char* argv[])
LOG_PRINT_L0("Starting...");
bool opt_testnet = command_line::get_arg(vm, cryptonote::arg_testnet_on);
+ bool opt_stagenet = command_line::get_arg(vm, cryptonote::arg_stagenet_on);
+ if (opt_testnet && opt_stagenet)
+ {
+ std::cerr << "Can't specify more than one of --testnet and --stagenet" << std::endl;
+ return 1;
+ }
bool opt_blocks_dat = command_line::get_arg(vm, arg_blocks_dat);
std::string m_config_folder;
@@ -169,7 +175,7 @@ int main(int argc, char* argv[])
LOG_PRINT_L0("Error opening database: " << e.what());
return 1;
}
- r = core_storage->init(db, opt_testnet);
+ r = core_storage->init(db, opt_testnet ? cryptonote::TESTNET : opt_stagenet ? cryptonote::STAGENET : cryptonote::MAINNET);
CHECK_AND_ASSERT_MES(r, 1, "Failed to initialize source blockchain storage");
LOG_PRINT_L0("Source blockchain storage initialized OK");
diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp
index 6195e47e7..caa549c13 100644
--- a/src/blockchain_utilities/blockchain_import.cpp
+++ b/src/blockchain_utilities/blockchain_import.cpp
@@ -53,6 +53,7 @@ bool opt_batch = true;
bool opt_verify = true; // use add_new_block, which does verification before calling add_block
bool opt_resume = true;
bool opt_testnet = true;
+bool opt_stagenet = true;
// number of blocks per batch transaction
// adjustable through command-line argument according to available RAM
@@ -574,8 +575,6 @@ int main(int argc, char* argv[])
tools::on_startup();
- boost::filesystem::path default_data_path {tools::get_default_data_dir()};
- boost::filesystem::path default_testnet_data_path {default_data_path / "testnet"};
std::string import_file_path;
po::options_description desc_cmd_only("Command line options");
@@ -671,6 +670,12 @@ int main(int argc, char* argv[])
}
opt_testnet = command_line::get_arg(vm, cryptonote::arg_testnet_on);
+ opt_stagenet = command_line::get_arg(vm, cryptonote::arg_stagenet_on);
+ if (opt_testnet && opt_stagenet)
+ {
+ std::cerr << "Error: Can't specify more than one of --testnet and --stagenet" << ENDL;
+ return 1;
+ }
m_config_folder = command_line::get_arg(vm, cryptonote::arg_data_dir);
db_arg_str = command_line::get_arg(vm, arg_database);
@@ -728,7 +733,7 @@ int main(int argc, char* argv[])
MINFO("batch: " << std::boolalpha << opt_batch << std::noboolalpha);
}
MINFO("resume: " << std::boolalpha << opt_resume << std::noboolalpha);
- MINFO("testnet: " << std::boolalpha << opt_testnet << std::noboolalpha);
+ MINFO("nettype: " << (opt_testnet ? "testnet" : opt_stagenet ? "stagenet" : "mainnet"));
MINFO("bootstrap file path: " << import_file_path);
MINFO("database path: " << m_config_folder);