Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
cmake: Do not build with rocksdb by default
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jun 18, 2019
1 parent 09ee501 commit 57a78bd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Changed: [#5602](https://github.com/ethereum/aleth/pull/5602) Better predicting external IP address and UDP port.
- Changed: [#5605](https://github.com/ethereum/aleth/pull/5605) Network logging bugfixes and improvements and add warpcap log channel.
- Changed: [#5628](https://github.com/ethereum/aleth/pull/5628) Don't try to endlessly reconnect to official Ethereum bootnodes.
- Changed: [#5632](https://github.com/ethereum/aleth/pull/5632) RocksDB support is disabled by default. Enable with `-DROCKSB=ON` CMake option.
- Fixed: [#5562](https://github.com/ethereum/aleth/pull/5562) Don't send header request messages to peers that haven't sent us Status yet.
- Fixed: [#5581](https://github.com/ethereum/aleth/pull/5581) Fixed finding neighbour nodes in Discovery.
- Fixed: [#5599](https://github.com/ethereum/aleth/pull/5600) Prevent aleth from attempting concurrent connection to node which results in disconnect of original connection.
Expand Down
3 changes: 2 additions & 1 deletion cmake/EthOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ macro(configure_project)
option(PARANOID "Enable additional checks when validating transactions (deprecated)" OFF)
option(MINIUPNPC "Build with UPnP support" OFF)
option(FASTCTEST "Enable fast ctest" OFF)
option(ROCKSDB "Build with rocksdb as optional database implementation" OFF)

if(MINIUPNPC)
message(WARNING
Expand Down Expand Up @@ -71,7 +72,7 @@ macro(print_config)
message("--------------------------------------------------------------- features")
message("-- EVM_OPTIMIZE Enable VM optimizations ${EVM_OPTIMIZE}")
message("-- FATDB Full database exploring ${FATDB}")
message("-- DB Database implementation LEVELDB")
message("-- ROCKSDB RocksDB as optional DB implementation ${ROCKSDB}")
message("-- PARANOID - ${PARANOID}")
message("-- MINIUPNPC - ${MINIUPNPC}")
message("------------------------------------------------------------- components")
Expand Down
12 changes: 7 additions & 5 deletions libdevcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ add_library(
OverlayDB.h
RLP.cpp
RLP.h
RocksDB.cpp
RocksDB.h
SHA3.cpp
SHA3.h
StateCacheDB.cpp
Expand Down Expand Up @@ -68,6 +66,10 @@ hunter_add_package(leveldb)
find_package(leveldb CONFIG REQUIRED)
target_link_libraries(devcore PRIVATE leveldb::leveldb)

hunter_add_package(rocksdb)
find_package(RocksDB CONFIG REQUIRED)
target_link_libraries(devcore PRIVATE RocksDB::rocksdb)
if(ROCKSDB)
hunter_add_package(rocksdb)
find_package(RocksDB CONFIG REQUIRED)
target_sources(devcore PRIVATE RocksDB.cpp RocksDB.h)
target_link_libraries(devcore PRIVATE RocksDB::rocksdb)
target_compile_definitions(devcore PRIVATE ALETH_ROCKSDB)
endif()
9 changes: 8 additions & 1 deletion libdevcore/DBFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
#include "DBFactory.h"
#include "FileSystem.h"
#include "LevelDB.h"
#include "RocksDB.h"
#include "MemoryDB.h"
#include "libethcore/Exceptions.h"

#if ALETH_ROCKSDB
#include "RocksDB.h"
#endif

namespace dev
{
namespace db
Expand All @@ -48,7 +51,9 @@ struct DBKindTableEntry
/// so linear search only to parse command line arguments is not a problem.
DBKindTableEntry dbKindsTable[] = {
{DatabaseKind::LevelDB, "leveldb"},
#if ALETH_ROCKSDB
{DatabaseKind::RocksDB, "rocksdb"},
#endif
{DatabaseKind::MemoryDB, "memorydb"},
};

Expand Down Expand Up @@ -154,9 +159,11 @@ std::unique_ptr<DatabaseFace> DBFactory::create(DatabaseKind _kind, fs::path con
case DatabaseKind::LevelDB:
return std::unique_ptr<DatabaseFace>(new LevelDB(_path));
break;
#if ALETH_ROCKSDB
case DatabaseKind::RocksDB:
return std::unique_ptr<DatabaseFace>(new RocksDB(_path));
break;
#endif
case DatabaseKind::MemoryDB:
// Silently ignore path since the concept of a db path doesn't make sense
// when using an in-memory database
Expand Down

0 comments on commit 57a78bd

Please sign in to comment.