Compare commits

..

1 Commits

Author SHA1 Message Date
Denis Angell
74ce9743a7 compiling 2024-09-20 16:49:00 +02:00
5 changed files with 104 additions and 2 deletions

View File

@@ -145,6 +145,7 @@ target_link_libraries (xrpl_core
OpenSSL::Crypto
Ripple::boost
NIH::WasmEdge
NIH::MongoCxx
Ripple::syslibs
NIH::secp256k1
NIH::ed25519-donna

View File

@@ -0,0 +1,100 @@
#[===================================================================[
NIH dep: mongo: MongoDB C++ driver (bsoncxx and mongocxx).
#]===================================================================]
include(FetchContent)
FetchContent_Declare(
mongo_c_driver_src
GIT_REPOSITORY https://github.com/mongodb/mongo-c-driver.git
GIT_TAG 1.17.4
)
FetchContent_GetProperties(mongo_c_driver_src)
if(NOT mongo_c_driver_src_POPULATED)
message(STATUS "Pausing to download MongoDB C driver...")
FetchContent_Populate(mongo_c_driver_src)
endif()
set(MONGO_C_DRIVER_BUILD_DIR "${mongo_c_driver_src_BINARY_DIR}")
set(MONGO_C_DRIVER_INCLUDE_DIR "${mongo_c_driver_src_SOURCE_DIR}/src/libbson/src")
set(MONGO_C_DRIVER_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/mongo_c_install")
set(MONGO_C_DRIVER_CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
-DENABLE_STATIC=ON
-DENABLE_SHARED=OFF
-DCMAKE_INSTALL_PREFIX=${MONGO_C_DRIVER_INSTALL_PREFIX}
)
ExternalProject_Add(mongo_c_driver
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/mongo_c
SOURCE_DIR ${mongo_c_driver_src_SOURCE_DIR}
CMAKE_ARGS ${MONGO_C_DRIVER_CMAKE_ARGS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
INSTALL_COMMAND ${CMAKE_COMMAND} --install .
)
FetchContent_Declare(
mongo_cxx_driver_src
GIT_REPOSITORY https://github.com/mongodb/mongo-cxx-driver.git
GIT_TAG r3.10.2
)
FetchContent_GetProperties(mongo_cxx_driver_src)
if(NOT mongo_cxx_driver_src_POPULATED)
message(STATUS "Pausing to download MongoDB C++ driver...")
FetchContent_Populate(mongo_cxx_driver_src)
endif()
set(MONGO_CXX_DRIVER_BUILD_DIR "${mongo_cxx_driver_src_BINARY_DIR}")
set(MONGO_CXX_DRIVER_INCLUDE_DIR "${mongo_cxx_driver_src_SOURCE_DIR}/include")
set(MONGO_CXX_DRIVER_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/mongo_cxx_install")
set(MONGO_CXX_DRIVER_CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DBUILD_SHARED_AND_STATIC_LIBS=ON
-DBSONCXX_ENABLE_MONGOC=ON
-DCMAKE_INSTALL_PREFIX=${MONGO_CXX_DRIVER_INSTALL_PREFIX}
-DCMAKE_PREFIX_PATH=${MONGO_C_DRIVER_INSTALL_PREFIX}
)
ExternalProject_Add(mongo_cxx_driver
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/mongo_cxx
SOURCE_DIR ${mongo_cxx_driver_src_SOURCE_DIR}
CMAKE_ARGS ${MONGO_CXX_DRIVER_CMAKE_ARGS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
INSTALL_COMMAND ${CMAKE_COMMAND} --install .
DEPENDS mongo_c_driver
)
add_library(bsoncxx STATIC IMPORTED GLOBAL)
add_library(mongocxx STATIC IMPORTED GLOBAL)
add_dependencies(bsoncxx mongo_cxx_driver)
add_dependencies(mongocxx mongo_cxx_driver)
ExternalProject_Get_Property(mongo_cxx_driver BINARY_DIR)
execute_process(
COMMAND
mkdir -p "${BINARY_DIR}/include/bsoncxx/v_noabi"
mkdir -p "${BINARY_DIR}/include/mongocxx/v_noabi"
)
set_target_properties(bsoncxx PROPERTIES
IMPORTED_LOCATION "${MONGO_CXX_DRIVER_INSTALL_PREFIX}/lib/libbsoncxx-static.a"
INTERFACE_INCLUDE_DIRECTORIES "${MONGO_CXX_DRIVER_INSTALL_PREFIX}/include/bsoncxx/v_noabi"
)
set_target_properties(mongocxx PROPERTIES
IMPORTED_LOCATION "${MONGO_CXX_DRIVER_INSTALL_PREFIX}/lib/libmongocxx-static.a"
INTERFACE_INCLUDE_DIRECTORIES "${MONGO_CXX_DRIVER_INSTALL_PREFIX}/include/mongocxx/v_noabi"
)
# Link the C driver libraries
find_library(BSON_LIB bson-1.0 PATHS ${MONGO_C_DRIVER_INSTALL_PREFIX}/lib)
find_library(MONGOC_LIB mongoc-1.0 PATHS ${MONGO_C_DRIVER_INSTALL_PREFIX}/lib)
target_link_libraries(ripple_libs INTERFACE bsoncxx mongocxx ${BSON_LIB} ${MONGOC_LIB})
add_library(NIH::MongoCxx ALIAS mongocxx)

View File

@@ -75,6 +75,7 @@ include(deps/gRPC)
include(deps/cassandra)
include(deps/Postgres)
include(deps/WasmEdge)
include(deps/Mongo)
###

View File

@@ -111,7 +111,7 @@ public:
std::uint32_t minimumTxnInLedgerSA = 1000;
/// Number of transactions per ledger that fee escalation "works
/// towards".
std::uint32_t targetTxnInLedger = 1000;
std::uint32_t targetTxnInLedger = 256;
/** Optional maximum allowed value of transactions per ledger before
fee escalation kicks in. By default, the maximum is an emergent
property of network, validator, and consensus performance. This

View File

@@ -240,7 +240,7 @@ public:
bool LEDGER_REPLAY = false;
// Work queue limits
int MAX_TRANSACTIONS = 1000;
int MAX_TRANSACTIONS = 250;
static constexpr int MAX_JOB_QUEUE_TX = 1000;
static constexpr int MIN_JOB_QUEUE_TX = 100;