Skip to content

Commit

Permalink
Merge pull request #533 from evoskuil/master
Browse files Browse the repository at this point in the history
Stub in chaser event handlers.
  • Loading branch information
evoskuil authored Feb 14, 2024
2 parents 8e437a2 + 0b23c22 commit f0496c3
Show file tree
Hide file tree
Showing 26 changed files with 372 additions and 135 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
11 changes: 3 additions & 8 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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%" (
Expand Down Expand Up @@ -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."
Expand Down
63 changes: 46 additions & 17 deletions builds/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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." )
Expand Down Expand Up @@ -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
#------------------------------------------------------------------------------
Expand All @@ -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.
Expand All @@ -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(
Expand Down Expand Up @@ -274,18 +297,21 @@ 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()

# ${CANONICAL_LIB_NAME} project specific include directories.
#------------------------------------------------------------------------------
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
Expand All @@ -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.
Expand Down
60 changes: 60 additions & 0 deletions builds/cmake/modules/FindBitcoin-Consensus.cmake
Original file line number Diff line number Diff line change
@@ -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()
60 changes: 60 additions & 0 deletions builds/cmake/modules/FindBitcoin-Database.cmake
Original file line number Diff line number Diff line change
@@ -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()
Loading

0 comments on commit f0496c3

Please sign in to comment.