Extracting nano::make_store in to its own files.
This commit is contained in:
parent
4eee8264f0
commit
90ced1a60c
17 changed files with 57 additions and 16 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <nano/lib/work.hpp>
|
||||
#include <nano/node/common.hpp>
|
||||
#include <nano/node/lmdb/lmdb.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/node/rocksdb/rocksdb.hpp>
|
||||
#include <nano/secure/ledger.hpp>
|
||||
#include <nano/secure/utility.hpp>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <nano/lib/stats.hpp>
|
||||
#include <nano/node/bootstrap_ascending/service.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/test_common/system.hpp>
|
||||
#include <nano/test_common/testutil.hpp>
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <nano/node/election.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/test_common/system.hpp>
|
||||
#include <nano/test_common/testutil.hpp>
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <nano/lib/stats.hpp>
|
||||
#include <nano/lib/threading.hpp>
|
||||
#include <nano/node/election.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/node/rocksdb/rocksdb.hpp>
|
||||
#include <nano/node/scheduler/component.hpp>
|
||||
#include <nano/node/scheduler/priority.hpp>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <nano/lib/config.hpp>
|
||||
#include <nano/node/election.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/node/scheduler/component.hpp>
|
||||
#include <nano/node/scheduler/manual.hpp>
|
||||
#include <nano/node/scheduler/priority.hpp>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <nano/lib/stats.hpp>
|
||||
#include <nano/lib/work.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/secure/ledger.hpp>
|
||||
#include <nano/secure/store.hpp>
|
||||
#include <nano/secure/utility.hpp>
|
||||
|
|
|
@ -143,6 +143,8 @@ add_library(
|
|||
lmdb/wallet_value.cpp
|
||||
logging.hpp
|
||||
logging.cpp
|
||||
make_store.hpp
|
||||
make_store.cpp
|
||||
network.hpp
|
||||
network.cpp
|
||||
nodeconfig.hpp
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <nano/lib/logger_mt.hpp>
|
||||
#include <nano/lib/stats.hpp>
|
||||
#include <nano/node/confirmation_height_unbounded.hpp>
|
||||
#include <nano/node/logging.hpp>
|
||||
|
|
15
nano/node/make_store.cpp
Normal file
15
nano/node/make_store.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <nano/node/lmdb/lmdb.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/node/rocksdb/rocksdb.hpp>
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
std::unique_ptr<nano::store> nano::make_store (nano::logger_mt & logger, boost::filesystem::path const & path, nano::ledger_constants & constants, bool read_only, bool add_db_postfix, nano::rocksdb_config const & rocksdb_config, nano::txn_tracking_config const & txn_tracking_config_a, std::chrono::milliseconds block_processor_batch_max_time_a, nano::lmdb_config const & lmdb_config_a, bool backup_before_upgrade)
|
||||
{
|
||||
if (rocksdb_config.enable)
|
||||
{
|
||||
return std::make_unique<nano::rocksdb::store> (logger, add_db_postfix ? path / "rocksdb" : path, constants, rocksdb_config, read_only);
|
||||
}
|
||||
|
||||
return std::make_unique<nano::lmdb::store> (logger, add_db_postfix ? path / "data.ldb" : path, constants, txn_tracking_config_a, block_processor_batch_max_time_a, lmdb_config_a, backup_before_upgrade);
|
||||
}
|
27
nano/node/make_store.hpp
Normal file
27
nano/node/make_store.hpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include <nano/lib/diagnosticsconfig.hpp>
|
||||
#include <nano/lib/lmdbconfig.hpp>
|
||||
#include <nano/lib/logger_mt.hpp>
|
||||
#include <nano/lib/rocksdbconfig.hpp>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace boost::filesystem
|
||||
{
|
||||
class path;
|
||||
}
|
||||
|
||||
namespace nano
|
||||
{
|
||||
class ledger_constants;
|
||||
class lmdb_config;
|
||||
class rocksdb_config;
|
||||
class store;
|
||||
class txn_tracking_config;
|
||||
}
|
||||
|
||||
namespace nano
|
||||
{
|
||||
std::unique_ptr<nano::store> make_store (nano::logger_mt & logger, boost::filesystem::path const & path, nano::ledger_constants & constants, bool open_read_only = false, bool add_db_postfix = true, nano::rocksdb_config const & rocksdb_config = nano::rocksdb_config{}, nano::txn_tracking_config const & txn_tracking_config_a = nano::txn_tracking_config{}, std::chrono::milliseconds block_processor_batch_max_time_a = std::chrono::milliseconds (5000), nano::lmdb_config const & lmdb_config_a = nano::lmdb_config{}, bool backup_before_upgrade = false);
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
#include <nano/lib/utility.hpp>
|
||||
#include <nano/node/common.hpp>
|
||||
#include <nano/node/daemonconfig.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/node/node.hpp>
|
||||
#include <nano/node/rocksdb/rocksdb.hpp>
|
||||
#include <nano/node/scheduler/component.hpp>
|
||||
|
@ -1570,13 +1571,3 @@ nano::node_flags const & nano::inactive_node_flag_defaults ()
|
|||
node_flags.disable_tcp_realtime = true;
|
||||
return node_flags;
|
||||
}
|
||||
|
||||
std::unique_ptr<nano::store> nano::make_store (nano::logger_mt & logger, boost::filesystem::path const & path, nano::ledger_constants & constants, bool read_only, bool add_db_postfix, nano::rocksdb_config const & rocksdb_config, nano::txn_tracking_config const & txn_tracking_config_a, std::chrono::milliseconds block_processor_batch_max_time_a, nano::lmdb_config const & lmdb_config_a, bool backup_before_upgrade)
|
||||
{
|
||||
if (rocksdb_config.enable)
|
||||
{
|
||||
return std::make_unique<nano::rocksdb::store> (logger, add_db_postfix ? path / "rocksdb" : path, constants, rocksdb_config, read_only);
|
||||
}
|
||||
|
||||
return std::make_unique<nano::lmdb::store> (logger, add_db_postfix ? path / "data.ldb" : path, constants, txn_tracking_config_a, block_processor_batch_max_time_a, lmdb_config_a, backup_before_upgrade);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <nano/lib/config.hpp>
|
||||
#include <nano/lib/logger_mt.hpp>
|
||||
#include <nano/lib/numbers.hpp>
|
||||
#include <nano/lib/rocksdbconfig.hpp>
|
||||
#include <nano/node/rocksdb/account_store.hpp>
|
||||
#include <nano/node/rocksdb/block_store.hpp>
|
||||
#include <nano/node/rocksdb/confirmation_height_store.hpp>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/qt/qt.hpp>
|
||||
#include <nano/test_common/network.hpp>
|
||||
#include <nano/test_common/system.hpp>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include <nano/lib/stats.hpp>
|
||||
#include <nano/lib/utility.hpp>
|
||||
#include <nano/lib/work.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/secure/common.hpp>
|
||||
#include <nano/secure/ledger.hpp>
|
||||
#include <nano/secure/store.hpp>
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <nano/crypto_lib/random_pool.hpp>
|
||||
#include <nano/lib/diagnosticsconfig.hpp>
|
||||
#include <nano/lib/lmdbconfig.hpp>
|
||||
#include <nano/lib/logger_mt.hpp>
|
||||
#include <nano/lib/memory.hpp>
|
||||
#include <nano/lib/rocksdbconfig.hpp>
|
||||
#include <nano/secure/buffer.hpp>
|
||||
#include <nano/secure/common.hpp>
|
||||
#include <nano/secure/versioning.hpp>
|
||||
|
@ -801,8 +797,6 @@ public:
|
|||
|
||||
virtual std::string vendor_get () const = 0;
|
||||
};
|
||||
|
||||
std::unique_ptr<nano::store> make_store (nano::logger_mt & logger, boost::filesystem::path const & path, nano::ledger_constants & constants, bool open_read_only = false, bool add_db_postfix = true, nano::rocksdb_config const & rocksdb_config = nano::rocksdb_config{}, nano::txn_tracking_config const & txn_tracking_config_a = nano::txn_tracking_config{}, std::chrono::milliseconds block_processor_batch_max_time_a = std::chrono::milliseconds (5000), nano::lmdb_config const & lmdb_config_a = nano::lmdb_config{}, bool backup_before_upgrade = false);
|
||||
}
|
||||
|
||||
namespace std
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include <nano/lib/thread_runner.hpp>
|
||||
#include <nano/lib/threading.hpp>
|
||||
#include <nano/node/election.hpp>
|
||||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/node/scheduler/component.hpp>
|
||||
#include <nano/node/scheduler/manual.hpp>
|
||||
#include <nano/node/scheduler/priority.hpp>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <nano/node/make_store.hpp>
|
||||
#include <nano/node/node.hpp>
|
||||
#include <nano/test_common/ledger.hpp>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue