aboutsummaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2015-04-07 17:56:18 -0400
committerThomas Winget <tewinget@gmail.com>2015-04-07 17:56:18 -0400
commita8bc7182eaa39d8be61f5e2ed9d98184e5820f17 (patch)
tree08c5e2f911d2726662470dae48c53f5c17aa1e50 /src/daemon
parentupdated unbound cmake for static builds (diff)
parentMerges PR #37 (diff)
downloadmonero-a8bc7182eaa39d8be61f5e2ed9d98184e5820f17.tar.xz
Merge BlockchainDB into upstream
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/CMakeLists.txt1
-rw-r--r--src/daemon/command_line_args.h5
-rw-r--r--src/daemon/main.cpp15
3 files changed, 21 insertions, 0 deletions
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index f9c2af32a..bf25bbca9 100644
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -74,6 +74,7 @@ bitmonero_add_executable(daemon
target_link_libraries(daemon
LINK_PRIVATE
rpc
+ blockchain_db
cryptonote_core
crypto
common
diff --git a/src/daemon/command_line_args.h b/src/daemon/command_line_args.h
index bcf599128..2bd918478 100644
--- a/src/daemon/command_line_args.h
+++ b/src/daemon/command_line_args.h
@@ -70,6 +70,11 @@ namespace daemon_args
, "checkpoints from DNS server will be enforced"
, false
};
+ const command_line::arg_descriptor<std::string> arg_db_type = {
+ "db-type"
+ , "Specify database type"
+ , "lmdb"
+ };
} // namespace daemon_args
diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp
index d1e0cf671..71df34950 100644
--- a/src/daemon/main.cpp
+++ b/src/daemon/main.cpp
@@ -42,6 +42,7 @@
#include "rpc/core_rpc_server.h"
#include <boost/program_options.hpp>
#include "daemon/command_line_args.h"
+#include "blockchain_db/db_types.h"
namespace po = boost::program_options;
namespace bf = boost::filesystem;
@@ -84,6 +85,7 @@ int main(int argc, char const * argv[])
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);
daemonizer::init_options(hidden_options, visible_options);
daemonize::t_executor::init_options(core_settings);
@@ -136,6 +138,19 @@ 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);
+
+ // verify that blockchaindb type is valid
+ if(cryptonote::blockchain_db_types.count(db_type) == 0)
+ {
+ std::cout << "Invalid database type (" << db_type << "), available types are:" << std::endl;
+ for (const auto& type : cryptonote::blockchain_db_types)
+ {
+ std::cout << "\t" << type << std::endl;
+ }
+ return 0;
+ }
+
bool testnet_mode = command_line::get_arg(vm, daemon_args::arg_testnet_on);
auto data_dir_arg = testnet_mode ? command_line::arg_testnet_data_dir : command_line::arg_data_dir;