mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 11:09:36 +01:00
24699fec84doc: Add initial asmap data documentation (Fabian Jahr)bab085d282ci: Use without embedded asmap build option in one ci job (Fabian Jahr)e53934422adoc: Expand documentation on asmap feature and tooling (Fabian Jahr)6244212a55init, net: Implement usage of binary-embedded asmap data (Fabian Jahr)6202b50fb9build: Generate ip_asn.dat.h during build process (Fabian Jahr)634cd60dc8build: Add embedded asmap data (Fabian Jahr) Pull request description: This is the final in a series of PRs that implement the necessary changes for embedding of asmap data into the binary. This last part add the initial asmap data, implements the build changes and adds further documentation. Currently an asmap file needs to be acquired by there user from some location or the user needs to generate one themselves. Then they need to move the file to the right place in datadir or pass the path to the file as `-asmap=PATH` in order to use the asmap feature. The change here allows for builds to embed asmap data into the bitcoind binary which makes it possible to use the feature without handling of the asmap file by the user. If the user starts bitcoind with `-asmap` the embedded data will be used for bucketing of nodes. The data lives in the repository at `src/node/data/ip_asn.dat` and can be replaced with a new version at any time. The idea is that the data should be updated with every release. By default the data at that location is embedded into the binary but there is also a build option to prevent this (`-DWITH_EMBEDDED_ASMAP=OFF`). In this case the original behavior of the `-asmap` option is maintained. ACKs for top commit: achow101: ACK24699fec84sipa: ACK24699fec84hodlinator: ACK24699fec84Tree-SHA512: c2e33dbeea387efdfd3d415432bf8fa64de80f272c1207015ea53b85bb77f5c29f1dae5644513a23c844a98fb0a4bb257bf765f38b15bfc4c41984f0315b4c6a
100 lines
3.1 KiB
CMake
100 lines
3.1 KiB
CMake
# Copyright (c) 2023-present The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or https://opensource.org/license/mit/.
|
|
|
|
function(create_test_config)
|
|
set(abs_top_srcdir ${PROJECT_SOURCE_DIR})
|
|
set(abs_top_builddir ${PROJECT_BINARY_DIR})
|
|
set(EXEEXT ${CMAKE_EXECUTABLE_SUFFIX})
|
|
|
|
macro(set_configure_variable var conf_var)
|
|
if(${var})
|
|
set(${conf_var}_TRUE "")
|
|
else()
|
|
set(${conf_var}_TRUE "#")
|
|
endif()
|
|
endmacro()
|
|
|
|
set_configure_variable(ENABLE_WALLET ENABLE_WALLET)
|
|
set_configure_variable(BUILD_BENCH BUILD_BENCH)
|
|
set_configure_variable(BUILD_CLI BUILD_BITCOIN_CLI)
|
|
set_configure_variable(BUILD_TX BUILD_BITCOIN_TX)
|
|
set_configure_variable(BUILD_UTIL BUILD_BITCOIN_UTIL)
|
|
set_configure_variable(BUILD_UTIL_CHAINSTATE BUILD_BITCOIN_CHAINSTATE)
|
|
set_configure_variable(BUILD_WALLET_TOOL BUILD_BITCOIN_WALLET)
|
|
set_configure_variable(BUILD_DAEMON BUILD_BITCOIND)
|
|
set_configure_variable(BUILD_FUZZ_BINARY ENABLE_FUZZ_BINARY)
|
|
set_configure_variable(WITH_ZMQ ENABLE_ZMQ)
|
|
set_configure_variable(WITH_EMBEDDED_ASMAP ENABLE_EMBEDDED_ASMAP)
|
|
set_configure_variable(ENABLE_EXTERNAL_SIGNER ENABLE_EXTERNAL_SIGNER)
|
|
set_configure_variable(WITH_USDT ENABLE_USDT_TRACEPOINTS)
|
|
set_configure_variable(ENABLE_IPC ENABLE_IPC)
|
|
|
|
configure_file(config.ini.in config.ini USE_SOURCE_PERMISSIONS @ONLY)
|
|
endfunction()
|
|
|
|
create_test_config()
|
|
|
|
|
|
function(create_test_directory_links)
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional)
|
|
file(GLOB functional
|
|
LIST_DIRECTORIES FALSE
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
functional/*.html
|
|
functional/*.py
|
|
)
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional/data)
|
|
file(GLOB functional_data
|
|
LIST_DIRECTORIES FALSE
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
functional/data/*.json
|
|
functional/data/*.py
|
|
)
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional/mocks)
|
|
file(GLOB functional_mocks
|
|
LIST_DIRECTORIES FALSE
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
functional/mocks/*.py
|
|
)
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional/test_framework)
|
|
file(GLOB functional_test_framework
|
|
LIST_DIRECTORIES FALSE
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
functional/test_framework/*.csv
|
|
functional/test_framework/*.py
|
|
)
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional/test_framework/crypto)
|
|
file(GLOB functional_test_framework_crypto
|
|
LIST_DIRECTORIES FALSE
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
functional/test_framework/crypto/*.csv
|
|
functional/test_framework/crypto/*.py
|
|
)
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fuzz)
|
|
set(files_to_link
|
|
${functional}
|
|
${functional_data}
|
|
${functional_mocks}
|
|
${functional_test_framework}
|
|
${functional_test_framework_crypto}
|
|
fuzz/test_runner.py
|
|
)
|
|
|
|
foreach(f IN LISTS files_to_link)
|
|
if(CMAKE_HOST_WIN32)
|
|
set(symlink)
|
|
else()
|
|
set(symlink SYMBOLIC)
|
|
endif()
|
|
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/${f} ${CMAKE_CURRENT_BINARY_DIR}/${f} COPY_ON_ERROR ${symlink})
|
|
endforeach()
|
|
endfunction()
|
|
|
|
create_test_directory_links()
|