Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lightning Network support #18179

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
46f4c3e
Adds a rust library to bitcoin to demonstrate linking and building ru…
JeremyRubin Mar 29, 2019
8c2ee65
build: show rust enabled in configure output
fanquake Jun 15, 2019
8fd3b4a
build: gitignore src/rusty_test
fanquake Jun 15, 2019
8e3f023
Add basic ffi bindings for Rust header download
theuni Sep 30, 2019
61337ea
Add headers-over-DNS fetcher in Rust
TheBlueMatt Oct 10, 2019
b76d4f9
Limit total memory allocated by all Rust code to 128MB
TheBlueMatt Oct 6, 2019
4b6e0b8
Enable rustc building + testing on xenial Tsan Travis job
TheBlueMatt Oct 10, 2019
57ca92a
Move CNode's FindNextBlocksToDownload state into its own strut
TheBlueMatt Aug 21, 2019
cd59d27
Make FindNextBlocksToDownload a member func on BlockProviderState
TheBlueMatt Aug 23, 2019
05519da
Make FindNextBlocksToDownload not use mapBlockIndex for in-progress
TheBlueMatt Aug 23, 2019
290f8f4
Move BlockProvider to validation.{h,cpp} from net_processing
TheBlueMatt Aug 23, 2019
e105ea8
Add ffis to access BlockProviderState and hand blocks to C++
TheBlueMatt Oct 12, 2019
4e691f9
Add a rust-based backup over-REST block downloader
TheBlueMatt Oct 18, 2019
06f1de0
Walk pindexBestHeader back to ChainActive().Tip() if it is invalid
TheBlueMatt Sep 26, 2019
99eaf1f
(XXX: Use subtree merge instead): bump to latest upstream libsecp
TheBlueMatt Nov 1, 2019
ca3dddd
(XXX: subtree me) add libc as a dep
TheBlueMatt Oct 7, 2019
6bbb67a
(XXX: subtree me) Add rust-bitcoin and deps
TheBlueMatt Oct 17, 2019
87c014d
Build the new rusty deps into the rusty lib
TheBlueMatt Oct 18, 2019
640deb2
Add additional FFIs from rust to support a full-fledged P2P client
TheBlueMatt Sep 24, 2019
3f05983
Add a FastRandomContext wrapper in the Rust FFI bridge
TheBlueMatt Oct 28, 2019
af2ea1e
Add FFIs to Rust Bridge to check outbound connection nonces
TheBlueMatt Oct 28, 2019
d0be125
Add P2P Client
TheBlueMatt Sep 30, 2019
33287e2
Add headers tree in test bridge and test locator response generation
TheBlueMatt Nov 3, 2019
6693089
Add CoreLightning
icota Nov 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ src/bitcoind
src/bitcoin-cli
src/bitcoin-tx
src/bitcoin-wallet
src/rusty_test
src/test/test_bitcoin
src/test/test_bitcoin_fuzzy
src/qt/test/test_bitcoin-qt
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
FILE_ENV="./ci/test/00_setup_env_amd64_trusty.sh"

- stage: test
name: 'x86_64 Linux [GOAL: install] [xenial] [no depends, only system libs, sanitizers: thread (TSan), no wallet]'
name: 'x86_64 Linux [GOAL: install] [xenial] [no depends, only system libs, rust, sanitizers: thread (TSan), no wallet]'
env: >-
FILE_ENV="./ci/test/00_setup_env_amd64_tsan.sh"
TEST_RUNNER_EXTRA="--exclude feature_block" # Not enough memory on travis machines
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_amd64_tsan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8

export HOST=x86_64-unknown-linux-gnu
export DOCKER_NAME_TAG=ubuntu:16.04
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev rustc"
export NO_DEPENDS=1
export GOAL="install"
export BITCOIN_CONFIG="--enable-zmq --disable-wallet --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=thread --disable-hardening --disable-asm CC=clang CXX=clang++"
39 changes: 38 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ AC_ARG_ENABLE([asm],
[use_asm=$enableval],
[use_asm=yes])

AC_ARG_ENABLE([rust],
[AS_HELP_STRING([--enable-rust],
[Enable rust code (default is yes)])],
[use_rust=$enableval],
[use_rust=yes])

if test "x$use_asm" = xyes; then
AC_DEFINE(USE_ASM, 1, [Define this symbol to build in assembly routines])
fi
Expand Down Expand Up @@ -476,6 +482,33 @@ AC_ARG_WITH([daemon],
[build_bitcoind=$withval],
[build_bitcoind=yes])

if test "x$use_rust" = xyes; then
AC_PATH_PROG(RUSTC,rustc,none)
if test x$RUSTC = xnone || test x$RUSTC = x; then
use_rust=no
AC_MSG_WARN("rustc required to enable rust support.")
else
AC_DEFINE(ENABLE_RUSTY, 1, [Define this symbol to build in rust modules])

dnl Find the additional lib (if any) responsible for handling
dnl dlopen/dlsym/etc.
TEMP_LIBS="$LIBS"
LIBS=
AC_SEARCH_LIBS([dlsym],[dl])
DL_LIBS="$LIBS"
LIBS="$TEMP_LIBS"

case $host in
${host_cpu}-w64-mingw*) RUST_TARGET=${host_cpu}-pc-windows-gnu ;;
${host_cpu}-pc-linux*) RUST_TARGET="${host_cpu}-unknown-${host_os}" ;;
${host_cpu}-apple-darwin*) RUST_TARGET=${host_cpu}-apple-darwin ;;
*) RUST_TARGET="${host}" ;;
esac

dnl TODO: create a rust test project and check host_alias as well as host.
fi
fi

use_pkgconfig=yes
case $host in
*mingw*)
Expand Down Expand Up @@ -1530,6 +1563,7 @@ AM_CONDITIONAL([ENABLE_SSE41],[test x$enable_sse41 = xyes])
AM_CONDITIONAL([ENABLE_AVX2],[test x$enable_avx2 = xyes])
AM_CONDITIONAL([ENABLE_SHANI],[test x$enable_shani = xyes])
AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])
AM_CONDITIONAL([ENABLE_RUSTY], [test x$use_rust = xyes])

AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
Expand Down Expand Up @@ -1589,6 +1623,8 @@ AC_SUBST(EVENT_LIBS)
AC_SUBST(EVENT_PTHREADS_LIBS)
AC_SUBST(ZMQ_LIBS)
AC_SUBST(QR_LIBS)
AC_SUBST(DL_LIBS)
AC_SUBST(RUST_TARGET)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
Expand Down Expand Up @@ -1624,7 +1660,7 @@ if test x$need_bundled_univalue = xyes; then
AC_CONFIG_SUBDIRS([src/univalue])
fi

ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --with-bignum=no --enable-module-recovery --disable-jni"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --with-bignum=no --enable-module-ecdh --enable-experimental --enable-module-recovery --disable-jni"
AC_CONFIG_SUBDIRS([src/secp256k1])

AC_OUTPUT
Expand Down Expand Up @@ -1657,6 +1693,7 @@ echo " sanitizers = $use_sanitizers"
echo " debug enabled = $enable_debug"
echo " gprof enabled = $enable_gprof"
echo " werror = $enable_werror"
echo " rust enabled = $use_rust"
echo
echo " target os = $TARGET_OS"
echo " build os = $BUILD_OS"
Expand Down
103 changes: 99 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_C
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS)
AM_LIBTOOLFLAGS = --preserve-dup-deps
EXTRA_LIBRARIES =
CLEANFILES =
LIBBITCOIN_RUST_LIBS =

if EMBEDDED_UNIVALUE
LIBUNIVALUE = univalue/libunivalue.la
Expand All @@ -33,6 +35,10 @@ LIBBITCOIN_CRYPTO_BASE=crypto/libbitcoin_crypto_base.a
LIBBITCOINQT=qt/libbitcoinqt.a
LIBSECP256K1=secp256k1/libsecp256k1.la

if ENABLE_RUSTY
LIBBITCOIN_RUSTY = rusty/librusty.a
LIBBITCOIN_RUSTY_BRIDGE = libbitcoin_rustybridge.a
endif
if ENABLE_ZMQ
LIBBITCOIN_ZMQ=libbitcoin_zmq.a
endif
Expand Down Expand Up @@ -72,6 +78,7 @@ EXTRA_LIBRARIES += \
$(LIBBITCOIN_CLI) \
$(LIBBITCOIN_WALLET) \
$(LIBBITCOIN_WALLET_TOOL) \
$(LIBBITCOIN_RUSTY_BRIDGE) \
$(LIBBITCOIN_ZMQ)

lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS)
Expand Down Expand Up @@ -257,6 +264,10 @@ obj/build.h: FORCE
"$(abs_top_srcdir)"
libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h

# libbitcoin_rustybridge should not need headers other than Core's internal ones.
libbitcoin_rustybridge_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir) $(LEVELDB_CPPFLAGS)
libbitcoin_rustybridge_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_rustybridge_a_SOURCES = rusty/src/cpp_bridge.cpp
# server: shared between bitcoind and bitcoin-qt
# Contains code accessing mempool and chain state that is meant to be separated
# from wallet and gui code (see node/README.md). Shared code should go in
Expand Down Expand Up @@ -301,6 +312,7 @@ libbitcoin_server_a_SOURCES = \
rpc/net.cpp \
rpc/rawtransaction.cpp \
rpc/server.cpp \
rpc/lightning.cpp \
script/sigcache.cpp \
shutdown.cpp \
timedata.cpp \
Expand Down Expand Up @@ -359,6 +371,71 @@ libbitcoin_wallet_tool_a_SOURCES = \
wallet/wallettool.cpp \
$(BITCOIN_CORE_H)

# rustc only reqires the main .rs file as input, but rustc must also be invoked
# if any of the other files change. List the main file first, then targets can
# depend on $(LIBBITCOIN_RUSTY_SRCS), but only build the first source file ($<).
LIBBITCOIN_RUSTY_SRCS= \
rusty/src/lib.rs \
rusty/src/bridge.rs \
rusty/src/dns_headers.rs \
rusty/src/rest_downloader.rs \
rusty/src/p2p_addrs.rs rusty/src/p2p_client.rs \
rusty/src/p2p_socket_handler.rs \
rusty/src/core_lightning/mod.rs

LIBBITCOIN_RUSTY_TEST_SRCS= \
rusty/src/test_bridge.rs

rusty/liblibc.rlib: rusty/libc/src/lib.rs $(wildcard rusty/libc/src/*.rs)
$(RUSTC) --crate-name libc $< --crate-type=rlib -g -O -C overflow-checks=on -C panic=unwind --out-dir $(@D) && \
touch $@

rusty/libbech32.rlib: rusty/rust-bech32/src/lib.rs $(wildcard rusty/rust-bech32/src/*.rs)
$(RUSTC) --crate-name bech32 $< --crate-type=rlib -g -O -C overflow-checks=on -C panic=unwind --out-dir $(@D) && \
touch $@

rusty/libbitcoin_hashes.rlib: rusty/bitcoin_hashes/src/lib.rs $(wildcard rusty/bitcoin_hashes/src/*.rs)
$(RUSTC) --crate-name bitcoin_hashes $< --crate-type=rlib -g -O -C overflow-checks=on -C panic=unwind --cfg 'feature="default"' --cfg 'feature="std"' --out-dir $(@D) && \
touch $@

rusty/libsecp256k1.rlib: rusty/rust-secp256k1/src/lib.rs $(wildcard rusty/rust-secp256k1/src/*.rs) $(LIBSECP256K1)
$(RUSTC) --crate-name secp256k1 $< --crate-type=rlib -g -O -C overflow-checks=on -C panic=unwind --cfg 'feature="std"' --cfg 'feature="recovery"' --cfg 'feature="dont_replace_c_symbols"' --out-dir $(@D) && \
touch $@

rusty/libbitcoin.rlib: rusty/libbech32.rlib rusty/libbitcoin_hashes.rlib rusty/libsecp256k1.rlib
rusty/libbitcoin.rlib: rusty/rust-bitcoin/src/lib.rs $(wildcard rusty/rust-bitcoin/src/*.rs) $(wildcard rusty/rust-bitcoin/src/*/*.rs) $(wildcard rusty/rust-bitcoin/src/*/*/*.rs)
$(RUSTC) --crate-name bitcoin $< --crate-type=rlib -g -O -C overflow-checks=on -C panic=unwind --out-dir $(@D) --extern bech32=$(@D)/libbech32.rlib --extern bitcoin_hashes=$(@D)/libbitcoin_hashes.rlib --extern secp256k1=$(@D)/libsecp256k1.rlib && \
touch $@

