├── .github
└── workflows
│ └── ci.yml
├── .gitignore
├── .vscode
└── settings.json
├── AUTHORS
├── COPYING
├── ChangeLog
├── INSTALL
├── Makefile.am
├── NEWS
├── README
├── README.md
├── autogen.sh
├── build.cmd
├── builds
├── cmake
│ ├── CMakeLists.txt
│ ├── CMakePresets.json
│ └── modules
│ │ ├── FindBash-Completion.cmake
│ │ ├── FindBitcoin-Node.cmake
│ │ ├── FindBitcoin-Protocol.cmake
│ │ └── FindMbedtls.cmake
├── msvc
│ ├── .gitignore
│ ├── build
│ │ ├── build_all.bat
│ │ ├── build_base.bat
│ │ └── nuget_all.bat
│ ├── debug.natvis
│ ├── nuget.config
│ ├── properties
│ │ ├── Common.props
│ │ ├── DLL.props
│ │ ├── Debug.props
│ │ ├── DebugDEXE.props
│ │ ├── DebugDLL.props
│ │ ├── DebugLEXE.props
│ │ ├── DebugLIB.props
│ │ ├── DebugLTCG.props
│ │ ├── DebugSEXE.props
│ │ ├── EXE.props
│ │ ├── LIB.props
│ │ ├── LTCG.props
│ │ ├── Link.props
│ │ ├── Messages.props
│ │ ├── Output.props
│ │ ├── Release.props
│ │ ├── ReleaseDEXE.props
│ │ ├── ReleaseDLL.props
│ │ ├── ReleaseLEXE.props
│ │ ├── ReleaseLIB.props
│ │ ├── ReleaseLTCG.props
│ │ ├── ReleaseSEXE.props
│ │ ├── Win32.props
│ │ └── x64.props
│ ├── resource.h
│ ├── resource.rc
│ ├── vs2013
│ │ ├── bs
│ │ │ ├── bs.props
│ │ │ ├── bs.vcxproj
│ │ │ ├── bs.vcxproj.filters
│ │ │ └── packages.config
│ │ ├── libbitcoin-blockchain.import.props
│ │ ├── libbitcoin-blockchain.import.xml
│ │ ├── libbitcoin-consensus.import.props
│ │ ├── libbitcoin-consensus.import.xml
│ │ ├── libbitcoin-database.import.props
│ │ ├── libbitcoin-database.import.xml
│ │ ├── libbitcoin-network.import.props
│ │ ├── libbitcoin-network.import.xml
│ │ ├── libbitcoin-node.import.props
│ │ ├── libbitcoin-node.import.xml
│ │ ├── libbitcoin-protocol.import.props
│ │ ├── libbitcoin-protocol.import.xml
│ │ ├── libbitcoin-server-test
│ │ │ ├── libbitcoin-server-test.props
│ │ │ ├── libbitcoin-server-test.vcxproj
│ │ │ ├── libbitcoin-server-test.vcxproj.filters
│ │ │ └── packages.config
│ │ ├── libbitcoin-server.import.props
│ │ ├── libbitcoin-server.import.xml
│ │ ├── libbitcoin-server.sln
│ │ ├── libbitcoin-server
│ │ │ ├── libbitcoin-server.props
│ │ │ ├── libbitcoin-server.vcxproj
│ │ │ ├── libbitcoin-server.vcxproj.filters
│ │ │ └── packages.config
│ │ ├── libbitcoin-system.import.props
│ │ └── libbitcoin-system.import.xml
│ ├── vs2015
│ │ ├── bs
│ │ │ ├── bs.props
│ │ │ ├── bs.vcxproj
│ │ │ ├── bs.vcxproj.filters
│ │ │ └── packages.config
│ │ ├── libbitcoin-blockchain.import.props
│ │ ├── libbitcoin-blockchain.import.xml
│ │ ├── libbitcoin-consensus.import.props
│ │ ├── libbitcoin-consensus.import.xml
│ │ ├── libbitcoin-database.import.props
│ │ ├── libbitcoin-database.import.xml
│ │ ├── libbitcoin-network.import.props
│ │ ├── libbitcoin-network.import.xml
│ │ ├── libbitcoin-node.import.props
│ │ ├── libbitcoin-node.import.xml
│ │ ├── libbitcoin-protocol.import.props
│ │ ├── libbitcoin-protocol.import.xml
│ │ ├── libbitcoin-server-test
│ │ │ ├── libbitcoin-server-test.props
│ │ │ ├── libbitcoin-server-test.vcxproj
│ │ │ ├── libbitcoin-server-test.vcxproj.filters
│ │ │ └── packages.config
│ │ ├── libbitcoin-server.import.props
│ │ ├── libbitcoin-server.import.xml
│ │ ├── libbitcoin-server.sln
│ │ ├── libbitcoin-server
│ │ │ ├── libbitcoin-server.props
│ │ │ ├── libbitcoin-server.vcxproj
│ │ │ ├── libbitcoin-server.vcxproj.filters
│ │ │ └── packages.config
│ │ ├── libbitcoin-system.import.props
│ │ └── libbitcoin-system.import.xml
│ └── vs2022
│ │ ├── bs
│ │ ├── bs.props
│ │ ├── bs.vcxproj
│ │ ├── bs.vcxproj.filters
│ │ └── packages.config
│ │ ├── libbitcoin-blockchain.import.props
│ │ ├── libbitcoin-blockchain.import.xml
│ │ ├── libbitcoin-consensus.import.props
│ │ ├── libbitcoin-consensus.import.xml
│ │ ├── libbitcoin-database.import.props
│ │ ├── libbitcoin-database.import.xml
│ │ ├── libbitcoin-network.import.props
│ │ ├── libbitcoin-network.import.xml
│ │ ├── libbitcoin-node.import.props
│ │ ├── libbitcoin-node.import.xml
│ │ ├── libbitcoin-protocol.import.props
│ │ ├── libbitcoin-protocol.import.xml
│ │ ├── libbitcoin-server-test
│ │ ├── libbitcoin-server-test.props
│ │ ├── libbitcoin-server-test.vcxproj
│ │ ├── libbitcoin-server-test.vcxproj.filters
│ │ └── packages.config
│ │ ├── libbitcoin-server.import.props
│ │ ├── libbitcoin-server.import.xml
│ │ ├── libbitcoin-server.sln
│ │ ├── libbitcoin-server
│ │ ├── libbitcoin-server.props
│ │ ├── libbitcoin-server.vcxproj
│ │ ├── libbitcoin-server.vcxproj.filters
│ │ └── packages.config
│ │ ├── libbitcoin-system.import.props
│ │ └── libbitcoin-system.import.xml
└── vscode
│ └── server.code-workspace
├── configure.ac
├── console
├── executor.cpp
├── executor.hpp
├── libbitcoin.ico
└── main.cpp
├── data
├── bs
├── bs.cfg
├── fetch-tx.py
├── subscribe-block.py
├── subscribe-heartbeat.py
└── subscribe-tx.py
├── include
└── bitcoin
│ ├── server.hpp
│ └── server
│ ├── configuration.hpp
│ ├── define.hpp
│ ├── interface
│ ├── blockchain.hpp
│ ├── server.hpp
│ ├── subscribe.hpp
│ ├── transaction_pool.hpp
│ └── unsubscribe.hpp
│ ├── messages
│ ├── message.hpp
│ ├── route.hpp
│ └── subscription.hpp
│ ├── parser.hpp
│ ├── server_node.hpp
│ ├── services
│ ├── block_service.hpp
│ ├── heartbeat_service.hpp
│ ├── query_service.hpp
│ └── transaction_service.hpp
│ ├── settings.hpp
│ ├── version.hpp
│ └── workers
│ ├── authenticator.hpp
│ ├── notification_worker.hpp
│ └── query_worker.hpp
├── install-cmake.sh
├── install-cmakepresets.sh
├── install.sh
├── libbitcoin-server-test_runner.sh
├── libbitcoin-server.pc.in
├── m4
├── .gitignore
├── ax_boost_base.m4
├── ax_boost_unit_test_framework.m4
├── ax_check_compile_flag.m4
├── ax_check_link_flag.m4
├── ax_check_preproc_flag.m4
└── ax_cxx_compile_stdcxx.m4
├── src
├── configuration.cpp
├── interface
│ ├── blockchain.cpp
│ ├── server.cpp
│ ├── subscribe.cpp
│ ├── transaction_pool.cpp
│ └── unsubscribe.cpp
├── messages
│ ├── message.cpp
│ ├── route.cpp
│ └── subscription.cpp
├── parser.cpp
├── server_node.cpp
├── services
│ ├── block_service.cpp
│ ├── heartbeat_service.cpp
│ ├── query_service.cpp
│ └── transaction_service.cpp
├── settings.cpp
└── workers
│ ├── authenticator.cpp
│ ├── notification_worker.cpp
│ └── query_worker.cpp
└── test
├── latest-addrs.py
├── main.cpp
├── popular_addrs.py
├── server.cpp
└── stress.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | .deps
2 | .libs
3 | *.la
4 | *.lo
5 | *.o
6 | *.pyc
7 | Makefile
8 | Makefile.in
9 | libbitcoin.pc
10 |
11 | bin
12 | obj
13 | build
14 | .*.swp
15 | *~
16 | /*.kdev4
17 | /.cproject
18 | /.project
19 | /.settings
20 | /nbproject
21 |
22 | /aclocal.m4
23 | /autom4te.cache
24 | /build-aux
25 | /config.*
26 | /configure
27 | /libtool
28 | .dirstamp
29 | /.vs
30 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "cmake.sourceDirectory": "${workspaceFolder}/builds/cmake",
3 | "cmake.useCMakePresets": "always"
4 | }
5 |
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | commits libbitcoin developers
2 | --------------------------------------------
3 | 802 Eric Voskuil (evoskuil)
4 | 205 Amir Taaki (genjix)
5 | 51 Phillip Mienk
6 | 13 Noel Maersk (veox)
7 | 5 BMF
8 | 3 Pablo Castellano (pablog)
9 | 3 Robert Williamson (bobalot)
10 | 3 Yarvis Hatsa
11 | 1 RojavaCrypto
12 | 1 William Swanson (swansontec)
13 |
--------------------------------------------------------------------------------
/ChangeLog:
--------------------------------------------------------------------------------
1 | Use command 'git log --oneline --decorate' for latest change log.
2 |
--------------------------------------------------------------------------------
/NEWS:
--------------------------------------------------------------------------------
1 | See https://libbitcoin.org
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | See README.md
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This branch is not usable in its current state. Please see [version3](https://github.com/libbitcoin/libbitcoin-server/tree/version3) for the latest functional branch.
2 |
--------------------------------------------------------------------------------
/autogen.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ###############################################################################
3 | # Copyright (c) 2014-2025 libbitcoin-server developers (see COPYING).
4 | #
5 | # GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
6 | #
7 | ###############################################################################
8 |
9 | autoreconf -i
10 |
--------------------------------------------------------------------------------
/builds/cmake/modules/FindBash-Completion.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright (c) 2014-2025 libbitcoin-server developers (see COPYING).
3 | #
4 | # GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
5 | #
6 | ###############################################################################
7 | # FindBash-Completion
8 | #
9 | # Use this module by invoking find_package with the form::
10 | #
11 | # find_package( Bash-Completion
12 | # [version] # Minimum version
13 | # [REQUIRED] # Fail with error if bash-completion is not found
14 | # )
15 | #
16 | # Defines the following for use:
17 | #
18 | # bash_completion_FOUND - true if headers and requested libraries were found
19 | # bash_completion_INCLUDE_DIRS - include directories for bash-completion libraries
20 | # bash_completion_LIBRARY_DIRS - link directories for bash-completion libraries
21 | # bash_completion_LIBRARIES - bash-completion libraries to be linked
22 | # bash_completion_PKG - bash-completion pkg-config package specification.
23 | #
24 |
25 | if (MSVC)
26 | if ( Bash-Completion_FIND_REQUIRED )
27 | set( _bash_completion_MSG_STATUS "SEND_ERROR" )
28 | else ()
29 | set( _bash_completion_MSG_STATUS "STATUS" )
30 | endif()
31 |
32 | set( bash_completion_FOUND false )
33 | message( ${_bash_completion_MSG_STATUS} "MSVC environment detection for 'bash-completion' not currently supported." )
34 | else ()
35 | # required
36 | if ( Bash-Completion_FIND_REQUIRED )
37 | set( _bash_completion_REQUIRED "REQUIRED" )
38 | endif()
39 |
40 | # quiet
41 | if ( Bash-Completion_FIND_QUIETLY )
42 | set( _bash_completion_QUIET "QUIET" )
43 | endif()
44 |
45 | # modulespec
46 | if ( Bash-Completion_FIND_VERSION_COUNT EQUAL 0 )
47 | set( _bash_completion_MODULE_SPEC "bash-completion" )
48 | else ()
49 | if ( Bash-Completion_FIND_VERSION_EXACT )
50 | set( _bash_completion_MODULE_SPEC_OP "=" )
51 | else ()
52 | set( _bash_completion_MODULE_SPEC_OP ">=" )
53 | endif()
54 |
55 | set( _bash_completion_MODULE_SPEC "bash-completion ${_bash_completion_MODULE_SPEC_OP} ${Bash-Completion_FIND_VERSION}" )
56 | endif()
57 |
58 | pkg_check_modules( bash_completion ${_bash_completion_REQUIRED} ${_bash_completion_QUIET} "${_bash_completion_MODULE_SPEC}" )
59 | set( bash_completion_PKG "${_bash_completion_MODULE_SPEC}" )
60 | endif()
61 |
--------------------------------------------------------------------------------
/builds/cmake/modules/FindBitcoin-Node.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright (c) 2014-2025 libbitcoin-server developers (see COPYING).
3 | #
4 | # GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
5 | #
6 | ###############################################################################
7 | # FindBitcoin-Node
8 | #
9 | # Use this module by invoking find_package with the form::
10 | #
11 | # find_package( Bitcoin-Node
12 | # [version] # Minimum version
13 | # [REQUIRED] # Fail with error if bitcoin-node is not found
14 | # )
15 | #
16 | # Defines the following for use:
17 | #
18 | # bitcoin_node_FOUND - true if headers and requested libraries were found
19 | # bitcoin_node_INCLUDE_DIRS - include directories for bitcoin-node libraries
20 | # bitcoin_node_LIBRARY_DIRS - link directories for bitcoin-node libraries
21 | # bitcoin_node_LIBRARIES - bitcoin-node libraries to be linked
22 | # bitcoin_node_PKG - bitcoin-node pkg-config package specification.
23 | #
24 |
25 | if (MSVC)
26 | if ( Bitcoin-Node_FIND_REQUIRED )
27 | set( _bitcoin_node_MSG_STATUS "SEND_ERROR" )
28 | else ()
29 | set( _bitcoin_node_MSG_STATUS "STATUS" )
30 | endif()
31 |
32 | set( bitcoin_node_FOUND false )
33 | message( ${_bitcoin_node_MSG_STATUS} "MSVC environment detection for 'bitcoin-node' not currently supported." )
34 | else ()
35 | # required
36 | if ( Bitcoin-Node_FIND_REQUIRED )
37 | set( _bitcoin_node_REQUIRED "REQUIRED" )
38 | endif()
39 |
40 | # quiet
41 | if ( Bitcoin-Node_FIND_QUIETLY )
42 | set( _bitcoin_node_QUIET "QUIET" )
43 | endif()
44 |
45 | # modulespec
46 | if ( Bitcoin-Node_FIND_VERSION_COUNT EQUAL 0 )
47 | set( _bitcoin_node_MODULE_SPEC "libbitcoin-node" )
48 | else ()
49 | if ( Bitcoin-Node_FIND_VERSION_EXACT )
50 | set( _bitcoin_node_MODULE_SPEC_OP "=" )
51 | else ()
52 | set( _bitcoin_node_MODULE_SPEC_OP ">=" )
53 | endif()
54 |
55 | set( _bitcoin_node_MODULE_SPEC "libbitcoin-node ${_bitcoin_node_MODULE_SPEC_OP} ${Bitcoin-Node_FIND_VERSION}" )
56 | endif()
57 |
58 | pkg_check_modules( bitcoin_node ${_bitcoin_node_REQUIRED} ${_bitcoin_node_QUIET} "${_bitcoin_node_MODULE_SPEC}" )
59 | set( bitcoin_node_PKG "${_bitcoin_node_MODULE_SPEC}" )
60 | endif()
61 |
--------------------------------------------------------------------------------
/builds/cmake/modules/FindBitcoin-Protocol.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright (c) 2014-2025 libbitcoin-server developers (see COPYING).
3 | #
4 | # GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
5 | #
6 | ###############################################################################
7 | # FindBitcoin-Protocol
8 | #
9 | # Use this module by invoking find_package with the form::
10 | #
11 | # find_package( Bitcoin-Protocol
12 | # [version] # Minimum version
13 | # [REQUIRED] # Fail with error if bitcoin-protocol is not found
14 | # )
15 | #
16 | # Defines the following for use:
17 | #
18 | # bitcoin_protocol_FOUND - true if headers and requested libraries were found
19 | # bitcoin_protocol_INCLUDE_DIRS - include directories for bitcoin-protocol libraries
20 | # bitcoin_protocol_LIBRARY_DIRS - link directories for bitcoin-protocol libraries
21 | # bitcoin_protocol_LIBRARIES - bitcoin-protocol libraries to be linked
22 | # bitcoin_protocol_PKG - bitcoin-protocol pkg-config package specification.
23 | #
24 |
25 | if (MSVC)
26 | if ( Bitcoin-Protocol_FIND_REQUIRED )
27 | set( _bitcoin_protocol_MSG_STATUS "SEND_ERROR" )
28 | else ()
29 | set( _bitcoin_protocol_MSG_STATUS "STATUS" )
30 | endif()
31 |
32 | set( bitcoin_protocol_FOUND false )
33 | message( ${_bitcoin_protocol_MSG_STATUS} "MSVC environment detection for 'bitcoin-protocol' not currently supported." )
34 | else ()
35 | # required
36 | if ( Bitcoin-Protocol_FIND_REQUIRED )
37 | set( _bitcoin_protocol_REQUIRED "REQUIRED" )
38 | endif()
39 |
40 | # quiet
41 | if ( Bitcoin-Protocol_FIND_QUIETLY )
42 | set( _bitcoin_protocol_QUIET "QUIET" )
43 | endif()
44 |
45 | # modulespec
46 | if ( Bitcoin-Protocol_FIND_VERSION_COUNT EQUAL 0 )
47 | set( _bitcoin_protocol_MODULE_SPEC "libbitcoin-protocol" )
48 | else ()
49 | if ( Bitcoin-Protocol_FIND_VERSION_EXACT )
50 | set( _bitcoin_protocol_MODULE_SPEC_OP "=" )
51 | else ()
52 | set( _bitcoin_protocol_MODULE_SPEC_OP ">=" )
53 | endif()
54 |
55 | set( _bitcoin_protocol_MODULE_SPEC "libbitcoin-protocol ${_bitcoin_protocol_MODULE_SPEC_OP} ${Bitcoin-Protocol_FIND_VERSION}" )
56 | endif()
57 |
58 | pkg_check_modules( bitcoin_protocol ${_bitcoin_protocol_REQUIRED} ${_bitcoin_protocol_QUIET} "${_bitcoin_protocol_MODULE_SPEC}" )
59 | set( bitcoin_protocol_PKG "${_bitcoin_protocol_MODULE_SPEC}" )
60 | endif()
61 |
--------------------------------------------------------------------------------
/builds/cmake/modules/FindMbedtls.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright (c) 2014-2023 libbitcoin developers (see COPYING).
3 | #
4 | ###############################################################################
5 | # FindMbedtls
6 | #
7 | # Use this module by invoking find_package with the form::
8 | #
9 | # find_package( Mbedtls
10 | # [version] # Minimum version (ignored)
11 | # [REQUIRED] # Fail with error if mbedtls is not found
12 | # )
13 | #
14 | # Defines the following for use:
15 | #
16 | # mbedtls_FOUND - true if headers and requested libraries were found
17 | # mbedtls_LIBRARIES - mbedtls libraries to be linked
18 | # mbedtls_LIBS - mbedtls libraries to be linked
19 | #
20 |
21 | if (DEFINED Mbedtls_FIND_VERSION)
22 | message( SEND_ERROR
23 | "Library 'mbedtls' unable to process version: ${Mbedtls_FIND_VERSION}" )
24 | endif()
25 |
26 |
27 | if (MSVC)
28 | set( mbedtls_FOUND false )
29 | message( STATUS
30 | "MSVC environment detection for 'mbedtls' not currently supported." )
31 | else ()
32 | # conditionally include static library suffix
33 | if (BUILD_SHARED_LIBS)
34 | set( _mbedcrypto_lib_name "mbedcrypto" )
35 | set( _mbedtls_lib_name "mbedtls" )
36 | set( _mbedx509_lib_name "mbedx509" )
37 | else ()
38 | set( _mbedcrypto_lib_name "libmbedcrypto.a" )
39 | set( _mbedtls_lib_name "libmbedtls.a" )
40 | set( _mbedx509_lib_name "libmbedx509.a" )
41 | endif()
42 |
43 | find_library( tls_LIBRARIES "${_mbedtls_lib_name}" )
44 | find_library( crypto_LIBRARIES "${_mbedcrypto_lib_name}" )
45 | find_library( x509_LIBRARIES "${_mbedx509_lib_name}" )
46 |
47 | if (tls_LIBRARIES-NOTFOUND OR crypto_LIBRARIES-NOTFOUND OR x509_LIBRARIES-NOTFOUND)
48 | set( mbedtls_FOUND false )
49 | else ()
50 | set( mbedtls_FOUND true )
51 | set( mbedtls_LIBRARIES "${tls_LIBRARIES};${crypto_LIBRARIES};${x509_LIBRARIES}" )
52 | set( mbedtls_LIBS "-lmbedtls -lmbedcrypto -lmbedx509" )
53 | endif()
54 |
55 | if (NOT BUILD_SHARED_LIBS)
56 | set( mbedtls_STATIC_LIBRARIES "${mbedtls_LIBRARIES}" )
57 | endif()
58 | endif()
59 |
60 |
61 | if (NOT mbedtls_FOUND)
62 | if ( Mbedtls_FIND_REQUIRED )
63 | set( _mbedtls_MSG_STATUS "SEND_ERROR" )
64 | else ()
65 | set( _mbedtls_MSG_STATUS "STATUS" )
66 | endif()
67 |
68 | message( _mbedtls_MSG_STATUS "Library 'mbedtls' not found (${_mbedtls_MSG_STATUS})." )
69 | else ()
70 | message( "Library 'mbedtls' found." )
71 | endif()
72 |
--------------------------------------------------------------------------------
/builds/msvc/.gitignore:
--------------------------------------------------------------------------------
1 | *.bin
2 | *.json
3 | *.suo
4 | *.opensdf
5 | *.sdf
6 | *.log
7 | *.aps
8 | *.user
9 | *.ipch
10 | *.VC.*
11 | *.vsidx
12 |
--------------------------------------------------------------------------------
/builds/msvc/build/build_all.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 | CALL nuget_all.bat
3 | ECHO.
4 | CALL build_base.bat vs2022 libbitcoin-server "Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build"
5 | CALL build_base.bat vs2019 libbitcoin-server "Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"
6 | CALL build_base.bat vs2017 libbitcoin-server "Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"
7 | REM CALL build_base.bat vs2015 libbitcoin-server "Microsoft Visual Studio 14.0\VC"
8 | REM CALL build_base.bat vs2013 libbitcoin-server "Microsoft Visual Studio 12.0\VC"
9 | PAUSE
10 |
--------------------------------------------------------------------------------
/builds/msvc/build/build_base.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 | REM Usage: [buildbase.bat vs2017 libbitcoin "Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"]
3 | REM Usage: [buildbase.bat vs2015 libbitcoin "Microsoft Visual Studio 14.0\VC"]
4 | REM Usage: [buildbase.bat vs2013 libbitcoin "Microsoft Visual Studio 12.0\VC"]
5 |
6 | SET studio=%1
7 | SET project=%2
8 | SET version=%~3
9 |
10 | SET log=%studio%.log
11 | SET solution=..\%studio%\%project%.sln
12 | SET tools=%version%\vcvarsall.bat
13 | SET environment=%programfiles(x86)%\%tools%
14 |
15 | IF NOT EXIST "%environment%" SET environment=%programfiles%\%tools%
16 | IF NOT EXIST "%environment%" GOTO no_tools
17 |
18 | ECHO Building: %solution%
19 |
20 | CALL "%environment%" x86 > nul
21 | ECHO Platform=x86
22 |
23 | ECHO Configuration=StaticDebug
24 | msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=Win32 %solution% >> %log%
25 | IF errorlevel 1 GOTO error
26 | ECHO Configuration=StaticRelease
27 | msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %solution% >> %log%
28 | IF errorlevel 1 GOTO error
29 |
30 | CALL "%environment%" x86_amd64 > nul
31 | ECHO Platform=x64
32 |
33 | ECHO Configuration=StaticDebug
34 | msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=x64 %solution% >> %log%
35 | IF errorlevel 1 GOTO error
36 | ECHO Configuration=StaticRelease
37 | msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %solution% >> %log%
38 | IF errorlevel 1 GOTO error
39 |
40 | ECHO Complete: %solution%
41 | GOTO end
42 |
43 | :error
44 | ECHO *** ERROR, build terminated early, see: %log%
45 | GOTO end
46 |
47 | :no_tools
48 | ECHO *** ERROR, build tools not found: %tools%
49 |
50 | :end
51 |
52 |
--------------------------------------------------------------------------------
/builds/msvc/build/nuget_all.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 | ECHO Downloading libbitcoin vs2022 dependencies from NuGet
3 | CALL nuget.exe install ..\vs2022\bs\packages.config
4 | CALL nuget.exe install ..\vs2022\libbitcoin-server\packages.config
5 | CALL nuget.exe install ..\vs2022\libbitcoin-server-test\packages.config
6 | ECHO.
7 | ECHO Downloading libbitcoin vs2019 dependencies from NuGet
8 | CALL nuget.exe install ..\vs2019\bs\packages.config
9 | CALL nuget.exe install ..\vs2019\libbitcoin-server\packages.config
10 | CALL nuget.exe install ..\vs2019\libbitcoin-server-test\packages.config
11 | ECHO.
12 | ECHO Downloading libbitcoin vs2017 dependencies from NuGet
13 | CALL nuget.exe install ..\vs2017\bs\packages.config
14 | CALL nuget.exe install ..\vs2017\libbitcoin-server\packages.config
15 | CALL nuget.exe install ..\vs2017\libbitcoin-server-test\packages.config
16 | ECHO.
--------------------------------------------------------------------------------
/builds/msvc/debug.natvis:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 | { m_backend }
13 |
14 |
15 |
16 |
17 | { m_data }
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/builds/msvc/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
30 |
31 |
--------------------------------------------------------------------------------
/builds/msvc/properties/Common.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Common Settings
6 | Unicode
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | x64
15 |
16 |
17 |
18 |
19 | UNICODE;_UNICODE;%(PreprocessorDefinitions)
20 |
21 |
22 |
23 | Level4
24 | false
25 | false
26 | true
27 |
28 |
29 |
30 | /Zc:__cplusplus %(AdditionalOptions)
31 | true
32 | true
33 | false
34 | false
35 | stdc11
36 | stdcpp14
37 | stdcpp17
38 | stdcpp20
39 | false
40 | true
41 | true
42 |
43 |
44 |
45 |
46 | Level4
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/builds/msvc/properties/DLL.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Dynamic Library
6 | dynamic
7 | .dll
8 |
9 |
10 |
11 |
12 | _DLL;_WINDLL;%(PreprocessorDefinitions)
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/builds/msvc/properties/Debug.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | <_PropertySheetDisplayName>Debug Settings
10 | Debug
11 |
12 |
13 |
14 |
15 |
16 | EnableFastChecks
17 | ProgramDatabase
18 | true
19 | Disabled
20 | _DEBUG;%(PreprocessorDefinitions)
21 |
22 |
23 | _DEBUG;%(PreprocessorDefinitions)
24 |
25 |
26 | true
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/builds/msvc/properties/DebugDEXE.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Console Debug Dynamic
6 | dynamic
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | MultiThreadedDebugDLL
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/builds/msvc/properties/DebugDLL.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Dynamic Debug Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | MultiThreadedDebugDLL
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/builds/msvc/properties/DebugLEXE.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Console Debug Link Time Code Generation
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | MultiThreadedDebug
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/builds/msvc/properties/DebugLIB.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Static Debug Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | MultiThreadedDebug
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/builds/msvc/properties/DebugLTCG.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Static Debug Link Time Code Generation Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | MultiThreadedDebug
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/builds/msvc/properties/DebugSEXE.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Console Debug Static
6 | static
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | MultiThreadedDebug
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/builds/msvc/properties/EXE.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Console Application
6 | true
7 |
8 |
9 |
10 |
11 | _CONSOLE;%(PreprocessorDefinitions)
12 |
13 |
14 | Console
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/properties/LIB.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Static Library
6 | static
7 | .lib
8 |
9 |
10 |
11 |
12 | _LIB;%(PreprocessorDefinitions)
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/builds/msvc/properties/LTCG.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Link Time Code Generation Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/builds/msvc/properties/Link.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Link Time Code Generation Settings
6 | ltcg
7 |
8 |
9 |
10 |
11 | true
12 |
13 |
14 | UseLinkTimeCodeGeneration
15 |
16 |
17 | true
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/builds/msvc/properties/Messages.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Build Messages
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/properties/Output.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Output Settings
6 |
7 | $(ProjectDir)..\..\
8 | $(ProjectDir)..\..\..\..\
9 | $(ProjectDir)..\..\..\..\..\
10 | $(ProjectDir)..\..\..\..\bin\$(PlatformName)\$(DebugOrRelease)\$(PlatformToolset)\$(DefaultLinkage)\
11 | $(ProjectDir)..\..\..\..\obj\$(TargetName)\$(PlatformName)\$(DebugOrRelease)\$(PlatformToolset)\$(DefaultLinkage)\
12 | $(OutDir)
13 | $(TargetName)
14 | $(TargetDir)$(TargetName)$(TargetExt)
15 |
16 |
17 |
18 |
19 | $(OutDir)$(TargetName).lib
20 |
21 |
22 | $(OutDir)$(TargetName).log
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/builds/msvc/properties/Release.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | <_PropertySheetDisplayName>Release Settings
10 | Release
11 | false
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | false
20 |
21 |
22 | false
23 | true
24 | true
25 | Speed
26 | true
27 | AnySuitable
28 | true
29 | true
30 | MaxSpeed
31 |
32 |
33 |
34 |
35 | AdvancedVectorExtensions2
36 |
37 |
38 | ProgramDatabase
39 | true
40 | NDEBUG;%(PreprocessorDefinitions)
41 |
42 |
43 | NDEBUG;%(PreprocessorDefinitions)
44 |
45 |
46 | true
47 | true
48 | true
49 |
50 |
51 |
--------------------------------------------------------------------------------
/builds/msvc/properties/ReleaseDEXE.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Console Release Dynamic
6 | dynamic
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | MultiThreadedDLL
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/builds/msvc/properties/ReleaseDLL.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Dynamic Release Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | MultiThreadedDLL
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/builds/msvc/properties/ReleaseLEXE.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Console Release Link Time Code Generation
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | MultiThreaded
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/builds/msvc/properties/ReleaseLIB.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Static Release Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | MultiThreaded
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/builds/msvc/properties/ReleaseLTCG.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Static Release Link Time Code Generation Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | MultiThreaded
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/builds/msvc/properties/ReleaseSEXE.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Console Release Static
6 | static
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | MultiThreaded
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/builds/msvc/properties/Win32.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>x86 Settings
6 |
7 |
8 |
9 |
10 | WIN32;_WIN32;%(PreprocessorDefinitions)
11 |
12 |
13 | MachineX86
14 |
15 |
16 | /MACHINE:X86 %(AdditionalOptions)
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/builds/msvc/properties/x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>x64 Settings
6 |
7 |
8 |
9 |
10 |
13 | WIN32;_WIN32;WIN64;_WIN64;%(PreprocessorDefinitions)
14 |
15 |
16 | MachineX64
17 |
18 |
19 | /MACHINE:X64 %(AdditionalOptions)
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/builds/msvc/resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/libbitcoin/libbitcoin-server/ee9a976d292b1beb57c2edcbe4b54551f2b815e3/builds/msvc/resource.h
--------------------------------------------------------------------------------
/builds/msvc/resource.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/libbitcoin/libbitcoin-server/ee9a976d292b1beb57c2edcbe4b54551f2b815e3/builds/msvc/resource.rc
--------------------------------------------------------------------------------
/builds/msvc/vs2013/bs/bs.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 | {F45B7D90-90BC-41EF-0000-000000000001}
12 |
13 |
14 | {F45B7D90-90BC-41EF-0000-000000000000}
15 |
16 |
17 |
18 |
19 | src
20 |
21 |
22 | src
23 |
24 |
25 |
26 |
27 | src
28 |
29 |
30 | resource
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | resource
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/bs/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-blockchain.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-consensus.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-database.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-network.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Network Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\include\;%(AdditionalIncludeDirectories)
19 | BCT_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-network.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 |
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\bin\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-network)\;
28 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\obj\libbitcoin-network\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-network)\;%(AdditionalLibraryDirectories)
29 |
30 |
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\bin\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-network)\;
32 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\obj\libbitcoin-network\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-network)\;%(AdditionalLibraryDirectories)
33 |
34 |
35 |
36 |
37 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-network)\;
38 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\obj\libbitcoin-network\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-network)\;%(AdditionalLibraryDirectories)
39 |
40 |
41 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-network)\;
42 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\obj\libbitcoin-network\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-network)\;%(AdditionalLibraryDirectories)
43 |
44 |
45 |
46 |
47 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\arm;%(AdditionalLibraryDirectories)
48 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\amd64;%(AdditionalLibraryDirectories)
49 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib;%(AdditionalLibraryDirectories)
50 |
51 |
52 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-network.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-node.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Node Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\include\;%(AdditionalIncludeDirectories)
19 | BCN_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-node.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 |
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-node)\;
28 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
29 |
30 |
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-node)\;
32 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
33 |
34 |
35 |
36 |
37 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;
38 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
39 |
40 |
41 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;
42 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
43 |
44 |
45 |
46 |
47 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\arm;%(AdditionalLibraryDirectories)
48 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\amd64;%(AdditionalLibraryDirectories)
49 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib;%(AdditionalLibraryDirectories)
50 |
51 |
52 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-node.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-protocol.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-server-test/libbitcoin-server-test.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 | {66A0E586-2E3A-448F-0000-000000000000}
12 |
13 |
14 |
15 |
16 | src
17 |
18 |
19 | src
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-server-test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-server.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Server Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\include\;%(AdditionalIncludeDirectories)
19 | BCS_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-server.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 |
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-server)\;
28 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
29 |
30 |
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-server)\;
32 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
33 |
34 |
35 |
36 |
37 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;
38 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
39 |
40 |
41 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;
42 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
43 |
44 |
45 |
46 |
47 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\arm;%(AdditionalLibraryDirectories)
48 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\amd64;%(AdditionalLibraryDirectories)
49 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib;%(AdditionalLibraryDirectories)
50 |
51 |
52 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-server.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-server.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30723.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin-server", "libbitcoin-server\libbitcoin-server.vcxproj", "{73CE0AC2-ECB2-4E8D-A136-17840C0371A0}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin-server-test", "libbitcoin-server-test\libbitcoin-server-test.vcxproj", "{66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}"
9 | EndProject
10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bs", "bs\bs.vcxproj", "{F45B7D90-90BC-41EF-9AD1-9B29256A09FE}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | StaticDebug|Win32 = StaticDebug|Win32
15 | StaticDebug|x64 = StaticDebug|x64
16 | StaticRelease|Win32 = StaticRelease|Win32
17 | StaticRelease|x64 = StaticRelease|x64
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticDebug|Win32.ActiveCfg = DebugLIB|Win32
21 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticDebug|Win32.Build.0 = DebugLIB|Win32
22 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticDebug|x64.ActiveCfg = DebugLIB|x64
23 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticDebug|x64.Build.0 = DebugLIB|x64
24 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticRelease|Win32.ActiveCfg = ReleaseLIB|Win32
25 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticRelease|Win32.Build.0 = ReleaseLIB|Win32
26 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticRelease|x64.ActiveCfg = ReleaseLIB|x64
27 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticRelease|x64.Build.0 = ReleaseLIB|x64
28 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32
29 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32
30 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64
31 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticDebug|x64.Build.0 = DebugSEXE|x64
32 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32
33 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32
34 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64
35 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64
36 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32
37 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32
38 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64
39 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticDebug|x64.Build.0 = DebugSEXE|x64
40 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32
41 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32
42 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64
43 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64
44 | EndGlobalSection
45 | GlobalSection(SolutionProperties) = preSolution
46 | HideSolutionNode = FALSE
47 | EndGlobalSection
48 | EndGlobal
49 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-server/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/builds/msvc/vs2013/libbitcoin-system.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/bs/bs.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 | {F45B7D90-90BC-41EF-0000-000000000001}
12 |
13 |
14 | {F45B7D90-90BC-41EF-0000-000000000000}
15 |
16 |
17 |
18 |
19 | src
20 |
21 |
22 | src
23 |
24 |
25 |
26 |
27 | src
28 |
29 |
30 | resource
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | resource
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/bs/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-blockchain.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-consensus.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-database.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-network.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-node.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Node Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\include\;%(AdditionalIncludeDirectories)
19 | BCN_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-node.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 |
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-node)\;
28 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
29 |
30 |
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-node)\;
32 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
33 |
34 |
35 |
36 |
37 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;
38 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
39 |
40 |
41 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;
42 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
43 |
44 |
45 |
46 |
47 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\arm;%(AdditionalLibraryDirectories)
48 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\amd64;%(AdditionalLibraryDirectories)
49 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib;%(AdditionalLibraryDirectories)
50 |
51 |
52 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-node.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-protocol.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-server-test/libbitcoin-server-test.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 | {66A0E586-2E3A-448F-0000-000000000000}
12 |
13 |
14 |
15 |
16 | src
17 |
18 |
19 | src
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-server-test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-server.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Server Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\include\;%(AdditionalIncludeDirectories)
19 | BCS_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-server.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 |
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-server)\;
28 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Debug\CTP_Nov2013\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
29 |
30 |
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-server)\;
32 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Release\CTP_Nov2013\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
33 |
34 |
35 |
36 |
37 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;
38 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
39 |
40 |
41 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;
42 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
43 |
44 |
45 |
46 |
47 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\arm;%(AdditionalLibraryDirectories)
48 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib\amd64;%(AdditionalLibraryDirectories)
49 | $(ProgramFiles)\Microsoft Visual C++ Compiler Nov 2013 CTP\lib;%(AdditionalLibraryDirectories)
50 |
51 |
52 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-server.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-server.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin-server", "libbitcoin-server\libbitcoin-server.vcxproj", "{73CE0AC2-ECB2-4E8D-A136-17840C0371A0}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin-server-test", "libbitcoin-server-test\libbitcoin-server-test.vcxproj", "{66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}"
9 | EndProject
10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bs", "bs\bs.vcxproj", "{F45B7D90-90BC-41EF-9AD1-9B29256A09FE}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | StaticDebug|Win32 = StaticDebug|Win32
15 | StaticDebug|x64 = StaticDebug|x64
16 | StaticRelease|Win32 = StaticRelease|Win32
17 | StaticRelease|x64 = StaticRelease|x64
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticDebug|Win32.ActiveCfg = DebugLIB|Win32
21 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticDebug|Win32.Build.0 = DebugLIB|Win32
22 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticDebug|x64.ActiveCfg = DebugLIB|x64
23 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticDebug|x64.Build.0 = DebugLIB|x64
24 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticRelease|Win32.ActiveCfg = ReleaseLIB|Win32
25 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticRelease|Win32.Build.0 = ReleaseLIB|Win32
26 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticRelease|x64.ActiveCfg = ReleaseLIB|x64
27 | {73CE0AC2-ECB2-4E8D-A136-17840C0371A0}.StaticRelease|x64.Build.0 = ReleaseLIB|x64
28 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32
29 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32
30 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64
31 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticDebug|x64.Build.0 = DebugSEXE|x64
32 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32
33 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32
34 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64
35 | {66A0E586-2E3A-448F-BCD0-348AFEB0D5EA}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64
36 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32
37 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32
38 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64
39 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticDebug|x64.Build.0 = DebugSEXE|x64
40 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32
41 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32
42 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64
43 | {F45B7D90-90BC-41EF-9AD1-9B29256A09FE}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64
44 | EndGlobalSection
45 | GlobalSection(SolutionProperties) = preSolution
46 | HideSolutionNode = FALSE
47 | EndGlobalSection
48 | EndGlobal
49 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-server/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/builds/msvc/vs2015/libbitcoin-system.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/bs/bs.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 | {F45B7D90-90BC-41EF-0000-000000000001}
12 |
13 |
14 | {F45B7D90-90BC-41EF-0000-000000000000}
15 |
16 |
17 |
18 |
19 | src
20 |
21 |
22 | src
23 |
24 |
25 |
26 |
27 | src
28 |
29 |
30 | resource
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | resource
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/bs/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-blockchain.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Blockchain Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-blockchain\include\;%(AdditionalIncludeDirectories)
19 | BCB_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-blockchain.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 | $(ProjectDir)..\..\..\..\..\libbitcoin-blockchain\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-blockchain)\;
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-blockchain\obj\libbitcoin-blockchain\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-blockchain)\;%(AdditionalLibraryDirectories)
28 |
29 |
30 | $(ProjectDir)..\..\..\..\..\libbitcoin-blockchain\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-blockchain)\;
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-blockchain\obj\libbitcoin-blockchain\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-blockchain)\;%(AdditionalLibraryDirectories)
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-blockchain.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-consensus.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Consensus Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-consensus\include\;%(AdditionalIncludeDirectories)
19 | _WIN32_WINNT=0x0600;%(PreprocessorDefinitions)
20 | BCK_STATIC;%(PreprocessorDefinitions)
21 |
22 |
23 | libbitcoin-consensus.lib;%(AdditionalDependencies)
24 |
25 |
26 |
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-consensus\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-consensus)\;
28 | $(ProjectDir)..\..\..\..\..\libbitcoin-consensus\obj\libbitcoin-consensus\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-consensus)\;%(AdditionalLibraryDirectories)
29 |
30 |
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-consensus\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-consensus)\;
32 | $(ProjectDir)..\..\..\..\..\libbitcoin-consensus\obj\libbitcoin-consensus\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-consensus)\;%(AdditionalLibraryDirectories)
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-consensus.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-database.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Database Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-database\include\;%(AdditionalIncludeDirectories)
19 | BCD_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-database.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 | $(ProjectDir)..\..\..\..\..\libbitcoin-database\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-database)\;
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-database\obj\libbitcoin-database\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-database)\;%(AdditionalLibraryDirectories)
28 |
29 |
30 | $(ProjectDir)..\..\..\..\..\libbitcoin-database\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-database)\;
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-database\obj\libbitcoin-database\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-database)\;%(AdditionalLibraryDirectories)
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-database.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-network.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Network Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\include\;%(AdditionalIncludeDirectories)
19 | BCT_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-network.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-network)\;
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\obj\libbitcoin-network\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-network)\;%(AdditionalLibraryDirectories)
28 |
29 |
30 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-network)\;
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-network\obj\libbitcoin-network\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-network)\;%(AdditionalLibraryDirectories)
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-network.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-node.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Node Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\include\;%(AdditionalIncludeDirectories)
19 | BCN_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-node.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
28 |
29 |
30 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-node\obj\libbitcoin-node\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-node)\;%(AdditionalLibraryDirectories)
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-node.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-protocol.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Protocol Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-protocol\include\;%(AdditionalIncludeDirectories)
19 | BCP_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-protocol.lib;%(AdditionalDependencies)
23 | Iphlpapi.lib;%(AdditionalDependencies)
24 |
25 |
26 |
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-protocol\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-protocol)\;
28 | $(ProjectDir)..\..\..\..\..\libbitcoin-protocol\obj\libbitcoin-protocol\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-protocol)\;%(AdditionalLibraryDirectories)
29 |
30 |
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-protocol\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-protocol)\;
32 | $(ProjectDir)..\..\..\..\..\libbitcoin-protocol\obj\libbitcoin-protocol\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-protocol)\;%(AdditionalLibraryDirectories)
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-protocol.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-server-test/libbitcoin-server-test.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 | {66A0E586-2E3A-448F-0000-000000000000}
12 |
13 |
14 |
15 |
16 | src
17 |
18 |
19 | src
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-server-test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-server.import.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <_PropertySheetDisplayName>Libbitcoin Server Import Settings
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\include\;%(AdditionalIncludeDirectories)
19 | BCS_STATIC;%(PreprocessorDefinitions)
20 |
21 |
22 | libbitcoin-server.lib;%(AdditionalDependencies)
23 |
24 |
25 |
26 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;
27 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
28 |
29 |
30 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;
31 | $(ProjectDir)..\..\..\..\..\libbitcoin-server\obj\libbitcoin-server\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libbitcoin-server)\;%(AdditionalLibraryDirectories)
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-server.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-server/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/builds/msvc/vs2022/libbitcoin-system.import.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/builds/vscode/server.code-workspace:
--------------------------------------------------------------------------------
1 | {
2 | "folders": [
3 | {
4 | "path": "../../../libbitcoin-system"
5 | },
6 | {
7 | "path": "../../../libbitcoin-network"
8 | },
9 | {
10 | "path": "../../../libbitcoin-database"
11 | },
12 | {
13 | "path": "../../../libbitcoin-node"
14 | },
15 | {
16 | "path": "../../../libbitcoin-protocol"
17 | },
18 | {
19 | "path": "../../../libbitcoin-server"
20 | }
21 | ],
22 | "settings": {}
23 | }
24 |
--------------------------------------------------------------------------------
/console/libbitcoin.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/libbitcoin/libbitcoin-server/ee9a976d292b1beb57c2edcbe4b54551f2b815e3/console/libbitcoin.ico
--------------------------------------------------------------------------------
/console/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 | #include
21 | #include
22 | #include "executor.hpp"
23 |
24 | ////// This is some experimental code to explore emission of win32 stack dump.
25 | ////#ifdef HAVE_MSC
26 | ////#include "stack_trace.hpp"
27 |
28 | namespace libbitcoin {
29 | namespace system {
30 | std::istream& cin = cin_stream();
31 | std::ostream& cout = cout_stream();
32 | std::ostream& cerr = cerr_stream();
33 | int main(int argc, char* argv[]);
34 | } // namespace system
35 | } // namespace libbitcoin
36 |
37 | namespace bc = libbitcoin;
38 | ////std::filesystem::path symbols_path{};
39 | ////
40 | ////int wmain(int argc, wchar_t* argv[])
41 | ////{
42 | //// __try
43 | //// {
44 | //// return bc::system::call_utf8_main(argc, argv, &bc::system::main);
45 | //// }
46 | //// __except (dump_stack_trace(GetExceptionCode(), GetExceptionInformation()))
47 | //// {
48 | //// return -1;
49 | //// }
50 | ////}
51 | ////
52 | ////// This is invoked by dump_stack_trace.
53 | ////void handle_stack_trace(const std::string& trace)
54 | ////{
55 | //// if (trace.empty())
56 | //// {
57 | //// bc::system::cout << "<>" << std::endl;
58 | //// return;
59 | //// }
60 | ////
61 | //// bc::system::cout << "<>" << std::endl;
62 | //// bc::system::cout << trace << std::endl;
63 | //// bc::system::cout << "<>" << std::endl;
64 | ////}
65 | ////
66 | ////// This is invoked by dump_stack_trace.
67 | ////std::wstring pdb_path()
68 | ////{
69 | //// return bc::system::to_extended_path(symbols_path);
70 | ////}
71 | ////
72 | ////#else
73 | BC_USE_LIBBITCOIN_MAIN
74 | ////#endif
75 |
76 | /// Invoke this program with the raw arguments provided on the command line.
77 | /// All console input and output streams for the application originate here.
78 | int bc::system::main(int argc, char* argv[])
79 | {
80 | using namespace bc;
81 | using namespace bc::server;
82 | using namespace bc::system;
83 |
84 | // en.cppreference.com/w/cpp/io/ios_base/sync_with_stdio
85 | std::ios_base::sync_with_stdio(false);
86 |
87 | set_utf8_stdio();
88 | parser metadata(chain::selection::mainnet);
89 | const auto& args = const_cast(argv);
90 |
91 | if (!metadata.parse(argc, args, cerr))
92 | return -1;
93 |
94 | ////#if defined(HAVE_MSC)
95 | //// symbols_path = metadata.configured.log.symbols;
96 | ////#endif
97 |
98 | // requires _WIN32_WINNT set to 0x0602 (defaults 0x0602 in vc++ 2022).
99 | #if defined(HAVE_MSC) && defined(MEMORY_PRIORITY_INFORMATION)
100 |
101 | // Set low memory priority on the current process.
102 | const MEMORY_PRIORITY_INFORMATION priority{ MEMORY_PRIORITY_LOW };
103 | SetProcessInformation(
104 | GetCurrentProcess(),
105 | ProcessMemoryPriority,
106 | &priority,
107 | sizeof(priority));
108 |
109 | #endif
110 |
111 | executor host(metadata, cin, cout, cerr);
112 | ////return host.dispatch() ? 0 : -1;
113 | return host.menu() ? 0 : -1;
114 | }
115 |
--------------------------------------------------------------------------------
/data/bs:
--------------------------------------------------------------------------------
1 | #
2 | # Command-line completion for bs.
3 | #
4 | _bs()
5 | {
6 | local current="${COMP_WORDS[COMP_CWORD]}"
7 | local options=" --config --help --initchain --settings --version -c -h -i -s -v"
8 |
9 | COMPREPLY=( `compgen -W "$options" -- $current` )
10 | }
11 | complete -F _bs bs
12 |
--------------------------------------------------------------------------------
/data/fetch-tx.py:
--------------------------------------------------------------------------------
1 | #!python3
2 | import zmq
3 | import struct
4 | from binascii import hexlify, unhexlify
5 |
6 | # Connect to the server.
7 | context = zmq.Context()
8 | socket = context.socket(zmq.DEALER)
9 | socket.connect("tcp://mainnet.libbitcoin.net:9091")
10 |
11 | # Make the request in parts.
12 | socket.send(b'blockchain.fetch_transaction2', zmq.SNDMORE)
13 | socket.send(struct.pack('I', 42), zmq.SNDMORE)
14 | socket.send(unhexlify('60e030aba2f593caf913a7d96880ff227143bfc370d03dbaee37d582801ebd83')[::-1])
15 |
16 | # Collect the response in parts.
17 | response_command = socket.recv()
18 | response_id = socket.recv()
19 | response_body = socket.recv()
20 |
21 | # Decode and print transaction from message payload.
22 | print(hexlify(response_body[4:]).decode('ascii'))
23 |
--------------------------------------------------------------------------------
/data/subscribe-block.py:
--------------------------------------------------------------------------------
1 | #!python3
2 | import sys
3 | import zmq
4 | import struct
5 | from binascii import hexlify, unhexlify
6 |
7 | # Connect to the public block service.
8 | url = 'tcp://mainnet.libbitcoin.net:9093'
9 | if len(sys.argv) > 1:
10 | url = sys.argv[1]
11 |
12 | context = zmq.Context()
13 | socket = context.socket(zmq.SUB)
14 | socket.connect(url)
15 | socket.setsockopt(zmq.SUBSCRIBE, b'')
16 | socket.setsockopt(zmq.TCP_KEEPALIVE, 1)
17 |
18 | while True:
19 | # Collect the response in parts.
20 | sequence = struct.unpack(' 1:
9 | url = sys.argv[1]
10 |
11 | context = zmq.Context()
12 | socket = context.socket(zmq.SUB)
13 | socket.connect(url)
14 | socket.setsockopt(zmq.SUBSCRIBE, b'')
15 |
16 | while True:
17 | # Collect the response in parts.
18 | sequence = struct.unpack(' 1:
10 | url = sys.argv[1]
11 |
12 | context = zmq.Context()
13 | socket = context.socket(zmq.SUB)
14 | socket.connect(url)
15 | socket.setsockopt(zmq.SUBSCRIBE, b'')
16 | socket.setsockopt(zmq.TCP_KEEPALIVE, 1)
17 |
18 | while True:
19 | # Collect the response in parts.
20 | sequence = struct.unpack('
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 | #include
39 | #include
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/include/bitcoin/server/configuration.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_CONFIGURATION_HPP
20 | #define LIBBITCOIN_SERVER_CONFIGURATION_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | /// Server configuration, thread safe.
31 | class BCS_API configuration
32 | {
33 | public:
34 | DEFAULT_COPY_MOVE_DESTRUCT(configuration);
35 |
36 | configuration(system::chain::selection context) NOEXCEPT;
37 |
38 | /// Environment.
39 | std::filesystem::path file{};
40 |
41 | /// Information.
42 | bool help{};
43 | bool hardware{};
44 | bool settings{};
45 | bool version{};
46 |
47 | /// Actions.
48 | bool newstore{};
49 | bool backup{};
50 | bool restore{};
51 |
52 | /// Chain scans.
53 | bool flags{};
54 | bool information{};
55 | bool slabs{};
56 | bool buckets{};
57 | bool collisions{};
58 |
59 | /// Ad-hoc Testing.
60 | bool test{};
61 | bool write{};
62 |
63 | /// Settings.
64 | log::settings log;
65 | server::settings server;
66 | node::settings node;
67 | network::settings network;
68 | database::settings database;
69 | system::settings bitcoin;
70 | };
71 |
72 | } // namespace server
73 | } // namespace libbitcoin
74 |
75 | #endif
76 |
--------------------------------------------------------------------------------
/include/bitcoin/server/define.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_DEFINE_HPP
20 | #define LIBBITCOIN_SERVER_DEFINE_HPP
21 |
22 | #include
23 |
24 | // We use the generic helper definitions in libbitcoin to define BCS_API
25 | // and BCS_INTERNAL. BCS_API is used for the public API symbols. It either DLL
26 | // imports or DLL exports (or does nothing for static build) BCS_INTERNAL is
27 | // used for non-api symbols.
28 |
29 | #if defined BCS_STATIC
30 | #define BCS_API
31 | #define BCS_INTERNAL
32 | #elif defined BCS_DLL
33 | #define BCS_API BC_HELPER_DLL_EXPORT
34 | #define BCS_INTERNAL BC_HELPER_DLL_LOCAL
35 | #else
36 | #define BCS_API BC_HELPER_DLL_IMPORT
37 | #define BCS_INTERNAL BC_HELPER_DLL_LOCAL
38 | #endif
39 |
40 | // Log name.
41 | #define LOG_SERVER "server"
42 | #define LOG_SERVER_HTTP "http"
43 |
44 | // Avoid namespace conflict between boost::placeholders and std::placeholders.
45 | ////#define BOOST_BIND_NO_PLACEHOLDERS
46 |
47 | ////#include
48 | ////#include
49 | ////#include
50 | ////#include
51 | ////#include
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/include/bitcoin/server/interface/server.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_SERVER_HPP
20 | #define LIBBITCOIN_SERVER_SERVER_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | /// Server interface.
31 | /// Class and method names are published and mapped to the zeromq interface.
32 | class BCS_API server
33 | {
34 | public:
35 | /// Fetch the server's version.
36 | static void version(server_node& node, const message& request,
37 | send_handler handler);
38 | };
39 |
40 | } // namespace server
41 | } // namespace libbitcoin
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/include/bitcoin/server/interface/subscribe.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_SUBSCRIBE_HPP
20 | #define LIBBITCOIN_SERVER_SUBSCRIBE_HPP
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | namespace libbitcoin {
27 | namespace server {
28 |
29 | /// Subscribe interface.
30 | /// Class and method names are published and mapped to the zeromq interface.
31 | class BCS_API subscribe
32 | {
33 | public:
34 | /// Subscribe to payment address notifications by key.
35 | static void key(server_node& node, const message& request,
36 | send_handler handler);
37 | };
38 |
39 | } // namespace server
40 | } // namespace libbitcoin
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/include/bitcoin/server/interface/transaction_pool.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_TRANSACTION_POOL_HPP
20 | #define LIBBITCOIN_SERVER_TRANSACTION_POOL_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | /// Transaction pool interface.
31 | /// Class and method names are published and mapped to the zeromq interface.
32 | class BCS_API transaction_pool
33 | {
34 | public:
35 | /// Fetch a transaction from the transaction pool (or chain), by its hash.
36 | static void fetch_transaction(server_node& node, const message& request,
37 | send_handler handler);
38 |
39 | /// Fetch a transaction with witness from tx pool (or chain), by its hash.
40 | static void fetch_transaction2(server_node& node, const message& request,
41 | send_handler handler);
42 |
43 | /// Save to tx pool and announce to all connected peers.
44 | static void broadcast(server_node& node, const message& request,
45 | send_handler handler);
46 |
47 | /// Validate a transaction against the transaction pool and blockchain.
48 | static void validate2(server_node& node, const message& request,
49 | send_handler handler);
50 |
51 | private:
52 | static void transaction_fetched(const system::code& ec,
53 | system::chain::transaction::cptr tx, size_t, size_t,
54 | const message& request, send_handler handler);
55 |
56 | static void handle_broadcast(const system::code& ec,
57 | const message& request, send_handler handler);
58 |
59 | static void handle_validated2(const system::code& ec,
60 | const message& request, send_handler handler);
61 | };
62 |
63 | } // namespace server
64 | } // namespace libbitcoin
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/include/bitcoin/server/interface/unsubscribe.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_UNSUBSCRIBE_HPP
20 | #define LIBBITCOIN_SERVER_UNSUBSCRIBE_HPP
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | namespace libbitcoin {
27 | namespace server {
28 |
29 | /// Unsubscribe interface.
30 | /// Class and method names are published and mapped to the zeromq interface.
31 | class BCS_API unsubscribe
32 | {
33 | public:
34 | /// Unsubscribe to payment address notifications by key.
35 | static void key(server_node& node, const message& request,
36 | send_handler handler);
37 |
38 | /// Unsubscribe to stealth address notifications by prefix.
39 | static void stealth(server_node& node, const message& request,
40 | send_handler handler);
41 | };
42 |
43 | } // namespace server
44 | } // namespace libbitcoin
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/include/bitcoin/server/messages/message.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_MESSAGE
20 | #define LIBBITCOIN_SERVER_MESSAGE
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | class BCS_API message
31 | {
32 | public:
33 | static system::data_chunk to_bytes(const system::code& ec);
34 |
35 | // Constructors.
36 | //-------------------------------------------------------------------------
37 |
38 | /// Construct a default message (to be read).
39 | message(bool secure);
40 |
41 | // Create an error message in respose to the request.
42 | message(const message& request, const system::code& ec);
43 |
44 | // Create a general message in respose to the request.
45 | message(const message& request, system::data_chunk&& data);
46 |
47 | // Create an error notification message for the subscription.
48 | message(const subscription& route, const std::string& command,
49 | const system::code& ec);
50 |
51 | //// Construct a notification message for the subscription.
52 | message(const subscription& route, const std::string& command,
53 | system::data_chunk&& data);
54 |
55 | // Properties.
56 | //-------------------------------------------------------------------------
57 |
58 | /// Query command (used for subscription, always returned to caller).
59 | const std::string& command() const;
60 |
61 | /// Arbitrary caller data (returned to caller for correlation).
62 | uint32_t id() const;
63 |
64 | /// Serialized query or response (defined in relation to command).
65 | const system::data_chunk& data() const;
66 |
67 | /// The message route.
68 | const server::route& route() const;
69 |
70 | /// The incoming message route security context.
71 | bool secure() const;
72 |
73 | // Send/Receive.
74 | //-------------------------------------------------------------------------
75 |
76 | /// Receive a message via the socket.
77 | system::code receive(bc::protocol::zmq::socket& socket);
78 |
79 | /// Send the message via the socket.
80 | system::code send(bc::protocol::zmq::socket& socket) const;
81 |
82 | protected:
83 | std::string command_;
84 | uint32_t id_;
85 | system::data_chunk data_;
86 | server::route route_;
87 | const bool secure_;
88 | };
89 |
90 | typedef std::function send_handler;
91 |
92 | } // namespace server
93 | } // namespace libbitcoin
94 |
95 | #endif
96 |
--------------------------------------------------------------------------------
/include/bitcoin/server/messages/route.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_ROUTE
20 | #define LIBBITCOIN_SERVER_ROUTE
21 |
22 | #include
23 | #include
24 |
25 | namespace libbitcoin {
26 | namespace server {
27 |
28 | /// This class is not thread safe.
29 | /// This simple route is limited in accordance with v2/v3 design.
30 | /// It allows for only one address, optionally delimited for support of REQ
31 | /// (delimited) and DEALER clients (with or without a delimiter). A REQ client
32 | /// is synchronous so cannot receive notifications. A DEALER is asynchronous
33 | /// and can be delimited or otherwise. We must match the delimiter so that the
34 | /// undelimited DEALER (vs) will not fail.
35 | class BCS_API route
36 | {
37 | public:
38 | /// Construct a default route.
39 | route();
40 |
41 | /// A printable address for logging only.
42 | std::string display() const;
43 |
44 | /// The message route is delimited using an empty frame.
45 | bool delimited() const;
46 |
47 | /// Set whether the address is delimited.
48 | void set_delimited(bool value);
49 |
50 | /// The simple route supports only one address.
51 | bc::protocol::zmq::message::address address() const;
52 |
53 | /// Set the address.
54 | void set_address(const bc::protocol::zmq::message::address& value);
55 |
56 | protected:
57 | bool delimited_;
58 | bc::protocol::zmq::message::address address_;
59 | };
60 |
61 | } // namespace server
62 | } // namespace libbitcoin
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/include/bitcoin/server/messages/subscription.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_SUBSCRIPTION_HPP
20 | #define LIBBITCOIN_SERVER_SUBSCRIPTION_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 |
28 | namespace libbitcoin {
29 | namespace server {
30 |
31 | /// This class is threadsafe and pretends to be const.
32 | /// Caller must maange the race between increment and sequence.
33 | class BCS_API subscription
34 | : public route
35 | {
36 | public:
37 | /// Copy constructor, required for bimap.
38 | subscription(const subscription& other);
39 |
40 | /// Construct subscription state from an existing route.
41 | subscription(const route& return_route, uint32_t id, time_t now);
42 |
43 | /// Arbitrary caller data, returned to caller on each notification.
44 | uint32_t id() const;
45 |
46 | /// Last subscription time, used for expirations.
47 | time_t updated() const;
48 |
49 | /// Renew subscription time to delay expiration.
50 | /// This is mutable so that change does not force a hash table update.
51 | void set_updated(time_t now) const;
52 |
53 | /// Increment sequence, indicating a send attempt.
54 | /// This is mutable so that change does not force a hash table update.
55 | void increment() const;
56 |
57 | /// The ordinal of the current subscription instance.
58 | uint16_t sequence() const;
59 |
60 | /// Assignment required for bimap equal_range.
61 | subscription& operator=(const subscription other);
62 |
63 | /// Age (only) comparison, required for bimap multiset ordering.
64 | bool operator<(const subscription& other) const;
65 |
66 | /// Equality comparison, required for bimap search by subscription.
67 | bool operator==(const subscription& other) const;
68 |
69 | /// Equality comparison, required for bimap search by route.
70 | bool operator==(const route& other) const;
71 |
72 | // Swap implementation required to properly handle base class.
73 | friend void swap(subscription& left, subscription& right);
74 |
75 | protected:
76 | uint32_t id_;
77 | mutable std::atomic updated_;
78 | mutable std::atomic sequence_;
79 | };
80 |
81 | } // namespace server
82 | } // namespace libbitcoin
83 |
84 | #endif
85 |
--------------------------------------------------------------------------------
/include/bitcoin/server/parser.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_PARSER_HPP
20 | #define LIBBITCOIN_SERVER_PARSER_HPP
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | // Not localizable.
27 | #define BS_HELP_VARIABLE "help"
28 | #define BS_HARDWARE_VARIABLE "hardware"
29 | #define BS_SETTINGS_VARIABLE "settings"
30 | #define BS_VERSION_VARIABLE "version"
31 | #define BS_NEWSTORE_VARIABLE "newstore"
32 | #define BS_BACKUP_VARIABLE "backup"
33 | #define BS_RESTORE_VARIABLE "restore"
34 |
35 | #define BS_FLAGS_VARIABLE "flags"
36 | #define BS_SLABS_VARIABLE "slabs"
37 | #define BS_BUCKETS_VARIABLE "buckets"
38 | #define BS_COLLISIONS_VARIABLE "collisions"
39 | #define BS_INFORMATION_VARIABLE "information"
40 |
41 | #define BS_READ_VARIABLE "test"
42 | #define BS_WRITE_VARIABLE "write"
43 |
44 | // This must be lower case but the env var part can be any case.
45 | #define BS_CONFIG_VARIABLE "config"
46 |
47 | // This must match the case of the env var.
48 | #define BS_ENVIRONMENT_VARIABLE_PREFIX "BS_"
49 |
50 | namespace libbitcoin {
51 | namespace server {
52 |
53 | // TODO: derive from node parser and add new settings.
54 | // TODO: implement parsers in downlevel libraries.
55 |
56 | /// Parse configurable values from environment variables, settings file, and
57 | /// command line positional and non-positional options.
58 | class BCS_API parser
59 | : public system::config::parser
60 | {
61 | public:
62 | parser(system::chain::selection context) NOEXCEPT;
63 | parser(const configuration& defaults) NOEXCEPT;
64 |
65 | /// Load command line options (named).
66 | virtual options_metadata load_options() THROWS;
67 |
68 | /// Load command line arguments (positional).
69 | virtual arguments_metadata load_arguments() THROWS;
70 |
71 | /// Load environment variable settings.
72 | virtual options_metadata load_environment() THROWS;
73 |
74 | /// Load configuration file settings.
75 | virtual options_metadata load_settings() THROWS;
76 |
77 | /// Parse all configuration into member settings.
78 | virtual bool parse(int argc, const char* argv[],
79 | std::ostream& error) THROWS;
80 |
81 | /// The populated configuration settings values.
82 | configuration configured;
83 | };
84 |
85 | } // namespace server
86 | } // namespace libbitcoin
87 |
88 | #endif
89 |
--------------------------------------------------------------------------------
/include/bitcoin/server/services/block_service.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_BLOCK_SERVICE_HPP
20 | #define LIBBITCOIN_SERVER_BLOCK_SERVICE_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | class server_node;
31 |
32 | // This class is thread safe.
33 | // Subscribe to block acceptances into the long chain.
34 | class BCS_API block_service
35 | : public bc::protocol::zmq::worker
36 | {
37 | public:
38 | typedef std::shared_ptr ptr;
39 |
40 | /// Construct a block service.
41 | block_service(bc::protocol::zmq::authenticator& authenticator,
42 | server_node& node, bool secure);
43 |
44 | /// Start the service.
45 | bool start() NOEXCEPT override;
46 |
47 | protected:
48 | typedef bc::protocol::zmq::socket socket;
49 |
50 | virtual bool bind(socket& xpub, socket& xsub);
51 | virtual bool unbind(socket& xpub, socket& xsub);
52 |
53 | // Implement the service.
54 | virtual void work() override;
55 |
56 | private:
57 | bool handle_reorganization(const system::code& ec, size_t fork_height,
58 | system::chain::block::cptr incoming,
59 | system::chain::block::cptr outgoing);
60 |
61 | void publish_blocks(uint32_t fork_height,
62 | system::chain::block::cptr blocks);
63 | void publish_block(socket& publisher, size_t height,
64 | system::chain::block::cptr block);
65 |
66 | // These are thread safe.
67 | const bool secure_;
68 | const std::string security_;
69 | const bc::server::settings& settings_;
70 | const bc::protocol::settings& external_;
71 | const bc::protocol::settings internal_;
72 | const protocol::endpoint service_;
73 | const protocol::endpoint worker_;
74 | bc::protocol::zmq::authenticator& authenticator_;
75 | server_node& node_;
76 |
77 | // This is protected by reorganization non-concurrency.
78 | uint16_t sequence_;
79 | };
80 |
81 | } // namespace server
82 | } // namespace libbitcoin
83 |
84 | #endif
85 |
--------------------------------------------------------------------------------
/include/bitcoin/server/services/heartbeat_service.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_HEARTBEAT_SERVICE_HPP
20 | #define LIBBITCOIN_SERVER_HEARTBEAT_SERVICE_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | class server_node;
31 |
32 | // This class is thread safe.
33 | // Subscribe to a pulse from a dedicated service endpoint.
34 | class BCS_API heartbeat_service
35 | : public bc::protocol::zmq::worker
36 | {
37 | public:
38 | typedef std::shared_ptr ptr;
39 |
40 | /// Construct a heartbeat endpoint.
41 | heartbeat_service(bc::protocol::zmq::authenticator& authenticator,
42 | server_node& node, bool secure);
43 |
44 | protected:
45 | typedef bc::protocol::zmq::socket socket;
46 |
47 | virtual bool bind(socket& publisher);
48 | virtual bool unbind(socket& publisher);
49 |
50 | // Implement the service.
51 | virtual void work();
52 |
53 | // Publish the heartbeat (no worker).
54 | void publish(socket& socket);
55 |
56 | private:
57 | int32_t pulse_milliseconds() const;
58 |
59 | // These are thread safe.
60 | const bool secure_;
61 | const std::string security_;
62 | const bc::server::settings& settings_;
63 | const bc::protocol::settings& external_;
64 | const bc::protocol::endpoint service_;
65 | bc::protocol::zmq::authenticator& authenticator_;
66 | server_node& node_;
67 |
68 | // This is protected by limit to single worker thread.
69 | uint16_t sequence_;
70 | };
71 |
72 | } // namespace server
73 | } // namespace libbitcoin
74 |
75 | #endif
76 |
--------------------------------------------------------------------------------
/include/bitcoin/server/services/query_service.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_QUERY_SERVICE_HPP
20 | #define LIBBITCOIN_SERVER_QUERY_SERVICE_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | class server_node;
31 |
32 | // This class is thread safe.
33 | // Submit queries and address subscriptions and receive address notifications.
34 | class BCS_API query_service
35 | : public bc::protocol::zmq::worker
36 | {
37 | public:
38 | typedef std::shared_ptr ptr;
39 |
40 | /// A reference to each inprocess worker endpoint.
41 | static const bc::protocol::endpoint& worker_endpoint(bool secure);
42 |
43 | /// Construct a query service.
44 | query_service(bc::protocol::zmq::authenticator& authenticator,
45 | server_node& node, bool secure);
46 |
47 | protected:
48 | typedef bc::protocol::zmq::socket socket;
49 |
50 | virtual bool bind(socket& router, socket& dealer);
51 | virtual bool unbind(socket& router, socket& dealer);
52 |
53 | // Implement the service.
54 | virtual void work();
55 |
56 | private:
57 | // These are thread safe.
58 | const bool secure_;
59 | const std::string security_;
60 | const bc::server::settings& settings_;
61 | const bc::protocol::settings& external_;
62 | const bc::protocol::settings internal_;
63 | const bc::protocol::endpoint& service_;
64 | const bc::protocol::endpoint& worker_;
65 | bc::protocol::zmq::authenticator& authenticator_;
66 | };
67 |
68 | } // namespace server
69 | } // namespace libbitcoin
70 |
71 | #endif
72 |
--------------------------------------------------------------------------------
/include/bitcoin/server/services/transaction_service.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_TRANSACTION_SERVICE_HPP
20 | #define LIBBITCOIN_SERVER_TRANSACTION_SERVICE_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | class server_node;
31 |
32 | // This class is thread safe.
33 | // Subscribe to transaction acceptances into the transaction memory pool.
34 | class BCS_API transaction_service
35 | : public bc::protocol::zmq::worker
36 | {
37 | public:
38 | typedef std::shared_ptr ptr;
39 |
40 | /// Construct a transaction service.
41 | transaction_service(bc::protocol::zmq::authenticator& authenticator,
42 | server_node& node, bool secure);
43 |
44 | /// Start the service.
45 | bool start() NOEXCEPT override;
46 |
47 | protected:
48 | typedef bc::protocol::zmq::socket socket;
49 |
50 | virtual bool bind(socket& xpub, socket& xsub);
51 | virtual bool unbind(socket& xpub, socket& xsub);
52 |
53 | // Implement the service.
54 | virtual void work() override;
55 |
56 | private:
57 | bool handle_transaction(const system::code& ec,
58 | system::chain::transaction::cptr tx);
59 | void publish_transaction(system::chain::transaction::cptr tx);
60 |
61 | // These are thread safe.
62 | const bool secure_;
63 | const std::string security_;
64 | const bc::server::settings& settings_;
65 | const bc::protocol::settings& external_;
66 | const bc::protocol::settings internal_;
67 | const bc::protocol::endpoint service_;
68 | const bc::protocol::endpoint worker_;
69 | bc::protocol::zmq::authenticator& authenticator_;
70 | server_node& node_;
71 |
72 | // This is protected by tx notification non-concurrency.
73 | uint16_t sequence_;
74 | };
75 |
76 | } // namespace server
77 | } // namespace libbitcoin
78 |
79 | #endif
80 |
--------------------------------------------------------------------------------
/include/bitcoin/server/settings.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_SETTINGS_HPP
20 | #define LIBBITCOIN_SERVER_SETTINGS_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | /// Common server configuration settings, properties not thread safe.
31 | class BCS_API settings
32 | {
33 | public:
34 | settings();
35 | settings(system::chain::selection context);
36 |
37 | /// Times.
38 | std::chrono::steady_clock::duration heartbeat_service() const;
39 | std::chrono::steady_clock::duration subscription_expiration() const;
40 |
41 | /// Endpoints.
42 | const protocol::endpoint& zeromq_query_endpoint(bool secure) const;
43 | const protocol::endpoint& zeromq_heartbeat_endpoint(bool secure) const;
44 | const protocol::endpoint& zeromq_block_endpoint(bool secure) const;
45 | const protocol::endpoint& zeromq_transaction_endpoint(bool secure) const;
46 |
47 | /// [server]
48 | bool priority;
49 | bool secure_only;
50 | uint16_t query_workers;
51 | uint32_t subscription_limit;
52 | uint32_t subscription_expiration_minutes;
53 | uint32_t heartbeat_service_seconds;
54 | bool block_service_enabled;
55 | bool transaction_service_enabled;
56 | protocol::authorities clients{};
57 | protocol::authorities blacklists{};
58 |
59 | /// [zeromq] secure
60 | protocol::endpoint zeromq_secure_query_endpoint;
61 | protocol::endpoint zeromq_secure_heartbeat_endpoint;
62 | protocol::endpoint zeromq_secure_block_endpoint;
63 | protocol::endpoint zeromq_secure_transaction_endpoint;
64 |
65 | /// [zeromq] clear
66 | protocol::endpoint zeromq_public_query_endpoint;
67 | protocol::endpoint zeromq_public_heartbeat_endpoint;
68 | protocol::endpoint zeromq_public_block_endpoint;
69 | protocol::endpoint zeromq_public_transaction_endpoint;
70 |
71 | /// [zeromq] keys
72 | protocol::sodium zeromq_server_private_key{};
73 | protocol::sodiums zeromq_client_public_keys{};
74 | };
75 |
76 | } // namespace server
77 | } // namespace libbitcoin
78 |
79 | #endif
80 |
--------------------------------------------------------------------------------
/include/bitcoin/server/version.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////
2 | // Copyright (c) 2014-2025 libbitcoin-server developers (see COPYING).
3 | //
4 | // GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
5 | //
6 | ///////////////////////////////////////////////////////////////////////////////
7 | #ifndef LIBBITCOIN_SERVER_VERSION_HPP
8 | #define LIBBITCOIN_SERVER_VERSION_HPP
9 |
10 | /**
11 | * The semantic version of this repository as: [major].[minor].[patch]
12 | * For interpretation of the versioning scheme see: http://semver.org
13 | */
14 |
15 | #define LIBBITCOIN_SERVER_VERSION "4.0.0"
16 | #define LIBBITCOIN_SERVER_MAJOR_VERSION 4
17 | #define LIBBITCOIN_SERVER_MINOR_VERSION 0
18 | #define LIBBITCOIN_SERVER_PATCH_VERSION 0
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/include/bitcoin/server/workers/authenticator.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_SECURE_AUTHENTICATOR_HPP
20 | #define LIBBITCOIN_SERVER_SECURE_AUTHENTICATOR_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace libbitcoin {
28 | namespace server {
29 |
30 | class server_node;
31 |
32 | class BCS_API authenticator
33 | : public bc::protocol::zmq::authenticator
34 | {
35 | public:
36 | typedef std::shared_ptr ptr;
37 |
38 | /// Construct an instance of the authenticator.
39 | authenticator(server_node& node);
40 |
41 | /// Apply authentication to the socket.
42 | bool apply(bc::protocol::zmq::socket& socket, const std::string& domain,
43 | bool secure) NOEXCEPT override;
44 | };
45 |
46 | } // namespace server
47 | } // namespace libbitcoin
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/include/bitcoin/server/workers/query_worker.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #ifndef LIBBITCOIN_SERVER_QUERY_WORKER_HPP
20 | #define LIBBITCOIN_SERVER_QUERY_WORKER_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | namespace libbitcoin {
30 | namespace server {
31 |
32 | class server_node;
33 |
34 | // This class is thread safe.
35 | // Provide asynchronous query responses to the query service.
36 | class BCS_API query_worker
37 | : public bc::protocol::zmq::worker
38 | {
39 | public:
40 | typedef std::shared_ptr ptr;
41 |
42 | /// Construct a query worker.
43 | query_worker(bc::protocol::zmq::authenticator& authenticator,
44 | server_node& node, bool secure);
45 |
46 | protected:
47 | typedef bc::protocol::zmq::socket socket;
48 |
49 | typedef std::function command_handler;
50 | typedef std::unordered_map command_map;
51 |
52 | virtual void attach_interface();
53 | virtual void attach(const std::string& command, command_handler handler);
54 |
55 | virtual bool connect(socket& dealer);
56 | virtual bool disconnect(socket& dealer);
57 | virtual void query(socket& dealer);
58 |
59 | // Implement the worker.
60 | virtual void work();
61 |
62 | private:
63 | static void send(const message& response,
64 | bc::protocol::zmq::socket& dealer);
65 |
66 | // These are thread safe.
67 | const bool secure_;
68 | const std::string security_;
69 | const bc::server::settings& settings_;
70 | const bc::protocol::settings& external_;
71 | const bc::protocol::settings internal_;
72 | const bc::protocol::endpoint& worker_;
73 | bc::protocol::zmq::authenticator& authenticator_;
74 | server_node& node_;
75 |
76 | // This is protected by worker base class mutex.
77 | command_map command_handlers_;
78 | };
79 |
80 | } // namespace server
81 | } // namespace libbitcoin
82 |
83 | #endif
84 |
--------------------------------------------------------------------------------
/libbitcoin-server-test_runner.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ###############################################################################
3 | # Copyright (c) 2014-2025 libbitcoin-server developers (see COPYING).
4 | #
5 | # GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
6 | #
7 | ###############################################################################
8 |
9 | # Define tests and options.
10 | #==============================================================================
11 | BOOST_UNIT_TEST_OPTIONS=\
12 | "--run_test=* "\
13 | "--log_level=warning "\
14 | "--show_progress=no "\
15 | "--detect_memory_leak=0 "\
16 | "--report_level=no "\
17 | "--build_info=yes"
18 |
19 |
20 | # Run tests.
21 | #==============================================================================
22 | # ALlow CI to send errors to standard output
23 | if [[ $CI == true ]]; then
24 | ./test/libbitcoin-server-test ${BOOST_UNIT_TEST_OPTIONS}
25 | else
26 | ./test/libbitcoin-server-test ${BOOST_UNIT_TEST_OPTIONS} > test.log
27 | fi
28 |
--------------------------------------------------------------------------------
/libbitcoin-server.pc.in:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright (c) 2014-2025 libbitcoin-server developers (see COPYING).
3 | #
4 | # GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
5 | #
6 | ###############################################################################
7 |
8 | # Substitutions
9 | #==============================================================================
10 | prefix=@prefix@
11 | exec_prefix=@exec_prefix@
12 | libdir=@libdir@
13 | includedir=@includedir@
14 |
15 |
16 | # Metadata
17 | #==============================================================================
18 | Name: libbitcoin-server
19 | Description: Bitcoin Full Node and Query Server
20 | URL: https://github.com/libbitcoin/libbitcoin-server
21 | Version: @PACKAGE_VERSION@
22 |
23 |
24 | # Variables
25 | #==============================================================================
26 | # Dependencies that publish package configuration.
27 | #------------------------------------------------------------------------------
28 | Requires: libbitcoin-protocol >= 4.0.0 libbitcoin-node >= 4.0.0
29 |
30 | # Include directory and any other required compiler flags.
31 | #------------------------------------------------------------------------------
32 | Cflags: -I${includedir}
33 |
34 | # Lib directory, lib and any required that do not publish pkg-config.
35 | #------------------------------------------------------------------------------
36 | Libs: -L${libdir} -lbitcoin-server
37 |
38 |
--------------------------------------------------------------------------------
/m4/.gitignore:
--------------------------------------------------------------------------------
1 | /libtool.m4
2 | /lt*.m4
3 |
--------------------------------------------------------------------------------
/m4/ax_check_compile_flag.m4:
--------------------------------------------------------------------------------
1 | # ===========================================================================
2 | # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
3 | # ===========================================================================
4 | #
5 | # SYNOPSIS
6 | #
7 | # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
8 | #
9 | # DESCRIPTION
10 | #
11 | # Check whether the given FLAG works with the current language's compiler
12 | # or gives an error. (Warnings, however, are ignored)
13 | #
14 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
15 | # success/failure.
16 | #
17 | # If EXTRA-FLAGS is defined, it is added to the current language's default
18 | # flags (e.g. CFLAGS) when the check is done. The check is thus made with
19 | # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
20 | # force the compiler to issue an error when a bad flag is given.
21 | #
22 | # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
23 | #
24 | # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
25 | # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
26 | #
27 | # LICENSE
28 | #
29 | # Copyright (c) 2008 Guido U. Draheim
30 | # Copyright (c) 2011 Maarten Bosmans
31 | #
32 | # Copying and distribution of this file, with or without modification, are
33 | # permitted in any medium without royalty provided the copyright notice
34 | # and this notice are preserved. This file is offered as-is, without any
35 | # warranty.
36 |
37 | #serial 6
38 |
39 | AC_DEFUN([AX_CHECK_COMPILE_FLAG],
40 | [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
41 | AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
42 | AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
43 | ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
44 | _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
45 | AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
46 | [AS_VAR_SET(CACHEVAR,[yes])],
47 | [AS_VAR_SET(CACHEVAR,[no])])
48 | _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
49 | AS_VAR_IF(CACHEVAR,yes,
50 | [m4_default([$2], :)],
51 | [m4_default([$3], :)])
52 | AS_VAR_POPDEF([CACHEVAR])dnl
53 | ])dnl AX_CHECK_COMPILE_FLAGS
54 |
--------------------------------------------------------------------------------
/m4/ax_check_link_flag.m4:
--------------------------------------------------------------------------------
1 | # ===========================================================================
2 | # https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
3 | # ===========================================================================
4 | #
5 | # SYNOPSIS
6 | #
7 | # AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
8 | #
9 | # DESCRIPTION
10 | #
11 | # Check whether the given FLAG works with the linker or gives an error.
12 | # (Warnings, however, are ignored)
13 | #
14 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
15 | # success/failure.
16 | #
17 | # If EXTRA-FLAGS is defined, it is added to the linker's default flags
18 | # when the check is done. The check is thus made with the flags: "LDFLAGS
19 | # EXTRA-FLAGS FLAG". This can for example be used to force the linker to
20 | # issue an error when a bad flag is given.
21 | #
22 | # INPUT gives an alternative input source to AC_LINK_IFELSE.
23 | #
24 | # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
25 | # macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
26 | #
27 | # LICENSE
28 | #
29 | # Copyright (c) 2008 Guido U. Draheim
30 | # Copyright (c) 2011 Maarten Bosmans
31 | #
32 | # Copying and distribution of this file, with or without modification, are
33 | # permitted in any medium without royalty provided the copyright notice
34 | # and this notice are preserved. This file is offered as-is, without any
35 | # warranty.
36 |
37 | #serial 6
38 |
39 | AC_DEFUN([AX_CHECK_LINK_FLAG],
40 | [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
41 | AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
42 | AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
43 | ax_check_save_flags=$LDFLAGS
44 | LDFLAGS="$LDFLAGS $4 $1"
45 | AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
46 | [AS_VAR_SET(CACHEVAR,[yes])],
47 | [AS_VAR_SET(CACHEVAR,[no])])
48 | LDFLAGS=$ax_check_save_flags])
49 | AS_VAR_IF(CACHEVAR,yes,
50 | [m4_default([$2], :)],
51 | [m4_default([$3], :)])
52 | AS_VAR_POPDEF([CACHEVAR])dnl
53 | ])dnl AX_CHECK_LINK_FLAGS
54 |
--------------------------------------------------------------------------------
/m4/ax_check_preproc_flag.m4:
--------------------------------------------------------------------------------
1 | # ===========================================================================
2 | # https://www.gnu.org/software/autoconf-archive/ax_check_preproc_flag.html
3 | # ===========================================================================
4 | #
5 | # SYNOPSIS
6 | #
7 | # AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
8 | #
9 | # DESCRIPTION
10 | #
11 | # Check whether the given FLAG works with the current language's
12 | # preprocessor or gives an error. (Warnings, however, are ignored)
13 | #
14 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
15 | # success/failure.
16 | #
17 | # If EXTRA-FLAGS is defined, it is added to the preprocessor's default
18 | # flags when the check is done. The check is thus made with the flags:
19 | # "CPPFLAGS EXTRA-FLAGS FLAG". This can for example be used to force the
20 | # preprocessor to issue an error when a bad flag is given.
21 | #
22 | # INPUT gives an alternative input source to AC_PREPROC_IFELSE.
23 | #
24 | # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
25 | # macro in sync with AX_CHECK_{COMPILE,LINK}_FLAG.
26 | #
27 | # LICENSE
28 | #
29 | # Copyright (c) 2008 Guido U. Draheim
30 | # Copyright (c) 2011 Maarten Bosmans
31 | #
32 | # Copying and distribution of this file, with or without modification, are
33 | # permitted in any medium without royalty provided the copyright notice
34 | # and this notice are preserved. This file is offered as-is, without any
35 | # warranty.
36 |
37 | #serial 6
38 |
39 | AC_DEFUN([AX_CHECK_PREPROC_FLAG],
40 | [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
41 | AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl
42 | AC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [
43 | ax_check_save_flags=$CPPFLAGS
44 | CPPFLAGS="$CPPFLAGS $4 $1"
45 | AC_PREPROC_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
46 | [AS_VAR_SET(CACHEVAR,[yes])],
47 | [AS_VAR_SET(CACHEVAR,[no])])
48 | CPPFLAGS=$ax_check_save_flags])
49 | AS_VAR_IF(CACHEVAR,yes,
50 | [m4_default([$2], :)],
51 | [m4_default([$3], :)])
52 | AS_VAR_POPDEF([CACHEVAR])dnl
53 | ])dnl AX_CHECK_PREPROC_FLAGS
54 |
--------------------------------------------------------------------------------
/src/configuration.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | namespace libbitcoin {
27 | namespace server {
28 |
29 | // Construct with defaults derived from given context.
30 | configuration::configuration(system::chain::selection context) NOEXCEPT
31 | : log(context),
32 | server(context),
33 | node(context),
34 | network(context),
35 | database(context),
36 | bitcoin(context)
37 | {
38 | }
39 |
40 | } // namespace server
41 | } // namespace libbitcoin
42 |
--------------------------------------------------------------------------------
/src/interface/server.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | // TODO: rename this class to minimize namespace conflicts.
27 |
28 | namespace libbitcoin {
29 | namespace server {
30 |
31 | using namespace bc::system;
32 |
33 | void server::version(server_node&, const message& request,
34 | send_handler handler)
35 | {
36 | static const std::string version{ LIBBITCOIN_SERVER_VERSION };
37 |
38 | auto result = build_chunk(
39 | {
40 | message::to_bytes(error::success),
41 | to_chunk(version)
42 | });
43 |
44 | handler(message(request, std::move(result)));
45 | }
46 |
47 | } // namespace server
48 | } // namespace libbitcoin
49 |
--------------------------------------------------------------------------------
/src/interface/subscribe.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | namespace libbitcoin {
27 | namespace server {
28 |
29 | using namespace bc::system;
30 | using namespace bc::system::wallet;
31 |
32 | void subscribe::key(server_node& node, const message& request,
33 | send_handler handler)
34 | {
35 | static constexpr size_t args_size = hash_size;
36 |
37 | const auto& data = request.data();
38 |
39 | if (data.size() != args_size)
40 | {
41 | handler(message(request, error::bad_stream));
42 | return;
43 | }
44 |
45 | // [ key:32 ]
46 | auto deserial = make_safe_deserializer(data.begin(), data.end());
47 | auto key = deserial.read_hash();
48 |
49 | auto ec = node.subscribe_key(request, std::move(key), false);
50 | handler(message(request, ec));
51 | }
52 |
53 | } // namespace server
54 | } // namespace libbitcoin
55 |
--------------------------------------------------------------------------------
/src/interface/unsubscribe.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | namespace libbitcoin {
27 | namespace server {
28 |
29 | using namespace bc::system;
30 |
31 | void unsubscribe::key(server_node& node, const message& request,
32 | send_handler handler)
33 | {
34 | static constexpr size_t args_size = hash_size;
35 |
36 | const auto& data = request.data();
37 |
38 | if (data.size() != args_size)
39 | {
40 | handler(message(request, error::bad_stream));
41 | return;
42 | }
43 |
44 | // [ key:32 ]
45 | auto deserial = make_safe_deserializer(data.begin(), data.end());
46 | auto key = deserial.read_hash();
47 |
48 | auto ec = node.subscribe_key(request, std::move(key), true);
49 | handler(message(request, ec));
50 | }
51 |
52 | void unsubscribe::stealth(server_node& node, const message& request,
53 | send_handler handler)
54 | {
55 | static constexpr size_t stealth_args_min = sizeof(uint8_t);
56 | static constexpr size_t stealth_args_max = stealth_args_min +
57 | sizeof(uint32_t);
58 |
59 | const auto& data = request.data();
60 | const auto size = data.size();
61 |
62 | if (size < stealth_args_min || size > stealth_args_max)
63 | {
64 | handler(message(request, error::bad_stream));
65 | return;
66 | }
67 |
68 | // [ prefix_bitsize:1 ]
69 | // [ prefix_blocks:1..4 ]
70 | auto deserial = make_safe_deserializer(data.begin(), data.end());
71 | const auto bits = deserial.read_byte();
72 | const auto bytes = deserial.read_bytes(binary::blocks_size(bits));
73 |
74 | auto ec = node.subscribe_stealth(request, binary(bits, bytes), true);
75 | handler(message(request, ec));
76 | }
77 |
78 | } // namespace server
79 | } // namespace libbitcoin
80 |
--------------------------------------------------------------------------------
/src/messages/route.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 |
21 | #include
22 |
23 | namespace libbitcoin {
24 | namespace server {
25 |
26 | using namespace bc::protocol;
27 | using namespace bc::system;
28 |
29 | static const zmq::message::address default_address
30 | {
31 | { 0x00, 0x00, 0x00, 0x00, 0x00 }
32 | };
33 |
34 | route::route()
35 | : delimited_(false),
36 | address_(default_address)
37 | {
38 | }
39 |
40 | bool route::delimited() const
41 | {
42 | return delimited_;
43 | }
44 |
45 | zmq::message::address route::address() const
46 | {
47 | return address_;
48 | }
49 |
50 | void route::set_delimited(bool value)
51 | {
52 | delimited_ = value;
53 | }
54 |
55 | void route::set_address(const zmq::message::address& value)
56 | {
57 | address_ = value;
58 | }
59 |
60 | std::string route::display() const
61 | {
62 | return "[" + encode_base16(address_) + "]" + (delimited_ ? "[]" : "");
63 | }
64 |
65 | } // namespace server
66 | } // namespace libbitcoin
67 |
--------------------------------------------------------------------------------
/src/messages/subscription.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 |
25 | namespace libbitcoin {
26 | namespace server {
27 |
28 | subscription::subscription(const subscription& other)
29 | : route(other),
30 | id_(other.id_),
31 | updated_(other.updated_.load()),
32 | sequence_(other.sequence_.load())
33 | {
34 | }
35 |
36 | subscription::subscription(const route& return_route, uint32_t id, time_t now)
37 | : route(return_route),
38 | id_(id),
39 | updated_(now),
40 | sequence_(0)
41 | {
42 | }
43 |
44 | uint32_t subscription::id() const
45 | {
46 | return id_;
47 | }
48 |
49 | time_t subscription::updated() const
50 | {
51 | return updated_;
52 | }
53 |
54 | void subscription::set_updated(time_t now) const
55 | {
56 | updated_ = now;
57 | }
58 |
59 | void subscription::increment() const
60 | {
61 | ++sequence_;
62 | }
63 |
64 | uint16_t subscription::sequence() const
65 | {
66 | return sequence_;
67 | }
68 |
69 | // Thsi uses copy/swap idiom, see swap below.
70 | subscription& subscription::operator=(subscription other)
71 | {
72 | swap(*this, other);
73 | return *this;
74 | }
75 |
76 | bool subscription::operator<(const subscription& other) const
77 | {
78 | return updated_ < other.updated_;
79 | }
80 |
81 | bool subscription::operator==(const subscription& other) const
82 | {
83 | return delimited_ == other.delimited_ &&
84 | address_ == other.address_;
85 | }
86 |
87 | bool subscription::operator==(const route& other) const
88 | {
89 | return delimited_ == other.delimited() &&
90 | address_ == other.address();
91 | }
92 |
93 | // friend function, see: stackoverflow.com/a/5695855/1172329
94 | void swap(subscription& left, subscription& right)
95 | {
96 | using std::swap;
97 |
98 | // Must be unqualified (no std namespace).
99 | swap(static_cast(left), static_cast(right));
100 | swap(left.id_, right.id_);
101 |
102 | // Swapping the atomics in assignment operator does not require atomicity.
103 | left.updated_ = right.updated_.exchange(left.updated_);
104 | left.sequence_ = right.sequence_.exchange(left.sequence_);
105 | }
106 |
107 | } // namespace server
108 | } // namespace libbitcoin
109 |
--------------------------------------------------------------------------------
/src/settings.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 |
25 | namespace libbitcoin {
26 | namespace server {
27 |
28 | using namespace system;
29 | using namespace protocol;
30 | using namespace std::chrono;
31 |
32 | settings::settings()
33 | : // [server]
34 | priority(false),
35 | secure_only(false),
36 | query_workers(1),
37 | subscription_limit(1000),
38 | subscription_expiration_minutes(10),
39 | heartbeat_service_seconds(5),
40 | block_service_enabled(true),
41 | transaction_service_enabled(true),
42 |
43 | // [zeromq] secure
44 | zeromq_secure_query_endpoint("tcp://*:9081"),
45 | zeromq_secure_heartbeat_endpoint("tcp://*:9082"),
46 | zeromq_secure_block_endpoint("tcp://*:9083"),
47 | zeromq_secure_transaction_endpoint("tcp://*:9084"),
48 |
49 | // [zeromq] clear
50 | zeromq_public_query_endpoint("tcp://*:9091"),
51 | zeromq_public_heartbeat_endpoint("tcp://*:9092"),
52 | zeromq_public_block_endpoint("tcp://*:9093"),
53 | zeromq_public_transaction_endpoint("tcp://*:9094")
54 | {
55 | }
56 |
57 | settings::settings(chain::selection context)
58 | : settings()
59 | {
60 | }
61 |
62 | steady_clock::duration settings::heartbeat_service() const
63 | {
64 | return seconds(heartbeat_service_seconds);
65 | }
66 |
67 | steady_clock::duration settings::subscription_expiration() const
68 | {
69 | return minutes(subscription_expiration_minutes);
70 | }
71 |
72 | const endpoint& settings::zeromq_query_endpoint(bool secure) const
73 | {
74 | return secure ? zeromq_secure_query_endpoint :
75 | zeromq_public_query_endpoint;
76 | }
77 |
78 | const endpoint& settings::zeromq_heartbeat_endpoint(bool secure) const
79 | {
80 | return secure ? zeromq_secure_heartbeat_endpoint :
81 | zeromq_public_heartbeat_endpoint;
82 | }
83 |
84 | const endpoint& settings::zeromq_block_endpoint(bool secure) const
85 | {
86 | return secure ? zeromq_secure_block_endpoint :
87 | zeromq_public_block_endpoint;
88 | }
89 |
90 | const endpoint& settings::zeromq_transaction_endpoint(bool secure) const
91 | {
92 | return secure ? zeromq_secure_transaction_endpoint :
93 | zeromq_public_transaction_endpoint;
94 | }
95 |
96 | } // namespace server
97 | } // namespace libbitcoin
98 |
--------------------------------------------------------------------------------
/src/workers/authenticator.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 |
25 | namespace libbitcoin {
26 | namespace server {
27 |
28 | using namespace bc::protocol;
29 | using namespace bc::system;
30 |
31 | authenticator::authenticator(server_node& node)
32 | : zmq::authenticator(priority(node.server_settings().priority))
33 | {
34 | const auto& settings = node.server_settings();
35 |
36 | set_private_key(settings.zeromq_server_private_key);
37 |
38 | // Secure clients are also affected by address restrictions.
39 | for (const auto& public_key: settings.zeromq_client_public_keys)
40 | {
41 | LOG_DEBUG(LOG_SERVER)
42 | << "Allow client public key [" << public_key << "]";
43 |
44 | allow(public_key);
45 | }
46 |
47 | // Allow wins in case of conflict with deny (first writer).
48 | for (const auto& address: settings.clients)
49 | {
50 | LOG_DEBUG(LOG_SERVER)
51 | << "Allow client address [" << address.to_hostname() << "]";
52 |
53 | // The port is ignored.
54 | allow(address);
55 | }
56 |
57 | // Allow wins in case of conflict with deny (first writer).
58 | for (const auto& address: settings.blacklists)
59 | {
60 | LOG_DEBUG(LOG_SERVER)
61 | << "Block client address [" << address.to_hostname() << "]";
62 |
63 | // The port is ignored.
64 | deny(address);
65 | }
66 | }
67 |
68 | bool authenticator::apply(zmq::socket& socket, const std::string& domain,
69 | bool secure)
70 | {
71 | // This will fail if there are client keys but no server key.
72 | if (!zmq::authenticator::apply(socket, domain, secure))
73 | {
74 | LOG_ERROR(LOG_SERVER)
75 | << "Failed to apply authentication to socket [" << domain << "]";
76 | return false;
77 | }
78 |
79 | if (secure)
80 | {
81 | LOG_DEBUG(LOG_SERVER)
82 | << "Applied curve authentication to socket [" << domain << "]";
83 | }
84 | else
85 | {
86 | LOG_DEBUG(LOG_SERVER)
87 | << "Applied address authentication to socket [" << domain << "]";
88 | }
89 |
90 | return true;
91 | }
92 |
93 | } // namespace server
94 | } // namespace libbitcoin
95 |
--------------------------------------------------------------------------------
/test/latest-addrs.py:
--------------------------------------------------------------------------------
1 | from websocket import create_connection
2 | from popular_addrs import popular_addrs
3 | import json
4 |
5 | ws = create_connection("ws://ws.blockchain.info/inv")
6 | ws.send('{"op":"unconfirmed_sub"}')
7 |
8 | addrs = []
9 | while len(addrs) < 20:
10 | result = ws.recv()
11 | tx = json.loads(result)["x"]
12 | for input in tx["inputs"]:
13 | addr = input["prev_out"]["addr"]
14 | if addr in popular_addrs:
15 | continue
16 | addrs.append(addr)
17 | for output in tx["out"]:
18 | addr = output["addr"]
19 | if addr in popular_addrs:
20 | continue
21 | addrs.append(addr)
22 | ws.close()
23 | for addr in addrs:
24 | print addr
25 |
26 |
--------------------------------------------------------------------------------
/test/main.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #define BOOST_TEST_MODULE libbitcoin_server_test
20 | #include
21 |
--------------------------------------------------------------------------------
/test/server.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2011-2023 libbitcoin developers (see AUTHORS)
3 | *
4 | * This file is part of libbitcoin.
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | #include
20 | #include
21 |
22 | using namespace bc;
23 |
24 | BOOST_AUTO_TEST_SUITE(server_tests)
25 |
26 | // Just a basic test to get some coverage output.
27 | BOOST_AUTO_TEST_CASE(server_test)
28 | {
29 | BOOST_REQUIRE(true);
30 | }
31 |
32 | BOOST_AUTO_TEST_SUITE_END()
33 |
--------------------------------------------------------------------------------
/test/stress.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | while [ 1 ]; do
3 | echo "Polling a bunch of addresses..."
4 | ADDRS=$(python latest-addrs.py)
5 | for ADDR in $ADDRS; do
6 | echo "Query start: $ADDR $(date +%s)"
7 | time sx history $ADDR > /dev/null
8 | echo $?
9 | if [ "$?" -ne "0" ]; then
10 | echo "Bad return code! $?"
11 | exit 1
12 | fi
13 | done
14 | done
15 |
16 |
--------------------------------------------------------------------------------