From 551664c57a5411ebfc91b2d9590a183730d52c0e Mon Sep 17 00:00:00 2001 From: evoskuil Date: Tue, 13 Feb 2024 10:31:15 -0500 Subject: [PATCH 1/2] Stub in chaser event handlers. --- .../bitcoin/node/chasers/chaser_candidate.hpp | 2 ++ include/bitcoin/node/chasers/chaser_check.hpp | 4 ++- .../bitcoin/node/chasers/chaser_confirm.hpp | 2 ++ .../bitcoin/node/chasers/chaser_connect.hpp | 2 ++ .../bitcoin/node/chasers/chaser_header.hpp | 3 ++ .../node/chasers/chaser_transaction.hpp | 3 ++ src/chasers/chaser_candidate.cpp | 21 ++++++++++++-- src/chasers/chaser_check.cpp | 28 ++++++++++++++---- src/chasers/chaser_confirm.cpp | 21 ++++++++++++-- src/chasers/chaser_connect.cpp | 21 ++++++++++++-- src/chasers/chaser_header.cpp | 10 ++++++- src/chasers/chaser_transaction.cpp | 29 +++++++++++++++++-- 12 files changed, 126 insertions(+), 20 deletions(-) diff --git a/include/bitcoin/node/chasers/chaser_candidate.hpp b/include/bitcoin/node/chasers/chaser_candidate.hpp index e5760a6c..b73f7593 100644 --- a/include/bitcoin/node/chasers/chaser_candidate.hpp +++ b/include/bitcoin/node/chasers/chaser_candidate.hpp @@ -38,6 +38,8 @@ class BCN_API chaser_candidate chaser_candidate(full_node& node) NOEXCEPT; private: + void handle_start() NOEXCEPT; + void handle_transaction() NOEXCEPT; void handle_event(const code& ec, chase event_, link value) NOEXCEPT; void do_handle_event(const code& ec, chase event_, link value) NOEXCEPT; }; diff --git a/include/bitcoin/node/chasers/chaser_check.hpp b/include/bitcoin/node/chasers/chaser_check.hpp index 59b7891c..35d51f49 100644 --- a/include/bitcoin/node/chasers/chaser_check.hpp +++ b/include/bitcoin/node/chasers/chaser_check.hpp @@ -37,9 +37,11 @@ class BCN_API chaser_check chaser_check(full_node& node) NOEXCEPT; - void store(const system::chain::block::cptr& block) NOEXCEPT; + void checked(const system::chain::block::cptr& block) NOEXCEPT; private: + void handle_start() NOEXCEPT; + void handle_header() NOEXCEPT; void handle_event(const code& ec, chase event_, link value) NOEXCEPT; void do_handle_event(const code& ec, chase event_, link value) NOEXCEPT; }; diff --git a/include/bitcoin/node/chasers/chaser_confirm.hpp b/include/bitcoin/node/chasers/chaser_confirm.hpp index 54a54c8e..7d0cc122 100644 --- a/include/bitcoin/node/chasers/chaser_confirm.hpp +++ b/include/bitcoin/node/chasers/chaser_confirm.hpp @@ -38,6 +38,8 @@ class BCN_API chaser_confirm chaser_confirm(full_node& node) NOEXCEPT; private: + void handle_start() NOEXCEPT; + void handle_connected() NOEXCEPT; void handle_event(const code& ec, chase event_, link value) NOEXCEPT; void do_handle_event(const code& ec, chase event_, link value) NOEXCEPT; }; diff --git a/include/bitcoin/node/chasers/chaser_connect.hpp b/include/bitcoin/node/chasers/chaser_connect.hpp index 08d7579a..47c76283 100644 --- a/include/bitcoin/node/chasers/chaser_connect.hpp +++ b/include/bitcoin/node/chasers/chaser_connect.hpp @@ -38,6 +38,8 @@ class BCN_API chaser_connect chaser_connect(full_node& node) NOEXCEPT; private: + void handle_start() NOEXCEPT; + void handle_checked() NOEXCEPT; void handle_event(const code& ec, chase event_, link value) NOEXCEPT; void do_handle_event(const code& ec, chase event_, link value) NOEXCEPT; }; diff --git a/include/bitcoin/node/chasers/chaser_header.hpp b/include/bitcoin/node/chasers/chaser_header.hpp index 02e3cd80..bfe046f5 100644 --- a/include/bitcoin/node/chasers/chaser_header.hpp +++ b/include/bitcoin/node/chasers/chaser_header.hpp @@ -42,10 +42,13 @@ class BCN_API chaser_header private: bool is_current(const system::chain::header& header) const NOEXCEPT; bool is_strong(const system::chain::header& header) const NOEXCEPT; + + void handle_start() NOEXCEPT; void handle_event(const code& ec, chase event_, link value) NOEXCEPT; void do_handle_event(const code& ec, chase event_, link value) NOEXCEPT; void do_store(const system::chain::header::cptr& header) NOEXCEPT; + // These are protected by strand. const network::wall_clock::duration currency_window_; std::vector chain_{}; }; diff --git a/include/bitcoin/node/chasers/chaser_transaction.hpp b/include/bitcoin/node/chasers/chaser_transaction.hpp index b674b746..53fa4d0d 100644 --- a/include/bitcoin/node/chasers/chaser_transaction.hpp +++ b/include/bitcoin/node/chasers/chaser_transaction.hpp @@ -40,8 +40,11 @@ class BCN_API chaser_transaction void store(const system::chain::transaction::cptr& block) NOEXCEPT; private: + void handle_start() NOEXCEPT; + void handle_confirmed() NOEXCEPT; void handle_event(const code& ec, chase event_, link value) NOEXCEPT; void do_handle_event(const code& ec, chase event_, link value) NOEXCEPT; + void do_store(const system::chain::transaction::cptr& header) NOEXCEPT; }; } // namespace node diff --git a/src/chasers/chaser_candidate.cpp b/src/chasers/chaser_candidate.cpp index 82c8cd5e..e69e2c3e 100644 --- a/src/chasers/chaser_candidate.cpp +++ b/src/chasers/chaser_candidate.cpp @@ -50,23 +50,38 @@ void chaser_candidate::do_handle_event(const code& ec, chase event_, { BC_ASSERT_MSG(stranded(), "chaser_candidate"); - // The code should be error::service_stopped when error::stop is set. if (ec) return; switch (event_) { case chase::start: - // TODO: initialize. + { + handle_start(); break; + } case chase::transaction: - // TODO: handle transaction graph change (may issue 'candidate'). + { + handle_transaction(); break; + } default: return; } } +// TODO: initialize candidate state. +void chaser_candidate::handle_start() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_candidate"); +} + +// TODO: handle transaction graph change (may issue 'candidate'). +void chaser_candidate::handle_transaction() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_candidate"); +} + BC_POP_WARNING() } // namespace database diff --git a/src/chasers/chaser_check.cpp b/src/chasers/chaser_check.cpp index 6aee01f7..830bea7b 100644 --- a/src/chasers/chaser_check.cpp +++ b/src/chasers/chaser_check.cpp @@ -50,27 +50,43 @@ void chaser_check::do_handle_event(const code& ec, chase event_, link) NOEXCEPT { BC_ASSERT_MSG(stranded(), "chaser_check"); - // The code should be error::service_stopped when error::stop is set. if (ec) return; switch (event_) { case chase::start: - // TODO: initialize. + { + handle_start(); break; + } case chase::header: - // TODO: handle the new strong branch (may issue 'checked'). + { + handle_header(); break; + } default: return; } } -void chaser_check::store(const block::cptr&) NOEXCEPT +// TODO: initialize check state. +void chaser_check::handle_start() NOEXCEPT { - // Push checked block into store and issue checked event so that connect - // can connect the next blocks in order, as applicable. + BC_ASSERT_MSG(stranded(), "chaser_check"); +} + +// TODO: handle the new strong branch (may issue 'checked'). +void chaser_check::handle_header() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_check"); +} + +// TODO: pass link? +void chaser_check::checked(const block::cptr&) NOEXCEPT +{ + // Push checked block into store and issue 'checked' event so that connect + // can connect the next blocks in order. Executes in caller thread. } BC_POP_WARNING() diff --git a/src/chasers/chaser_confirm.cpp b/src/chasers/chaser_confirm.cpp index 8be08ac1..ff78dd33 100644 --- a/src/chasers/chaser_confirm.cpp +++ b/src/chasers/chaser_confirm.cpp @@ -50,23 +50,38 @@ void chaser_confirm::do_handle_event(const code& ec, chase event_, { BC_ASSERT_MSG(stranded(), "chaser_confirm"); - // The code should be error::service_stopped when error::stop is set. if (ec) return; switch (event_) { case chase::start: - // TODO: initialize. + { + handle_start(); break; + } case chase::connected: - // TODO: handle new strong connected branch (may issue 'confirmed'). + { + handle_connected(); break; + } default: return; } } +// TODO: initialize confirm state. +void chaser_confirm::handle_start() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_confirm"); +} + +// TODO: handle new strong connected branch (may issue 'confirmed'). +void chaser_confirm::handle_connected() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_confirm"); +} + BC_POP_WARNING() } // namespace database diff --git a/src/chasers/chaser_connect.cpp b/src/chasers/chaser_connect.cpp index 9a67b63a..e6f0cf73 100644 --- a/src/chasers/chaser_connect.cpp +++ b/src/chasers/chaser_connect.cpp @@ -50,23 +50,38 @@ void chaser_connect::do_handle_event(const code& ec, chase event_, { BC_ASSERT_MSG(stranded(), "chaser_connect"); - // The code should be error::service_stopped when error::stop is set. if (ec) return; switch (event_) { case chase::start: - // TODO: initialize. + { + handle_start(); break; + } case chase::checked: - // TODO: handle the new checked blocks (may issue 'connected'). + { + handle_checked(); break; + } default: return; } } +// TODO: initialize connect state. +void chaser_connect::handle_start() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_connect"); +} + +// TODO: handle the new checked blocks (may issue 'connected'). +void chaser_connect::handle_checked() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_connect"); +} + BC_POP_WARNING() } // namespace database diff --git a/src/chasers/chaser_header.cpp b/src/chasers/chaser_header.cpp index b26c8836..c2d45358 100644 --- a/src/chasers/chaser_header.cpp +++ b/src/chasers/chaser_header.cpp @@ -60,13 +60,21 @@ void chaser_header::do_handle_event(const code& ec, chase event_, link) NOEXCEPT switch (event_) { case chase::start: - // TODO: initialize header tree from store. + { + handle_start(); break; + } default: return; } } +// TODO: initialize header tree from store, log and stop on error. +void chaser_header::handle_start() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_header"); +} + // private bool chaser_header::is_current(const header& header) const NOEXCEPT { diff --git a/src/chasers/chaser_transaction.cpp b/src/chasers/chaser_transaction.cpp index ac518384..7069dcb5 100644 --- a/src/chasers/chaser_transaction.cpp +++ b/src/chasers/chaser_transaction.cpp @@ -51,29 +51,52 @@ void chaser_transaction::do_handle_event(const code& ec, chase event_, { BC_ASSERT_MSG(stranded(), "chaser_transaction"); - // The code should be error::service_stopped when error::stop is set. if (ec) return; switch (event_) { case chase::start: - // TODO: initialize. + { + handle_start(); break; + } case chase::confirmed: - // TODO: handle the new confirmed blocks (may issue 'transaction'). + { + handle_confirmed(); break; + } default: return; } } +// TODO: initialize tx graph from store, log and stop on error. +void chaser_transaction::handle_start() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_transaction"); +} + +// TODO: handle the new confirmed blocks (may issue 'transaction'). +void chaser_transaction::handle_confirmed() NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_transaction"); +} + void chaser_transaction::store(const transaction::cptr&) NOEXCEPT { // Push new checked tx into store and update DAG. Issue transaction event // so that candidate may construct a new template. } +// private +void chaser_transaction::do_store(const transaction::cptr&) NOEXCEPT +{ + BC_ASSERT_MSG(stranded(), "chaser_transaction"); + + // TODO: validate and store transaction. +} + BC_POP_WARNING() } // namespace database From 0b23c221ece501d8d211b2bd86b66c5138c366c6 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Wed, 14 Feb 2024 10:12:16 -0500 Subject: [PATCH 2/2] Regenerate artifacts to remove -blockchain and add -consensus. --- .github/workflows/ci.yml | 19 ++--- Makefile.am | 12 ++-- build.cmd | 11 +-- builds/cmake/CMakeLists.txt | 63 +++++++++++----- .../cmake/modules/FindBitcoin-Consensus.cmake | 60 ++++++++++++++++ .../cmake/modules/FindBitcoin-Database.cmake | 60 ++++++++++++++++ builds/msvc/vs2022/bn/bn.props | 7 +- .../libbitcoin-node-test.props | 5 -- .../libbitcoin-node/libbitcoin-node.props | 7 +- configure.ac | 72 ++++++++++++++----- install-cmake.sh | 10 --- install-cmakepresets.sh | 23 +----- install.sh | 10 --- libbitcoin-node.pc.in | 2 +- 14 files changed, 246 insertions(+), 115 deletions(-) create mode 100644 builds/cmake/modules/FindBitcoin-Consensus.cmake create mode 100644 builds/cmake/modules/FindBitcoin-Database.cmake diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9123e9c..d150d307 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,9 +187,10 @@ jobs: - name: Coveralls.io Upload if: ${{ matrix.coverage == 'cov' }} - uses: pmienk/coveralls-github-action@master + uses: coverallsapp/github-action@v2.2.3 with: - path-to-lcov: "./coverage.info" + format: lcov + files: "./coverage.info" github-token: ${{ secrets.github_token }} - name: Failure display available binaries @@ -420,9 +421,10 @@ jobs: - name: Coveralls.io Upload if: ${{ matrix.coverage == 'cov' }} - uses: pmienk/coveralls-github-action@master + uses: coverallsapp/github-action@v2.2.3 with: - path-to-lcov: "./coverage.info" + format: lcov + files: "./coverage.info" github-token: ${{ secrets.github_token }} - name: Failure display available binaries @@ -622,9 +624,10 @@ jobs: - name: Coveralls.io Upload if: ${{ matrix.coverage == 'cov' }} - uses: pmienk/coveralls-github-action@master + uses: coverallsapp/github-action@v2.2.3 with: - path-to-lcov: "./coverage.info" + format: lcov + files: "./coverage.info" github-token: ${{ secrets.github_token }} - name: Failure display available binaries @@ -707,7 +710,7 @@ jobs: steps: - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 with: msbuild-architecture: x64 @@ -737,7 +740,7 @@ jobs: } - name: Execute build - run: .\build.cmd .. ${{ matrix.platform }} ${{ matrix.configuration }} ${{ matrix.version }} + run: .\build.cmd .. ${{ matrix.platform }} ${{ matrix.configuration }} x64 ${{ matrix.version }} - name: Execute tests shell: powershell diff --git a/Makefile.am b/Makefile.am index 5255bad4..a362b1b2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,8 +32,8 @@ doc_DATA = \ # src/libbitcoin-node.la => ${libdir} #------------------------------------------------------------------------------ lib_LTLIBRARIES = src/libbitcoin-node.la -src_libbitcoin_node_la_CPPFLAGS = -I${srcdir}/include -DSYSCONFDIR=\"${sysconfdir}\" ${bitcoin_blockchain_BUILD_CPPFLAGS} ${bitcoin_network_BUILD_CPPFLAGS} -src_libbitcoin_node_la_LIBADD = ${bitcoin_blockchain_LIBS} ${bitcoin_network_LIBS} +src_libbitcoin_node_la_CPPFLAGS = -I${srcdir}/include -DSYSCONFDIR=\"${sysconfdir}\" ${bitcoin_database_BUILD_CPPFLAGS} ${bitcoin_consensus_BUILD_CPPFLAGS} ${bitcoin_network_BUILD_CPPFLAGS} +src_libbitcoin_node_la_LIBADD = ${bitcoin_database_LIBS} ${bitcoin_consensus_LIBS} ${bitcoin_network_LIBS} src_libbitcoin_node_la_SOURCES = \ src/configuration.cpp \ src/error.cpp \ @@ -68,8 +68,8 @@ if WITH_TESTS TESTS = libbitcoin-node-test_runner.sh check_PROGRAMS = test/libbitcoin-node-test -test_libbitcoin_node_test_CPPFLAGS = -I${srcdir}/include ${bitcoin_blockchain_BUILD_CPPFLAGS} ${bitcoin_network_BUILD_CPPFLAGS} -test_libbitcoin_node_test_LDADD = src/libbitcoin-node.la ${boost_unit_test_framework_LIBS} ${bitcoin_blockchain_LIBS} ${bitcoin_network_LIBS} +test_libbitcoin_node_test_CPPFLAGS = -I${srcdir}/include ${bitcoin_database_BUILD_CPPFLAGS} ${bitcoin_consensus_BUILD_CPPFLAGS} ${bitcoin_network_BUILD_CPPFLAGS} +test_libbitcoin_node_test_LDADD = src/libbitcoin-node.la ${boost_unit_test_framework_LIBS} ${bitcoin_database_LIBS} ${bitcoin_consensus_LIBS} ${bitcoin_network_LIBS} test_libbitcoin_node_test_SOURCES = \ test/configuration.cpp \ test/error.cpp \ @@ -86,8 +86,8 @@ endif WITH_TESTS if WITH_CONSOLE bin_PROGRAMS = console/bn -console_bn_CPPFLAGS = -I${srcdir}/include ${bitcoin_blockchain_BUILD_CPPFLAGS} ${bitcoin_network_BUILD_CPPFLAGS} -console_bn_LDADD = src/libbitcoin-node.la ${bitcoin_blockchain_LIBS} ${bitcoin_network_LIBS} +console_bn_CPPFLAGS = -I${srcdir}/include ${bitcoin_database_BUILD_CPPFLAGS} ${bitcoin_consensus_BUILD_CPPFLAGS} ${bitcoin_network_BUILD_CPPFLAGS} +console_bn_LDADD = src/libbitcoin-node.la ${bitcoin_database_LIBS} ${bitcoin_consensus_LIBS} ${bitcoin_network_LIBS} console_bn_SOURCES = \ console/executor.cpp \ console/executor.hpp \ diff --git a/build.cmd b/build.cmd index d85d060c..9486b37f 100644 --- a/build.cmd +++ b/build.cmd @@ -11,10 +11,10 @@ SET "relative_path_base=%~1" call cd /d "%relative_path_base%" SET "path_base=%cd%" SET "nuget_pkg_path=%path_base%\.nuget\packages" -SET "msbuild_args=/verbosity:minimal /p:Platform=%~2 /p:Configuration=%~3" -SET "proj_version=%~4" +SET "msbuild_args=/verbosity:minimal /p:Platform=%~2 /p:Configuration=%~3 /p:PreferredToolArchitecture=%~4" +SET "proj_version=%~5" SET "msbuild_exe=msbuild" -IF EXIST "%~5" SET "msbuild_exe=%~5" +IF EXIST "%~6" SET "msbuild_exe=%~6" call :pending "Build initialized..." IF NOT EXIST "%nuget_pkg_path%" ( @@ -45,11 +45,6 @@ IF %ERRORLEVEL% NEQ 0 ( call :failure "Initializing repository libbitcoin libbitcoin-consensus master failed." exit /b 1 ) -call :init libbitcoin libbitcoin-blockchain master -IF %ERRORLEVEL% NEQ 0 ( - call :failure "Initializing repository libbitcoin libbitcoin-blockchain master failed." - exit /b 1 -) call :bld_repo libbitcoin-node IF %ERRORLEVEL% NEQ 0 ( call :failure "Building libbitcoin-node failed." diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index a995bea2..60077502 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -108,6 +108,14 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") endif() endif() +# Implement -Dwith-consensus and define WITH_CONSENSUS. +#------------------------------------------------------------------------------ +set( with-consensus "yes" CACHE BOOL "Link libbitcoin-consensus and use for consensus checks." ) + +if (with-consensus) + add_definitions( -DWITH_CONSENSUS ) +endif() + # Implement -Dbash-completiondir and output ${bash-completiondir} and declare bash-completiondir. #------------------------------------------------------------------------------ set( bash-completiondir "no" CACHE BOOL "Install bash completion support, optionally specifying the directory. This option may require elevated permissions." ) @@ -162,9 +170,15 @@ if (bash-completiondir) find_package( Bash-Completion 2.0.0 REQUIRED ) endif() -# Find bitcoin-blockchain +# Find bitcoin-database #------------------------------------------------------------------------------ -find_package( Bitcoin-Blockchain 4.0.0 REQUIRED ) +find_package( Bitcoin-Database 4.0.0 REQUIRED ) + +# Find bitcoin-consensus +#------------------------------------------------------------------------------ +if (with-consensus) + find_package( Bitcoin-Consensus 4.0.0 REQUIRED ) +endif() # Find bitcoin-network #------------------------------------------------------------------------------ @@ -173,33 +187,39 @@ find_package( Bitcoin-Network 4.0.0 REQUIRED ) # Define project common includes for build. #------------------------------------------------------------------------------ if (BUILD_SHARED_LIBS) - set( bitcoin_blockchain_FOR_BUILD_INCLUDE_DIRS ${bitcoin_blockchain_INCLUDE_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_INCLUDE_DIRS ${bitcoin_database_INCLUDE_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_INCLUDE_DIRS ${bitcoin_consensus_INCLUDE_DIRS} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_INCLUDE_DIRS ${bitcoin_network_INCLUDE_DIRS} CACHE STRING "Placeholder" ) else() - set( bitcoin_blockchain_FOR_BUILD_INCLUDE_DIRS ${bitcoin_blockchain_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_INCLUDE_DIRS ${bitcoin_database_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_INCLUDE_DIRS ${bitcoin_consensus_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_INCLUDE_DIRS ${bitcoin_network_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" ) endif() # Define project common includes directories #------------------------------------------------------------------------------ include_directories( SYSTEM - ${bitcoin_blockchain_FOR_BUILD_INCLUDE_DIRS} + ${bitcoin_database_FOR_BUILD_INCLUDE_DIRS} + ${bitcoin_consensus_FOR_BUILD_INCLUDE_DIRS} ${bitcoin_network_FOR_BUILD_INCLUDE_DIRS} ) # Define project common library directories for build. #------------------------------------------------------------------------------ if (BUILD_SHARED_LIBS) - set( bitcoin_blockchain_FOR_BUILD_LIBRARY_DIRS ${bitcoin_blockchain_LIBRARY_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_LIBRARY_DIRS ${bitcoin_database_LIBRARY_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_LIBRARY_DIRS ${bitcoin_consensus_LIBRARY_DIRS} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_LIBRARY_DIRS ${bitcoin_network_LIBRARY_DIRS} CACHE STRING "Placeholder" ) else() - set( bitcoin_blockchain_FOR_BUILD_LIBRARY_DIRS ${bitcoin_blockchain_STATIC_LIBRARY_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_LIBRARY_DIRS ${bitcoin_database_STATIC_LIBRARY_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_LIBRARY_DIRS ${bitcoin_consensus_STATIC_LIBRARY_DIRS} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_LIBRARY_DIRS ${bitcoin_network_STATIC_LIBRARY_DIRS} CACHE STRING "Placeholder" ) endif() # Define project common library directories #------------------------------------------------------------------------------ link_directories( - ${bitcoin_blockchain_FOR_BUILD_LIBRARY_DIRS} + ${bitcoin_database_FOR_BUILD_LIBRARY_DIRS} + ${bitcoin_consensus_FOR_BUILD_LIBRARY_DIRS} ${bitcoin_network_FOR_BUILD_LIBRARY_DIRS} ) # Define project common linker flags. @@ -226,17 +246,20 @@ endif() # Define common library usage for build. #------------------------------------------------------------------------------ if (BUILD_SHARED_LIBS) - set( bitcoin_blockchain_FOR_BUILD_LIBRARIES ${bitcoin_blockchain_LIBRARIES} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_LIBRARIES ${bitcoin_database_LIBRARIES} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_LIBRARIES ${bitcoin_consensus_LIBRARIES} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_LIBRARIES ${bitcoin_network_LIBRARIES} CACHE STRING "Placeholder" ) else() - set( bitcoin_blockchain_FOR_BUILD_LIBRARIES ${bitcoin_blockchain_STATIC_LIBRARIES} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_LIBRARIES ${bitcoin_database_STATIC_LIBRARIES} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_LIBRARIES ${bitcoin_consensus_STATIC_LIBRARIES} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_LIBRARIES ${bitcoin_network_STATIC_LIBRARIES} CACHE STRING "Placeholder" ) endif() # Define project common libraries. #------------------------------------------------------------------------------ link_libraries( - ${bitcoin_blockchain_FOR_BUILD_LIBRARIES} + ${bitcoin_database_FOR_BUILD_LIBRARIES} + ${bitcoin_consensus_FOR_BUILD_LIBRARIES} ${bitcoin_network_FOR_BUILD_LIBRARIES} ) add_definitions( @@ -274,10 +297,12 @@ add_library( ${CANONICAL_LIB_NAME} # ${CANONICAL_LIB_NAME} project specific include directory normalization for build. #------------------------------------------------------------------------------ if (BUILD_SHARED_LIBS) - set( bitcoin_blockchain_FOR_BUILD_INCLUDE_DIRS ${bitcoin_blockchain_INCLUDE_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_INCLUDE_DIRS ${bitcoin_database_INCLUDE_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_INCLUDE_DIRS ${bitcoin_consensus_INCLUDE_DIRS} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_INCLUDE_DIRS ${bitcoin_network_INCLUDE_DIRS} CACHE STRING "Placeholder" ) else() - set( bitcoin_blockchain_FOR_BUILD_INCLUDE_DIRS ${bitcoin_blockchain_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_INCLUDE_DIRS ${bitcoin_database_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_INCLUDE_DIRS ${bitcoin_consensus_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_INCLUDE_DIRS ${bitcoin_network_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" ) endif() @@ -285,7 +310,8 @@ endif() #------------------------------------------------------------------------------ target_include_directories( ${CANONICAL_LIB_NAME} PRIVATE "../../include" - ${bitcoin_blockchain_FOR_BUILD_INCLUDE_DIRS} + ${bitcoin_database_FOR_BUILD_INCLUDE_DIRS} + ${bitcoin_consensus_FOR_BUILD_INCLUDE_DIRS} ${bitcoin_network_FOR_BUILD_INCLUDE_DIRS} ) target_include_directories( ${CANONICAL_LIB_NAME} PUBLIC @@ -294,17 +320,20 @@ target_include_directories( ${CANONICAL_LIB_NAME} PUBLIC # ${CANONICAL_LIB_NAME} project specific libraries noramalization for build. #------------------------------------------------------------------------------ if (BUILD_SHARED_LIBS) - set( bitcoin_blockchain_FOR_BUILD_LIBRARIES ${bitcoin_blockchain_LIBRARIES} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_LIBRARIES ${bitcoin_database_LIBRARIES} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_LIBRARIES ${bitcoin_consensus_LIBRARIES} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_LIBRARIES ${bitcoin_network_LIBRARIES} CACHE STRING "Placeholder" ) else() - set( bitcoin_blockchain_FOR_BUILD_LIBRARIES ${bitcoin_blockchain_STATIC_LIBRARIES} CACHE STRING "Placeholder" ) + set( bitcoin_database_FOR_BUILD_LIBRARIES ${bitcoin_database_STATIC_LIBRARIES} CACHE STRING "Placeholder" ) + set( bitcoin_consensus_FOR_BUILD_LIBRARIES ${bitcoin_consensus_STATIC_LIBRARIES} CACHE STRING "Placeholder" ) set( bitcoin_network_FOR_BUILD_LIBRARIES ${bitcoin_network_STATIC_LIBRARIES} CACHE STRING "Placeholder" ) endif() # ${CANONICAL_LIB_NAME} project specific libraries/linker flags. #------------------------------------------------------------------------------ target_link_libraries( ${CANONICAL_LIB_NAME} - ${bitcoin_blockchain_FOR_BUILD_LIBRARIES} + ${bitcoin_database_FOR_BUILD_LIBRARIES} + ${bitcoin_consensus_FOR_BUILD_LIBRARIES} ${bitcoin_network_FOR_BUILD_LIBRARIES} ) # Define libbitcoin-node-test project. diff --git a/builds/cmake/modules/FindBitcoin-Consensus.cmake b/builds/cmake/modules/FindBitcoin-Consensus.cmake new file mode 100644 index 00000000..ed50996f --- /dev/null +++ b/builds/cmake/modules/FindBitcoin-Consensus.cmake @@ -0,0 +1,60 @@ +############################################################################### +# Copyright (c) 2014-2023 libbitcoin-blockchain developers (see COPYING). +# +# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY +# +############################################################################### +# FindBitcoin-Consensus +# +# Use this module by invoking find_package with the form:: +# +# find_package( Bitcoin-Consensus +# [version] # Minimum version +# [REQUIRED] # Fail with error if bitcoin-consensus is not found +# ) +# +# Defines the following for use: +# +# bitcoin_consensus_FOUND - true if headers and requested libraries were found +# bitcoin_consensus_INCLUDE_DIRS - include directories for bitcoin-consensus libraries +# bitcoin_consensus_LIBRARY_DIRS - link directories for bitcoin-consensus libraries +# bitcoin_consensus_LIBRARIES - bitcoin-consensus libraries to be linked +# bitcoin_consensus_PKG - bitcoin-consensus pkg-config package specification. +# + +if (MSVC) + if ( Bitcoin-Consensus_FIND_REQUIRED ) + set( _bitcoin_consensus_MSG_STATUS "SEND_ERROR" ) + else () + set( _bitcoin_consensus_MSG_STATUS "STATUS" ) + endif() + + set( bitcoin_consensus_FOUND false ) + message( ${_bitcoin_consensus_MSG_STATUS} "MSVC environment detection for 'bitcoin-consensus' not currently supported." ) +else () + # required + if ( Bitcoin-Consensus_FIND_REQUIRED ) + set( _bitcoin_consensus_REQUIRED "REQUIRED" ) + endif() + + # quiet + if ( Bitcoin-Consensus_FIND_QUIETLY ) + set( _bitcoin_consensus_QUIET "QUIET" ) + endif() + + # modulespec + if ( Bitcoin-Consensus_FIND_VERSION_COUNT EQUAL 0 ) + set( _bitcoin_consensus_MODULE_SPEC "libbitcoin-consensus" ) + else () + if ( Bitcoin-Consensus_FIND_VERSION_EXACT ) + set( _bitcoin_consensus_MODULE_SPEC_OP "=" ) + else () + set( _bitcoin_consensus_MODULE_SPEC_OP ">=" ) + endif() + + set( _bitcoin_consensus_MODULE_SPEC "libbitcoin-consensus ${_bitcoin_consensus_MODULE_SPEC_OP} ${Bitcoin-Consensus_FIND_VERSION}" ) + endif() + + pkg_check_modules( bitcoin_consensus ${_bitcoin_consensus_REQUIRED} ${_bitcoin_consensus_QUIET} "${_bitcoin_consensus_MODULE_SPEC}" ) + set( bitcoin_consensus_PKG "${_bitcoin_consensus_MODULE_SPEC}" ) +endif() diff --git a/builds/cmake/modules/FindBitcoin-Database.cmake b/builds/cmake/modules/FindBitcoin-Database.cmake new file mode 100644 index 00000000..faf75c28 --- /dev/null +++ b/builds/cmake/modules/FindBitcoin-Database.cmake @@ -0,0 +1,60 @@ +############################################################################### +# Copyright (c) 2014-2023 libbitcoin-blockchain developers (see COPYING). +# +# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY +# +############################################################################### +# FindBitcoin-Database +# +# Use this module by invoking find_package with the form:: +# +# find_package( Bitcoin-Database +# [version] # Minimum version +# [REQUIRED] # Fail with error if bitcoin-database is not found +# ) +# +# Defines the following for use: +# +# bitcoin_database_FOUND - true if headers and requested libraries were found +# bitcoin_database_INCLUDE_DIRS - include directories for bitcoin-database libraries +# bitcoin_database_LIBRARY_DIRS - link directories for bitcoin-database libraries +# bitcoin_database_LIBRARIES - bitcoin-database libraries to be linked +# bitcoin_database_PKG - bitcoin-database pkg-config package specification. +# + +if (MSVC) + if ( Bitcoin-Database_FIND_REQUIRED ) + set( _bitcoin_database_MSG_STATUS "SEND_ERROR" ) + else () + set( _bitcoin_database_MSG_STATUS "STATUS" ) + endif() + + set( bitcoin_database_FOUND false ) + message( ${_bitcoin_database_MSG_STATUS} "MSVC environment detection for 'bitcoin-database' not currently supported." ) +else () + # required + if ( Bitcoin-Database_FIND_REQUIRED ) + set( _bitcoin_database_REQUIRED "REQUIRED" ) + endif() + + # quiet + if ( Bitcoin-Database_FIND_QUIETLY ) + set( _bitcoin_database_QUIET "QUIET" ) + endif() + + # modulespec + if ( Bitcoin-Database_FIND_VERSION_COUNT EQUAL 0 ) + set( _bitcoin_database_MODULE_SPEC "libbitcoin-database" ) + else () + if ( Bitcoin-Database_FIND_VERSION_EXACT ) + set( _bitcoin_database_MODULE_SPEC_OP "=" ) + else () + set( _bitcoin_database_MODULE_SPEC_OP ">=" ) + endif() + + set( _bitcoin_database_MODULE_SPEC "libbitcoin-database ${_bitcoin_database_MODULE_SPEC_OP} ${Bitcoin-Database_FIND_VERSION}" ) + endif() + + pkg_check_modules( bitcoin_database ${_bitcoin_database_REQUIRED} ${_bitcoin_database_QUIET} "${_bitcoin_database_MODULE_SPEC}" ) + set( bitcoin_database_PKG "${_bitcoin_database_MODULE_SPEC}" ) +endif() diff --git a/builds/msvc/vs2022/bn/bn.props b/builds/msvc/vs2022/bn/bn.props index d7e92377..4c5de5c4 100644 --- a/builds/msvc/vs2022/bn/bn.props +++ b/builds/msvc/vs2022/bn/bn.props @@ -22,7 +22,6 @@ - @@ -36,7 +35,6 @@ dynamic dynamic dynamic - dynamic dynamic dynamic @@ -45,7 +43,6 @@ ltcg ltcg ltcg - ltcg ltcg ltcg @@ -54,7 +51,6 @@ static static static - static static static @@ -66,9 +62,8 @@ - - \ No newline at end of file + diff --git a/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.props b/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.props index f8e749b4..b0395b6a 100644 --- a/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.props +++ b/builds/msvc/vs2022/libbitcoin-node-test/libbitcoin-node-test.props @@ -25,7 +25,6 @@ - @@ -39,7 +38,6 @@ dynamic dynamic dynamic - dynamic dynamic dynamic @@ -48,7 +46,6 @@ ltcg ltcg ltcg - ltcg ltcg ltcg @@ -57,7 +54,6 @@ static static static - static static static @@ -69,7 +65,6 @@ - diff --git a/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.props b/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.props index 446c5d06..6f638c9c 100644 --- a/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.props +++ b/builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.props @@ -30,7 +30,6 @@ - @@ -43,7 +42,6 @@ dynamic dynamic dynamic - dynamic dynamic @@ -51,7 +49,6 @@ ltcg ltcg ltcg - ltcg ltcg @@ -59,7 +56,6 @@ static static static - static static @@ -70,8 +66,7 @@ - - \ No newline at end of file + diff --git a/configure.ac b/configure.ac index 461478e4..83796e39 100644 --- a/configure.ac +++ b/configure.ac @@ -76,6 +76,17 @@ AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory]) # Process options. #============================================================================== +# Implement --with-consensus and define WITH_CONSENSUS. +#------------------------------------------------------------------------------ +AC_MSG_CHECKING([--with-consensus option]) +AC_ARG_WITH([consensus], + AS_HELP_STRING([--with-consensus], + [Link libbitcoin-consensus and use for consensus checks. @<:@default=yes@:>@]), + [with_consensus=$withval], + [with_consensus=yes]) +AC_MSG_RESULT([$with_consensus]) +AS_CASE([${with_consensus}], [yes], AC_DEFINE([WITH_CONSENSUS])) + # Implement --with-bash-completiondir and output ${bash_completiondir} and declare BASH_COMPLETIONDIR. #------------------------------------------------------------------------------ AC_MSG_CHECKING([--with-bash-completiondir option]) @@ -288,28 +299,53 @@ AS_CASE([${enable_isystem}],[yes], AC_MSG_NOTICE([bash_completion_BUILD_CPPFLAGS : ${bash_completion_BUILD_CPPFLAGS}]) -# Require bitcoin-blockchain of at least version 4.0.0 and output ${bitcoin_blockchain_CPPFLAGS/LIBS/PKG}. +# Require bitcoin-database of at least version 4.0.0 and output ${bitcoin_database_CPPFLAGS/LIBS/PKG}. +#------------------------------------------------------------------------------ +PKG_CHECK_MODULES([bitcoin_database], [libbitcoin-database >= 4.0.0], + [bitcoin_database_INCLUDEDIR="`$PKG_CONFIG --variable=includedir "libbitcoin-database >= 4.0.0" 2>/dev/null`" + bitcoin_database_OTHER_CFLAGS="`$PKG_CONFIG --cflags-only-other "libbitcoin-database >= 4.0.0" 2>/dev/null`"], + [AC_MSG_ERROR([libbitcoin-database >= 4.0.0 is required but was not found.])]) +AC_SUBST([bitcoin_database_PKG], ['libbitcoin-database >= 4.0.0']) +AC_SUBST([bitcoin_database_CPPFLAGS], [${bitcoin_database_CFLAGS}]) +AS_IF([test x${bitcoin_database_INCLUDEDIR} != "x"], + [AC_SUBST([bitcoin_database_ISYS_CPPFLAGS], ["-isystem${bitcoin_database_INCLUDEDIR} ${bitcoin_database_OTHER_CFLAGS}"])], + [AC_SUBST([bitcoin_database_ISYS_CPPFLAGS], [${bitcoin_database_OTHER_CFLAGS}])]) +AC_MSG_NOTICE([bitcoin_database_CPPFLAGS : ${bitcoin_database_CPPFLAGS}]) +AC_MSG_NOTICE([bitcoin_database_ISYS_CPPFLAGS : ${bitcoin_database_ISYS_CPPFLAGS}]) +AC_MSG_NOTICE([bitcoin_database_OTHER_CFLAGS : ${bitcoin_database_OTHER_CFLAGS}]) +AC_MSG_NOTICE([bitcoin_database_INCLUDEDIR : ${bitcoin_database_INCLUDEDIR}]) +AC_MSG_NOTICE([bitcoin_database_LIBS : ${bitcoin_database_LIBS}]) + +AS_CASE([${enable_isystem}],[yes], + [AC_SUBST([bitcoin_database_BUILD_CPPFLAGS], [${bitcoin_database_ISYS_CPPFLAGS}])], + [AC_SUBST([bitcoin_database_BUILD_CPPFLAGS], [${bitcoin_database_CPPFLAGS}])]) + +AC_MSG_NOTICE([bitcoin_database_BUILD_CPPFLAGS : ${bitcoin_database_BUILD_CPPFLAGS}]) + +# Require bitcoin-consensus of at least version 4.0.0 and output ${bitcoin_consensus_CPPFLAGS/LIBS/PKG}. #------------------------------------------------------------------------------ -PKG_CHECK_MODULES([bitcoin_blockchain], [libbitcoin-blockchain >= 4.0.0], - [bitcoin_blockchain_INCLUDEDIR="`$PKG_CONFIG --variable=includedir "libbitcoin-blockchain >= 4.0.0" 2>/dev/null`" - bitcoin_blockchain_OTHER_CFLAGS="`$PKG_CONFIG --cflags-only-other "libbitcoin-blockchain >= 4.0.0" 2>/dev/null`"], - [AC_MSG_ERROR([libbitcoin-blockchain >= 4.0.0 is required but was not found.])]) -AC_SUBST([bitcoin_blockchain_PKG], ['libbitcoin-blockchain >= 4.0.0']) -AC_SUBST([bitcoin_blockchain_CPPFLAGS], [${bitcoin_blockchain_CFLAGS}]) -AS_IF([test x${bitcoin_blockchain_INCLUDEDIR} != "x"], - [AC_SUBST([bitcoin_blockchain_ISYS_CPPFLAGS], ["-isystem${bitcoin_blockchain_INCLUDEDIR} ${bitcoin_blockchain_OTHER_CFLAGS}"])], - [AC_SUBST([bitcoin_blockchain_ISYS_CPPFLAGS], [${bitcoin_blockchain_OTHER_CFLAGS}])]) -AC_MSG_NOTICE([bitcoin_blockchain_CPPFLAGS : ${bitcoin_blockchain_CPPFLAGS}]) -AC_MSG_NOTICE([bitcoin_blockchain_ISYS_CPPFLAGS : ${bitcoin_blockchain_ISYS_CPPFLAGS}]) -AC_MSG_NOTICE([bitcoin_blockchain_OTHER_CFLAGS : ${bitcoin_blockchain_OTHER_CFLAGS}]) -AC_MSG_NOTICE([bitcoin_blockchain_INCLUDEDIR : ${bitcoin_blockchain_INCLUDEDIR}]) -AC_MSG_NOTICE([bitcoin_blockchain_LIBS : ${bitcoin_blockchain_LIBS}]) +AS_CASE([${with_consensus}], [yes], + [PKG_CHECK_MODULES([bitcoin_consensus], [libbitcoin-consensus >= 4.0.0], + [bitcoin_consensus_INCLUDEDIR="`$PKG_CONFIG --variable=includedir "libbitcoin-consensus >= 4.0.0" 2>/dev/null`" + bitcoin_consensus_OTHER_CFLAGS="`$PKG_CONFIG --cflags-only-other "libbitcoin-consensus >= 4.0.0" 2>/dev/null`"], + [AC_MSG_ERROR([--with-consensus specified but libbitcoin-consensus >= 4.0.0 was not found.])]) + AC_SUBST([bitcoin_consensus_PKG], ['libbitcoin-consensus >= 4.0.0']) + AC_SUBST([bitcoin_consensus_CPPFLAGS], [${bitcoin_consensus_CFLAGS}]) + AS_IF([test x${bitcoin_consensus_INCLUDEDIR} != "x"], + [AC_SUBST([bitcoin_consensus_ISYS_CPPFLAGS], ["-isystem${bitcoin_consensus_INCLUDEDIR} ${bitcoin_consensus_OTHER_CFLAGS}"])], + [AC_SUBST([bitcoin_consensus_ISYS_CPPFLAGS], [${bitcoin_consensus_OTHER_CFLAGS}])]) + AC_MSG_NOTICE([bitcoin_consensus_CPPFLAGS : ${bitcoin_consensus_CPPFLAGS}]) + AC_MSG_NOTICE([bitcoin_consensus_ISYS_CPPFLAGS : ${bitcoin_consensus_ISYS_CPPFLAGS}]) + AC_MSG_NOTICE([bitcoin_consensus_OTHER_CFLAGS : ${bitcoin_consensus_OTHER_CFLAGS}]) + AC_MSG_NOTICE([bitcoin_consensus_INCLUDEDIR : ${bitcoin_consensus_INCLUDEDIR}]) + AC_MSG_NOTICE([bitcoin_consensus_LIBS : ${bitcoin_consensus_LIBS}])], + [AC_SUBST([bitcoin_consensus_PKG], [])]) AS_CASE([${enable_isystem}],[yes], - [AC_SUBST([bitcoin_blockchain_BUILD_CPPFLAGS], [${bitcoin_blockchain_ISYS_CPPFLAGS}])], - [AC_SUBST([bitcoin_blockchain_BUILD_CPPFLAGS], [${bitcoin_blockchain_CPPFLAGS}])]) + [AC_SUBST([bitcoin_consensus_BUILD_CPPFLAGS], [${bitcoin_consensus_ISYS_CPPFLAGS}])], + [AC_SUBST([bitcoin_consensus_BUILD_CPPFLAGS], [${bitcoin_consensus_CPPFLAGS}])]) -AC_MSG_NOTICE([bitcoin_blockchain_BUILD_CPPFLAGS : ${bitcoin_blockchain_BUILD_CPPFLAGS}]) +AC_MSG_NOTICE([bitcoin_consensus_BUILD_CPPFLAGS : ${bitcoin_consensus_BUILD_CPPFLAGS}]) # Require bitcoin-network of at least version 4.0.0 and output ${bitcoin_network_CPPFLAGS/LIBS/PKG}. #------------------------------------------------------------------------------ diff --git a/install-cmake.sh b/install-cmake.sh index 19aab22e..1ca5eb47 100755 --- a/install-cmake.sh +++ b/install-cmake.sh @@ -927,8 +927,6 @@ build_all() build_from_github_cmake libbitcoin-database "$PARALLEL" false "yes" "${BITCOIN_DATABASE_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" create_from_github libbitcoin libbitcoin-consensus master "$WITH_BITCOIN_CONSENSUS" build_from_github_cmake libbitcoin-consensus "$PARALLEL" false "$WITH_BITCOIN_CONSENSUS" "${BITCOIN_CONSENSUS_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" - create_from_github libbitcoin libbitcoin-blockchain master "yes" - build_from_github_cmake libbitcoin-blockchain "$PARALLEL" false "yes" "${BITCOIN_BLOCKCHAIN_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" if [[ ! ($CI == true) ]]; then create_from_github libbitcoin libbitcoin-node master "yes" build_from_github_cmake libbitcoin-node "$PARALLEL" true "yes" "${BITCOIN_NODE_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" @@ -1026,14 +1024,6 @@ BITCOIN_CONSENSUS_OPTIONS=( "${with_boost}" \ "${with_pkgconfigdir}") -# Define bitcoin-blockchain options. -#------------------------------------------------------------------------------ -BITCOIN_BLOCKCHAIN_OPTIONS=( -"-Dwith-tests=no" \ -"-Dwith-tools=no" \ -"${with_boost}" \ -"${with_pkgconfigdir}") - # Define bitcoin-node options. #------------------------------------------------------------------------------ BITCOIN_NODE_OPTIONS=( diff --git a/install-cmakepresets.sh b/install-cmakepresets.sh index dbf7e34a..95944b1b 100755 --- a/install-cmakepresets.sh +++ b/install-cmakepresets.sh @@ -390,21 +390,15 @@ handle_custom_options() exit 1 fi - BASE_PRESET_ID="$PRESET_ID" + BASE_PRESET_ID=${PRESET_ID/%-with*_*/} REPO_PRESET[libbitcoin-node]="$PRESET_ID" display_message "REPO_PRESET[libbitcoin-node]=${REPO_PRESET[libbitcoin-node]}" - REPO_PRESET[libbitcoin-network]="$BASE_PRESET_ID" - display_message "REPO_PRESET[libbitcoin-network]=${REPO_PRESET[libbitcoin-network]}" - if [[ $WITH_BITCOIN_CONSENSUS ]]; then - REPO_PRESET[libbitcoin-blockchain]="$BASE_PRESET_ID-with_consensus" - else - REPO_PRESET[libbitcoin-blockchain]="$BASE_PRESET_ID-without_consensus" - fi - display_message "REPO_PRESET[libbitcoin-blockchain]=${REPO_PRESET[libbitcoin-blockchain]}" REPO_PRESET[libbitcoin-consensus]="$BASE_PRESET_ID" display_message "REPO_PRESET[libbitcoin-consensus]=${REPO_PRESET[libbitcoin-consensus]}" REPO_PRESET[libbitcoin-database]="$BASE_PRESET_ID" display_message "REPO_PRESET[libbitcoin-database]=${REPO_PRESET[libbitcoin-database]}" + REPO_PRESET[libbitcoin-network]="$BASE_PRESET_ID" + display_message "REPO_PRESET[libbitcoin-network]=${REPO_PRESET[libbitcoin-network]}" if [[ $WITH_ICU ]]; then REPO_PRESET[libbitcoin-system]="$BASE_PRESET_ID-with_icu" else @@ -988,9 +982,6 @@ build_all() create_from_github libbitcoin libbitcoin-consensus master "$WITH_BITCOIN_CONSENSUS" display_message "libbitcoin-consensus PRESET ${REPO_PRESET[libbitcoin-consensus]}" build_from_github_cmake libbitcoin-consensus ${REPO_PRESET[libbitcoin-consensus]} "$PARALLEL" false "$WITH_BITCOIN_CONSENSUS" "${BITCOIN_CONSENSUS_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" - create_from_github libbitcoin libbitcoin-blockchain master "yes" - display_message "libbitcoin-blockchain PRESET ${REPO_PRESET[libbitcoin-blockchain]}" - build_from_github_cmake libbitcoin-blockchain ${REPO_PRESET[libbitcoin-blockchain]} "$PARALLEL" false "yes" "${BITCOIN_BLOCKCHAIN_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" if [[ ! ($CI == true) ]]; then create_from_github libbitcoin libbitcoin-node master "yes" display_message "libbitcoin-node PRESET ${REPO_PRESET[libbitcoin-node]}" @@ -1090,14 +1081,6 @@ BITCOIN_CONSENSUS_OPTIONS=( "${with_boost}" \ "${with_pkgconfigdir}") -# Define bitcoin-blockchain options. -#------------------------------------------------------------------------------ -BITCOIN_BLOCKCHAIN_OPTIONS=( -"-Dwith-tests=no" \ -"-Dwith-tools=no" \ -"${with_boost}" \ -"${with_pkgconfigdir}") - # Define bitcoin-node options. #------------------------------------------------------------------------------ BITCOIN_NODE_OPTIONS=( diff --git a/install.sh b/install.sh index 98842a52..6d480926 100755 --- a/install.sh +++ b/install.sh @@ -793,8 +793,6 @@ build_all() build_from_github libbitcoin-database "$PARALLEL" false "yes" "${BITCOIN_DATABASE_OPTIONS[@]}" "$@" create_from_github libbitcoin libbitcoin-consensus master "$WITH_BITCOIN_CONSENSUS" build_from_github libbitcoin-consensus "$PARALLEL" false "$WITH_BITCOIN_CONSENSUS" "${BITCOIN_CONSENSUS_OPTIONS[@]}" "$@" - create_from_github libbitcoin libbitcoin-blockchain master "yes" - build_from_github libbitcoin-blockchain "$PARALLEL" false "yes" "${BITCOIN_BLOCKCHAIN_OPTIONS[@]}" "$@" if [[ ! ($CI == true) ]]; then create_from_github libbitcoin libbitcoin-node master "yes" build_from_github libbitcoin-node "$PARALLEL" true "yes" "${BITCOIN_NODE_OPTIONS[@]}" "$@" @@ -891,14 +889,6 @@ BITCOIN_CONSENSUS_OPTIONS=( "${with_boost}" \ "${with_pkgconfigdir}") -# Define bitcoin-blockchain options. -#------------------------------------------------------------------------------ -BITCOIN_BLOCKCHAIN_OPTIONS=( -"--without-tests" \ -"--without-tools" \ -"${with_boost}" \ -"${with_pkgconfigdir}") - # Define bitcoin-node options. #------------------------------------------------------------------------------ BITCOIN_NODE_OPTIONS=( diff --git a/libbitcoin-node.pc.in b/libbitcoin-node.pc.in index 18b74ea7..bac48d58 100644 --- a/libbitcoin-node.pc.in +++ b/libbitcoin-node.pc.in @@ -25,7 +25,7 @@ Version: @PACKAGE_VERSION@ #============================================================================== # Dependencies that publish package configuration. #------------------------------------------------------------------------------ -Requires: libbitcoin-blockchain >= 4.0.0 libbitcoin-network >= 4.0.0 +Requires: libbitcoin-database >= 4.0.0 @bitcoin_consensus_PKG@ libbitcoin-network >= 4.0.0 # Include directory and any other required compiler flags. #------------------------------------------------------------------------------