rusty/liblightning.rlib: rusty/libbitcoin.rlib
rusty/liblightning.rlib: rusty/rust-lightning/lightning/src/lib.rs $(wildcard rusty/rust-lightning/lightning/src/*.rs) $(wildcard rusty/rust-lightning/lightning/src/*/*.rs) $(wildcard rusty/rust-lightning/src/*/*/*.rs)
$(RUSTC) --crate-name lightning $< --crate-type=rlib -g -O -C overflow-checks=on -C panic=unwind --out-dir $(@D) -L rusty && \
touch $@

rusty/libbitcoin-bech32.rlib: rusty/libbech32.rlib
rusty/libbitcoin-bech32.rlib: rusty/rust-bech32-bitcoin/src/lib.rs
$(RUSTC) --crate-name bitcoin_bech32 $< --crate-type=rlib -g -O -C overflow-checks=on -C panic=unwind --out-dir $(@D) -L rusty && \
touch $@

rusty/liblightninginvoice.rlib: rusty/libnum-traits.rlib rusty/libsecp256k1.rlib
rusty/liblightninginvoice.rlib: rusty/rust-lightning-invoice/src/lib.rs
$(RUSTC) --crate-name lightning_invoice $< --crate-type=rlib -g -O -C overflow-checks=on -C panic=unwind --out-dir $(@D) -L rusty && \
touch $@

rusty/libnum-traits.rlib: rusty/num-traits/src/lib.rs
$(RUSTC) --crate-name num_traits $< --crate-type=rlib -g -O -C overflow-checks=on -C panic=unwind --out-dir $(@D) -L rusty && \
touch $@

# We force overflow checks on so that any integer overflows result in a panic
# instead of, eg, attempting to alloc 4GB of memory (though we will catch such
# an alloc and refuse it, generating a panic instead).
# Also force panics to unwind (instead of calling abort()) as we want to catch
# panics in the Rust threads and simply close the thread, instead of bringing
# down the rest of Bitcoin Core.
$(LIBBITCOIN_RUSTY): $(LIBBITCOIN_RUSTY_SRCS) rusty/libbitcoin.rlib rusty/liblibc.rlib rusty/liblightning.rlib rusty/libbitcoin-bech32.rlib rusty/liblightninginvoice.rlib
$(RUSTC) --crate-name rusty $< --target=$(RUST_TARGET) --crate-type=staticlib --emit=link -g -C lto=on -C overflow-checks=on -C panic=unwind --out-dir $(@D) -L $(@D) --extern libc=$(@D)/liblibc.rlib
touch $@

# crypto primitives library
crypto_libbitcoin_crypto_base_a_CPPFLAGS = $(AM_CPPFLAGS)
crypto_libbitcoin_crypto_base_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
Expand Down Expand Up @@ -563,7 +640,7 @@ bitcoind_LDADD = \
$(LIBMEMENV) \
$(LIBSECP256K1)

bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS)
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS) $(LIBBITCOIN_RUST_LIBS) $(DL_LIBS)

# bitcoin-cli binary #
bitcoin_cli_SOURCES = bitcoin-cli.cpp
Expand Down Expand Up @@ -629,7 +706,7 @@ bitcoin_wallet_LDADD = \
$(LIBSECP256K1) \
$(LIBUNIVALUE)

bitcoin_wallet_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(MINIUPNPC_LIBS) $(ZMQ_LIBS)
bitcoin_wallet_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(MINIUPNPC_LIBS) $(ZMQ_LIBS) $(DL_LIBS)
#

# bitcoinconsensus library #
Expand All @@ -655,7 +732,24 @@ CTAES_DIST += crypto/ctaes/ctaes.h
CTAES_DIST += crypto/ctaes/README.md
CTAES_DIST += crypto/ctaes/test.c

CLEANFILES = $(EXTRA_LIBRARIES)
BITCOIN_CORE_H += rusty/src/rust_bridge.h

if ENABLE_RUSTY
LIBBITCOIN_RUST_LIBS += $(LIBBITCOIN_RUSTY)
LIBBITCOIN_RUST_LIBS += $(LIBBITCOIN_RUSTY_BRIDGE)

RUSTY_TEST_BIN=rusty/test_rusty
$(RUSTY_TEST_BIN): $(LIBBITCOIN_RUSTY_SRCS) $(LIBBITCOIN_RUSTY_TEST_SRCS)
$(RUSTC) --crate-name test_rusty $< --target=$(RUST_TARGET) --emit=link -C lto=on --test -C debuginfo=2 -C overflow-checks=on --out-dir $(@D) -L dependency=$(@D) --extern libc=$(@D)/liblibc.rlib --extern bitcoin_hashes=$(@D)/libbitcoin_hashes.rlib --extern bitcoin=$(@D)/libbitcoin.rlib

## FIXME: always build RUSTY_TEST_BIN the same as we do test_bitcoin
RUSTY_CHECK=rusty-check
$(RUSTY_CHECK): $(RUSTY_TEST_BIN)
$(RUSTY_TEST_BIN)

CLEANFILES += $(LIBBITCOIN_RUSTY)
endif
CLEANFILES += $(EXTRA_LIBRARIES)

CLEANFILES += *.gcda *.gcno
CLEANFILES += compat/*.gcda compat/*.gcno
Expand All @@ -671,7 +765,7 @@ CLEANFILES += wallet/test/*.gcda wallet/test/*.gcno
CLEANFILES += zmq/*.gcda zmq/*.gcno
CLEANFILES += obj/build.h

EXTRA_DIST = $(CTAES_DIST)
EXTRA_DIST = $(CTAES_DIST) $(LIBBITCOIN_RUSTY_SRCS) $(LIBBITCOIN_RUSTY_TEST_SRCS)


config/bitcoin-config.h: config/stamp-h1
Expand All @@ -684,6 +778,7 @@ $(top_srcdir)/$(subdir)/config/bitcoin-config.h.in: $(am__configure_deps)
clean-local:
-$(MAKE) -C secp256k1 clean
-$(MAKE) -C univalue clean
-rm -rf rusty/test_rusty rusty/test_rusty.dSYM
-rm -f leveldb/*/*.gcda leveldb/*/*.gcno leveldb/helpers/memenv/*.gcda leveldb/helpers/memenv/*.gcno
-rm -f config.h
-rm -rf test/__pycache__
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.bench.include
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bench_bench_bitcoin_SOURCES += bench/coin_selection.cpp
bench_bench_bitcoin_SOURCES += bench/wallet_balance.cpp
endif

bench_bench_bitcoin_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(MINIUPNPC_LIBS)
bench_bench_bitcoin_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(MINIUPNPC_LIBS) $(LIBBITCOIN_RUST_LIBS) $(DL_LIBS)
bench_bench_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)

CLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno $(GENERATED_BENCH_FILES)
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL)
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
qt_bitcoin_qt_LDADD += $(CRYPTO_LIBS)
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_RUST_LIBS) $(DL_LIBS)
qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
qt_bitcoin_qt_LIBTOOLFLAGS = $(AM_LIBTOOLFLAGS) --tag CXX

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.qttest.include
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ endif
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \
$(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
$(QR_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(LIBBITCOIN_RUST_LIBS) $(DL_LIBS)
qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
qt_test_test_bitcoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)

Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_C
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

test_test_bitcoin_LDADD += $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(RAPIDCHECK_LIBS)
test_test_bitcoin_LDADD += $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(RAPIDCHECK_LIBS) $(LIBBITCOIN_RUST_LIBS) $(DL_LIBS)
test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static

if ENABLE_ZMQ
Expand Down Expand Up @@ -386,7 +386,7 @@ bitcoin_test_check: $(TEST_BINARY) FORCE
bitcoin_test_clean : FORCE
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)

check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
check-local: $(RUSTY_CHECK) $(BITCOIN_TESTS:.cpp=.cpp.test)
if BUILD_BITCOIN_TX
@echo "Running test/util/bitcoin-util-test.py..."
$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
Expand Down
12 changes: 12 additions & 0 deletions src/clientversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
*/
const std::string CLIENT_NAME("Satoshi");

/**
* Name of client reported in the 'version' message when connected to the
* in-Rust P2P client.
*/
const std::string RUSTY_CLIENT_NAME("RustySatoshi");

/**
* Name of client reported when connected to the
* in-Rust Lightning client.
*/
const std::string RUSTY_LIGHTNING_CLIENT_NAME("CoreLightning");

/**
* Client version number
*/
Expand Down
1 change: 1 addition & 0 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static const int CLIENT_VERSION =
+ 1 * CLIENT_VERSION_BUILD;

extern const std::string CLIENT_NAME;
extern const std::string RUSTY_CLIENT_NAME;
extern const std::string CLIENT_BUILD;


Expand Down
Loading