Compare commits
12 commits
master
...
get_activa
Author | SHA1 | Date | |
---|---|---|---|
|
84333407bb | ||
|
8ad7903aba | ||
|
cc789fc517 | ||
|
e65e77f9bf | ||
|
70e7743acc | ||
|
55f5f2049e | ||
|
7f6daef99b | ||
|
3006f4d99d | ||
|
2a1a4ef9c1 | ||
|
5ca2e96f5b | ||
|
db55cc6960 | ||
|
4c9c79e9f5 |
216 changed files with 24079 additions and 4740 deletions
19
.gitignore
vendored
19
.gitignore
vendored
|
@ -1,13 +1,14 @@
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
|
|
||||||
*.exe
|
*.exe
|
||||||
src/bitcoin
|
src/lbrycrd
|
||||||
src/bitcoind
|
src/lbrycrdd
|
||||||
src/bitcoin-cli
|
src/lbrycrd-cli
|
||||||
src/bitcoin-tx
|
src/lbrycrd-tx
|
||||||
src/test/test_bitcoin
|
src/test/test_lbrycrd
|
||||||
src/test/test_bitcoin_fuzzy
|
src/test/test_lbrycrd_fuzzy
|
||||||
src/qt/test/test_bitcoin-qt
|
src/qt/lbrycrd-qt
|
||||||
|
src/qt/test/test_lbrycrd-qt
|
||||||
|
|
||||||
# autoreconf
|
# autoreconf
|
||||||
Makefile.in
|
Makefile.in
|
||||||
|
@ -61,7 +62,6 @@ src/qt/bitcoin-qt.includes
|
||||||
*.pyc
|
*.pyc
|
||||||
*.o
|
*.o
|
||||||
*.o-*
|
*.o-*
|
||||||
*.patch
|
|
||||||
*.a
|
*.a
|
||||||
*.pb.cc
|
*.pb.cc
|
||||||
*.pb.h
|
*.pb.h
|
||||||
|
@ -116,3 +116,6 @@ test/cache/*
|
||||||
|
|
||||||
libbitcoinconsensus.pc
|
libbitcoinconsensus.pc
|
||||||
contrib/devtools/split-debug.sh
|
contrib/devtools/split-debug.sh
|
||||||
|
|
||||||
|
.idea
|
||||||
|
cmake-build-*/
|
||||||
|
|
222
.travis.yml
222
.travis.yml
|
@ -1,164 +1,70 @@
|
||||||
dist: trusty
|
matrix:
|
||||||
os: linux
|
include:
|
||||||
language: minimal
|
- os: linux
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
language: c
|
||||||
|
env: TARGET=linux
|
||||||
|
- os: linux
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
language: c
|
||||||
|
env: TARGET=windows
|
||||||
|
- os: osx
|
||||||
|
language: c
|
||||||
|
osx_image: xcode8.3
|
||||||
|
env: TARGET=osx
|
||||||
cache:
|
cache:
|
||||||
|
apt: true
|
||||||
ccache: true
|
ccache: true
|
||||||
directories:
|
directories:
|
||||||
|
- build
|
||||||
- depends/built
|
- depends/built
|
||||||
- depends/sdk-sources
|
git:
|
||||||
- $HOME/.ccache
|
depth: false
|
||||||
stages:
|
|
||||||
- lint
|
|
||||||
- test
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- MAKEJOBS=-j3
|
|
||||||
- RUN_TESTS=false
|
|
||||||
- RUN_BENCH=false # Set to true for any one job that has debug enabled, to quickly check bench is not crashing or hitting assertions
|
|
||||||
- DOCKER_NAME_TAG=ubuntu:18.04
|
|
||||||
- LC_ALL=C.UTF-8
|
|
||||||
- BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID
|
|
||||||
- CCACHE_SIZE=100M
|
|
||||||
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
|
||||||
- CCACHE_COMPRESS=1
|
|
||||||
- CCACHE_DIR=$HOME/.ccache
|
|
||||||
- BASE_OUTDIR=$TRAVIS_BUILD_DIR/out
|
|
||||||
- SDK_URL=https://bitcoincore.org/depends-sources/sdks
|
|
||||||
- WINEDEBUG=fixme-all
|
|
||||||
- DOCKER_PACKAGES="build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git ca-certificates ccache"
|
|
||||||
before_install:
|
before_install:
|
||||||
- export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
|
- date +%s > "${TRAVIS_BUILD_DIR}/start_time"
|
||||||
- BEGIN_FOLD () { echo ""; CURRENT_FOLD_NAME=$1; echo "travis_fold:start:${CURRENT_FOLD_NAME}"; }
|
- ls -lh build
|
||||||
- END_FOLD () { RET=$?; echo "travis_fold:end:${CURRENT_FOLD_NAME}"; return $RET; }
|
- du -h -d 2 build
|
||||||
install:
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install ccache; fi
|
||||||
- travis_retry docker pull $DOCKER_NAME_TAG
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
|
||||||
- env | grep -E '^(CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL)' | tee /tmp/env
|
install: true
|
||||||
- if [[ $HOST = *-mingw32 ]]; then DOCKER_ADMIN="--cap-add SYS_ADMIN"; fi
|
|
||||||
- DOCKER_ID=$(docker run $DOCKER_ADMIN -idt --mount type=bind,src=$TRAVIS_BUILD_DIR,dst=$TRAVIS_BUILD_DIR --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR -w $TRAVIS_BUILD_DIR --env-file /tmp/env $DOCKER_NAME_TAG)
|
|
||||||
- DOCKER_EXEC () { docker exec $DOCKER_ID bash -c "cd $PWD && $*"; }
|
|
||||||
- if [ -n "$DPKG_ADD_ARCH" ]; then DOCKER_EXEC dpkg --add-architecture "$DPKG_ADD_ARCH" ; fi
|
|
||||||
- travis_retry DOCKER_EXEC apt-get update
|
|
||||||
- travis_retry DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES $DOCKER_PACKAGES
|
|
||||||
before_script:
|
|
||||||
- DOCKER_EXEC echo \> \$HOME/.bitcoin # Make sure default datadir does not exist and is never read by creating a dummy file
|
|
||||||
- mkdir -p depends/SDKs depends/sdk-sources
|
|
||||||
- if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
|
|
||||||
- if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
|
|
||||||
- if [[ $HOST = *-mingw32 ]]; then DOCKER_EXEC update-alternatives --set $HOST-g++ \$\(which $HOST-g++-posix\); fi
|
|
||||||
- if [ -z "$NO_DEPENDS" ]; then DOCKER_EXEC CONFIG_SHELL= make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS; fi
|
|
||||||
script:
|
script:
|
||||||
- export TRAVIS_COMMIT_LOG=`git log --format=fuller -1`
|
- mkdir -p "dist/${TRAVIS_BRANCH}"
|
||||||
- OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST
|
- if [[ "${TARGET}" == "osx" ]]; then ./reproducible_build.sh -t -o -c -r; fi
|
||||||
- BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib"
|
- if [[ "${TARGET}" == "linux" ]]; then ./reproducible_build.sh -t -o -c -r; fi
|
||||||
- if [ -z "$NO_DEPENDS" ]; then DOCKER_EXEC ccache --max-size=$CCACHE_SIZE; fi
|
- if [[ "${TARGET}" == "windows" ]]; then ./packaging/build_windows.sh; fi
|
||||||
- BEGIN_FOLD autogen; test -n "$CONFIG_SHELL" && DOCKER_EXEC "$CONFIG_SHELL" -c "./autogen.sh" || DOCKER_EXEC ./autogen.sh; END_FOLD
|
- if [[ "${TARGET}" == "osx" ]]; then zip -j "dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip" src/lbrycrdd src/lbrycrd-cli src/lbrycrd-tx; fi
|
||||||
- mkdir build && cd build
|
- if [[ "${TARGET}" == "linux" ]]; then zip -j "dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip" src/lbrycrdd src/lbrycrd-cli src/lbrycrd-tx; fi
|
||||||
- BEGIN_FOLD configure; DOCKER_EXEC ../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false); END_FOLD
|
- if [[ "${TARGET}" == "windows" ]]; then zip -j "dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip" src/lbrycrdd.exe src/lbrycrd-cli.exe src/lbrycrd-tx.exe; fi
|
||||||
- BEGIN_FOLD distdir; DOCKER_EXEC make distdir VERSION=$HOST; END_FOLD
|
- if [[ "${TARGET}" == "osx" ]]; then shasum -a 256 dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip > dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}-sha256.txt; fi
|
||||||
- cd bitcoin-$HOST
|
- if [[ "${TARGET}" == "linux" ]]; then sha256sum -b dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip > dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}-sha256.txt; fi
|
||||||
- BEGIN_FOLD configure; DOCKER_EXEC ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false); END_FOLD
|
- if [[ "${TARGET}" == "windows" ]]; then sha256sum -b dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip > dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}-sha256.txt; fi
|
||||||
- BEGIN_FOLD build; DOCKER_EXEC make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make $GOAL V=1 ; false ); END_FOLD
|
- cat dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}-sha256.txt
|
||||||
- if [ "$RUN_TESTS" = "true" ]; then BEGIN_FOLD unit-tests; DOCKER_EXEC LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib make $MAKEJOBS check VERBOSE=1; END_FOLD; fi
|
before_cache:
|
||||||
- if [ "$RUN_BENCH" = "true" ]; then BEGIN_FOLD bench; DOCKER_EXEC LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib $OUTDIR/bin/bench_bitcoin -scaling=0.001 ; END_FOLD; fi
|
- ls -lh build
|
||||||
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then extended="--extended --exclude feature_pruning,feature_dbcrash"; fi
|
- du -h -d 2 build
|
||||||
- if [ "$RUN_TESTS" = "true" ]; then BEGIN_FOLD functional-tests; DOCKER_EXEC test/functional/test_runner.py --combinedlogslen=4000 --coverage --quiet --failfast ${extended}; END_FOLD; fi
|
deploy:
|
||||||
after_script:
|
- provider: releases
|
||||||
- echo $TRAVIS_COMMIT_RANGE
|
draft: true
|
||||||
- echo $TRAVIS_COMMIT_LOG
|
file: "dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip"
|
||||||
jobs:
|
name: "${TRAVIS_BRANCH}"
|
||||||
include:
|
skip_cleanup: true
|
||||||
# ARM
|
target_commitish: $TRAVIS_COMMIT
|
||||||
- stage: test
|
tag_name: $TRAVIS_TAG
|
||||||
env: >-
|
on:
|
||||||
HOST=arm-linux-gnueabihf
|
tags: true
|
||||||
PACKAGES="g++-arm-linux-gnueabihf"
|
api_key:
|
||||||
DEP_OPTS="NO_QT=1"
|
secure: "Ni5WZNR5CefWXpyDUQLMQbQ2LH4Iot+0SqIoM9c4maW06al1M8vu57vWuj2cESsW7JsaBehCE45Cwmo5kWyEjAiZY8sIMmvixkMP/8uPWuLgNmnIbm7U+d0j652DmZshDYtt8EomqV2RhAx/rmBnzGkruLOw9WTp9ZdBN3WbTt/IpZ2gMgVbGWYGOx+uRw7/yGw8m4gShQheto/dycbyyR3XV2WP9wuLmNYkcQ6JumSoQdDWXcvVfbCwylGq2sLDKwhvfTr4iwYyYsWdmhfdEQl0WcIv5C8xgdiY2vzhi2LmLqFbS/fvKNC26Tfo4bOHFG/eOnvqc+yyEB8B/xqW9Gs+A0TUh/3N30vHYZGcpiDU35DwAN5bZ1+s+mr/ZrNzBJ5BgT8io3g0Ko8gykbDvFQVpg7kxFsqA1YCikEpG86lVGk6clTa5guJvAHse+DfnbWO1nfDxYQXW0md861m0txk8RpTC/TVNyH/lL/vsS7LB67EHhRdZY+O1+5sUGMdtvvhMoxJYCwQGpLkh43KRsKynkMUR94w2O9hc8cknXdV3wrndVz00XNdcur6y4D7HTll1tBrF68CA2yKUSY5hsjtPmdlN+DW8ou/rJiKOpQZ/Xzp69AQEheOFfDPItxQRYxWj0dMOk8eszf0wFvi1N7J/hT/IHnuX5ITfa/T4NE="
|
||||||
GOAL="install"
|
- provider: s3
|
||||||
BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
|
access_key_id: AKIAICKFHNTR5RITASAQ
|
||||||
# Win32
|
secret_access_key:
|
||||||
- stage: test
|
secure: Qfgs8vGnEUvgiZNP2S9zY8qHEzaDOceF/XTv32jRBOISWfTqOTE56DZbOp8WKHPAqn0dx04jKA1NfV9f06sXU1NVbiJ2VYISo6XAk0n3RBJL3/mhNxvut/zM2DHkFPljWTkWEColS0ZyA3m4eUyJvAw/i+mOBT/zDD/oIlS5Uo5l/x3LmF9fYBuei0ucwSQeNOr2wCMIl+pXrIU7B3lEzXh1asayW6A9y7DOqMLnrSQ7TLlSssbnhuhDVpFx0xxX/U2NPraotbGKdo3wwMbms/lluBe60I/LsDNp9/SZXMDXh2YLGUImr97octwpdzIMjF+kU7QAZJzM7grz8PU9+MQh2V5sn6Xsww2x4PdkmHGz/2FMzhrCrlPf5JCaPBH49G+w4/29HYmMrlimOOVx4qXCpQ/XtWWne/d6MF0qqT6JhdPuD9ohmTpxcHRkCe2fxUw6Yn3dj+/+YoCywAcwcBm5jLpAotmWoCmmcnm9rvB7bIuPPZAjJUZViCnyvwY4Tj3Fb+sOuK4b/O5D2+cuS+WgQRkN/RspYlXrXTIh8Efv/yhW5L9WdzG1OExJDw2hX5VTccRRgIKZxZp80U2eYqn2M07+1nU+ShX4kgiSon46k5cfacLgzLKWEyCxWSSTbsYcwRxvDEjtYy4wxAYx8+J3dgQPs/opDXoQTJMjud0=
|
||||||
env: >-
|
bucket: build.lbry.io
|
||||||
HOST=i686-w64-mingw32
|
upload-dir: lbrycrd
|
||||||
DPKG_ADD_ARCH="i386"
|
acl: public_read
|
||||||
DEP_OPTS="NO_QT=1"
|
local_dir: dist
|
||||||
PACKAGES="python3 nsis g++-mingw-w64-i686 wine-binfmt wine32"
|
skip_cleanup: true
|
||||||
RUN_TESTS=true
|
on:
|
||||||
GOAL="install"
|
repo: lbryio/lbrycrd
|
||||||
BITCOIN_CONFIG="--enable-reduce-exports"
|
all_branches: true
|
||||||
# Win64
|
|
||||||
- stage: test
|
|
||||||
env: >-
|
|
||||||
HOST=x86_64-w64-mingw32
|
|
||||||
DEP_OPTS="NO_QT=1"
|
|
||||||
PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64"
|
|
||||||
RUN_TESTS=true
|
|
||||||
GOAL="install"
|
|
||||||
BITCOIN_CONFIG="--enable-reduce-exports"
|
|
||||||
# 32-bit + dash
|
|
||||||
- stage: test
|
|
||||||
env: >-
|
|
||||||
HOST=i686-pc-linux-gnu
|
|
||||||
PACKAGES="g++-multilib python3-zmq"
|
|
||||||
DEP_OPTS="NO_QT=1"
|
|
||||||
RUN_TESTS=true
|
|
||||||
GOAL="install"
|
|
||||||
BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++"
|
|
||||||
CONFIG_SHELL="/bin/dash"
|
|
||||||
# x86_64 Linux (uses qt5 dev package instead of depends Qt to speed up build and avoid timeout)
|
|
||||||
- stage: test
|
|
||||||
env: >-
|
|
||||||
HOST=x86_64-unknown-linux-gnu
|
|
||||||
PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools protobuf-compiler libdbus-1-dev libharfbuzz-dev libprotobuf-dev"
|
|
||||||
DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1"
|
|
||||||
RUN_TESTS=true
|
|
||||||
RUN_BENCH=true
|
|
||||||
GOAL="install"
|
|
||||||
BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --enable-debug CXXFLAGS=\"-g0 -O2\""
|
|
||||||
# x86_64 Linux (Qt5 & system libs)
|
|
||||||
- stage: test
|
|
||||||
env: >-
|
|
||||||
HOST=x86_64-unknown-linux-gnu
|
|
||||||
PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libssl1.0-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 libprotobuf-dev protobuf-compiler libqrencode-dev"
|
|
||||||
NO_DEPENDS=1
|
|
||||||
RUN_TESTS=true
|
|
||||||
GOAL="install"
|
|
||||||
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER"
|
|
||||||
# x86_64 Linux, No wallet
|
|
||||||
- stage: test
|
|
||||||
env: >-
|
|
||||||
HOST=x86_64-unknown-linux-gnu
|
|
||||||
PACKAGES="python3"
|
|
||||||
DEP_OPTS="NO_WALLET=1"
|
|
||||||
RUN_TESTS=true
|
|
||||||
GOAL="install"
|
|
||||||
BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
|
|
||||||
# Cross-Mac
|
|
||||||
- stage: test
|
|
||||||
env: >-
|
|
||||||
HOST=x86_64-apple-darwin14
|
|
||||||
PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev python3-setuptools-git"
|
|
||||||
OSX_SDK=10.11
|
|
||||||
GOAL="all deploy"
|
|
||||||
BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --enable-werror"
|
|
||||||
- stage: lint
|
|
||||||
env:
|
|
||||||
cache: false
|
|
||||||
language: python
|
|
||||||
python: '3.6'
|
|
||||||
install:
|
|
||||||
- travis_retry pip install flake8==3.5.0
|
|
||||||
before_script:
|
|
||||||
- git fetch --unshallow
|
|
||||||
script:
|
|
||||||
- if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then test/lint/commit-script-check.sh $TRAVIS_COMMIT_RANGE; fi
|
|
||||||
- test/lint/git-subtree-check.sh src/crypto/ctaes
|
|
||||||
- test/lint/git-subtree-check.sh src/secp256k1
|
|
||||||
- test/lint/git-subtree-check.sh src/univalue
|
|
||||||
- test/lint/git-subtree-check.sh src/leveldb
|
|
||||||
- test/lint/check-doc.py
|
|
||||||
- test/lint/check-rpc-mappings.py .
|
|
||||||
- test/lint/lint-all.sh
|
|
||||||
- if [ "$TRAVIS_REPO_SLUG" = "bitcoin/bitcoin" -a "$TRAVIS_EVENT_TYPE" = "cron" ]; then
|
|
||||||
while read LINE; do travis_retry gpg --keyserver hkp://subset.pool.sks-keyservers.net --recv-keys $LINE; done < contrib/verify-commits/trusted-keys &&
|
|
||||||
travis_wait 50 contrib/verify-commits/verify-commits.py;
|
|
||||||
fi
|
|
||||||
|
|
56
CMakeLists.txt
Normal file
56
CMakeLists.txt
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
cmake_minimum_required(VERSION 3.7)
|
||||||
|
project(lbrycrd_clion) # Do not use for full compile. This is for CLion syntax checking only.
|
||||||
|
|
||||||
|
set (CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
|
if(EXISTS "build/boost")
|
||||||
|
set(BOOST_ROOT "build/boost" CACHE PATH "Boost library path")
|
||||||
|
set(Boost_NO_SYSTEM_PATHS on CACHE BOOL "Do not search system for Boost")
|
||||||
|
endif()
|
||||||
|
find_package(Boost REQUIRED COMPONENTS filesystem thread chrono locale)
|
||||||
|
|
||||||
|
file(GLOB sources
|
||||||
|
src/*.h src/*.cpp
|
||||||
|
src/wallet/*.h src/wallet/*.cpp
|
||||||
|
src/support/*.h src/support/*.cpp src/support/allocators/*.h
|
||||||
|
src/script/*.h src/script/*.cpp
|
||||||
|
src/index/*.h src/index/*.cpp
|
||||||
|
src/interfaces/*.h src/interfaces/*.cpp
|
||||||
|
src/primitives/*.h src/primitives/*.cpp
|
||||||
|
src/policy/*.h src/policy/*.cpp
|
||||||
|
src/crypto/*.h src/crypto/*.cpp
|
||||||
|
src/consensus/*.h src/consensus/*.cpp
|
||||||
|
src/compat/*.h src/compat/*.cpp
|
||||||
|
src/rpc/*.h src/rpc/*.cpp
|
||||||
|
)
|
||||||
|
list(FILTER sources EXCLUDE REGEX "src/bitcoin*.cpp$")
|
||||||
|
|
||||||
|
include_directories(${Boost_INCLUDE_DIRS}
|
||||||
|
build/bdb/include
|
||||||
|
build/libevent/include
|
||||||
|
build/openssl/include
|
||||||
|
src/support/allocators
|
||||||
|
src/support
|
||||||
|
src/rpc
|
||||||
|
src/policy
|
||||||
|
src/wallet src/script
|
||||||
|
src/leveldb/helpers/memenv
|
||||||
|
src/leveldb/include
|
||||||
|
src/config
|
||||||
|
src/crypto
|
||||||
|
src/compat
|
||||||
|
src/obj
|
||||||
|
src/univalue/include
|
||||||
|
src/secp256k1/include
|
||||||
|
src/
|
||||||
|
)
|
||||||
|
|
||||||
|
add_compile_definitions(HAVE_CONFIG_H)
|
||||||
|
|
||||||
|
add_executable(lbrycrd-cli src/bitcoin-cli.cpp ${sources})
|
||||||
|
add_executable(lbrycrd-tx src/bitcoin-tx.cpp ${sources})
|
||||||
|
add_executable(lbrycrdd src/bitcoind.cpp ${sources})
|
||||||
|
|
||||||
|
file(GLOB tests src/test/*.cpp src/wallet/test/*.cpp)
|
||||||
|
add_executable(test_lbrycrd ${tests} ${sources})
|
||||||
|
target_include_directories(test_lbrycrd PRIVATE src/test)
|
15
LICENSE
Normal file
15
LICENSE
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2015-2019 LBRY Inc
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
||||||
|
following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -25,7 +25,7 @@ BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EX
|
||||||
empty :=
|
empty :=
|
||||||
space := $(empty) $(empty)
|
space := $(empty) $(empty)
|
||||||
|
|
||||||
OSX_APP=Bitcoin-Qt.app
|
OSX_APP=LBRYcrd-Qt.app
|
||||||
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
|
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
|
||||||
OSX_DMG = $(OSX_VOLNAME).dmg
|
OSX_DMG = $(OSX_VOLNAME).dmg
|
||||||
OSX_BACKGROUND_SVG=background.svg
|
OSX_BACKGROUND_SVG=background.svg
|
||||||
|
|
121
README.md
121
README.md
|
@ -1,76 +1,93 @@
|
||||||
Bitcoin Core integration/staging tree
|
# LBRYcrd - The LBRY blockchain
|
||||||
=====================================
|
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/bitcoin/bitcoin.svg?branch=master)](https://travis-ci.org/bitcoin/bitcoin)
|
![alt text](lbrycrdd_daemon_screenshot.png "lbrycrdd daemon screenshot")
|
||||||
|
|
||||||
https://bitcoincore.org
|
LBRYcrd uses a blockchain similar to bitcoin's to implement an index and payment system for content on the LBRY network. It is a fork of bitcoin core.
|
||||||
|
|
||||||
What is Bitcoin?
|
## Installation
|
||||||
----------------
|
|
||||||
|
|
||||||
Bitcoin is an experimental digital currency that enables instant payments to
|
Latest binaries are available from https://github.com/lbryio/lbrycrd/releases. There is no installation procedure, the binaries will be run as-is.
|
||||||
anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate
|
|
||||||
with no central authority: managing transactions and issuing money are carried
|
|
||||||
out collectively by the network. Bitcoin Core is the name of open source
|
|
||||||
software which enables the use of this currency.
|
|
||||||
|
|
||||||
For more information, as well as an immediately useable, binary version of
|
## Usage
|
||||||
the Bitcoin Core software, see https://bitcoincore.org/en/download/, or read the
|
|
||||||
[original whitepaper](https://bitcoincore.org/bitcoin.pdf).
|
|
||||||
|
|
||||||
License
|
The `lbrycrdd` executable will start a LBRYcrd node and connect you to the LBRYcrd network. Use the `lbrycrd-cli` executable
|
||||||
-------
|
to interact with lbrycrdd through the command line. Help pages for both executable are available through
|
||||||
|
the "--help" flag (e.g. `lbrycrd-cli --help`).
|
||||||
|
|
||||||
Bitcoin Core is released under the terms of the MIT license. See [COPYING](COPYING) for more
|
### Example Usage
|
||||||
information or see https://opensource.org/licenses/MIT.
|
|
||||||
|
|
||||||
Development Process
|
Run `./lbrycrdd -server -daemon` to start lbrycrdd in the background.
|
||||||
-------------------
|
|
||||||
|
Run `./lbrycrd-cli getinfo` to check for some basic information about your LBRYcrd node.
|
||||||
|
|
||||||
|
Run `./lbrycrd-cli help` to get a list of all commands that you can run. To get help on specific commands run `./lbrycrd-cli [command_name] help`
|
||||||
|
|
||||||
|
### Data directory
|
||||||
|
|
||||||
|
Lbrycrdd will use the below default data directories:
|
||||||
|
|
||||||
|
Windows < Vista: C:\Documents and Settings\Username\Application Data\lbrycrd
|
||||||
|
|
||||||
|
Windows >= Vista: C:\Users\Username\AppData\Roaming\lbrycrd
|
||||||
|
|
||||||
|
Mac: ~/Library/Application Support/lbrycrd
|
||||||
|
|
||||||
|
Unix: ~/.lbrycrd
|
||||||
|
|
||||||
|
The data directory contains various things such as your default wallet (wallet.dat), debug logs (debug.log), and blockchain data. You can optionally create a configuration file lbrycrd.conf in the default data directory which will be used by default when running lbrycrdd.
|
||||||
|
|
||||||
|
For a list of configuration parameters, run `./lbrycrdd --help`. Below is a sample lbrycrd.conf to enable JSON RPC server on lbrycrdd.
|
||||||
|
|
||||||
|
```
|
||||||
|
rpcuser=lbry
|
||||||
|
rpcpassword=xyz123456790
|
||||||
|
daemon=1
|
||||||
|
server=1
|
||||||
|
txindex=1
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running from Source
|
||||||
|
|
||||||
|
Run `./reproducible_build.sh -c -t`. This will build the binaries and put them into the `./src` directory.
|
||||||
|
|
||||||
|
If you encounter any errors, please check `doc/build-*.md` for further instructions. If you're still stuck, [create an issue](https://github.com/lbryio/lbrycrd/issues/new) with the output of that command, your system info, and any other information you think might be helpful.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Contributions to this project are welcome, encouraged, and compensated. For more details, see [lbry.io/faq/contributing](https://lbry.io/faq/contributing)
|
||||||
|
|
||||||
|
We follow the same coding guidelines as documented by Bitcoin Core, see [here](/doc/developer-notes.md). To run an automated code formatting check, try:
|
||||||
|
`git diff -U0 master -- '*.h' '*.cpp' | ./contrib/devtools/clang-format-diff.py -p1`. This will check any commits not on master for proper code formatting.
|
||||||
|
We try to avoid altering parts of the code that is inherited from Bitcoin Core unless absolutely necessary. This will make it easier to merge changes from Bitcoin Core. If commits are expected not to be merged upstream (i.e. we broke up a commit from Bitcoin Core in order to use a single feature in it), the commit message must contain the string "NOT FOR UPSTREAM MERGE".
|
||||||
|
|
||||||
The `master` branch is regularly built and tested, but is not guaranteed to be
|
The `master` branch is regularly built and tested, but is not guaranteed to be
|
||||||
completely stable. [Tags](https://github.com/bitcoin/bitcoin/tags) are created
|
completely stable. [Releases](https://github.com/lbryio/lbrycrd/releases) are created
|
||||||
regularly to indicate new official, stable release versions of Bitcoin Core.
|
regularly to indicate new official, stable release versions.
|
||||||
|
|
||||||
The contribution workflow is described in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
||||||
|
|
||||||
Testing
|
|
||||||
-------
|
|
||||||
|
|
||||||
Testing and code review is the bottleneck for development; we get more pull
|
Testing and code review is the bottleneck for development; we get more pull
|
||||||
requests than we can review and test on short notice. Please be patient and help out by testing
|
requests than we can review and test on short notice. Please be patient and help out by testing
|
||||||
other people's pull requests, and remember this is a security-critical project where any mistake might cost people
|
other people's pull requests, and remember this is a security-critical project where any mistake might cost people
|
||||||
lots of money.
|
lots of money. Developers are strongly encouraged to write [unit tests](/doc/unit-tests.md) for new code, and to
|
||||||
|
|
||||||
### Automated Testing
|
|
||||||
|
|
||||||
Developers are strongly encouraged to write [unit tests](src/test/README.md) for new code, and to
|
|
||||||
submit new unit tests for old code. Unit tests can be compiled and run
|
submit new unit tests for old code. Unit tests can be compiled and run
|
||||||
(assuming they weren't disabled in configure) with: `make check`. Further details on running
|
(assuming they weren't disabled in configure) with: `make check`
|
||||||
and extending unit tests can be found in [/src/test/README.md](/src/test/README.md).
|
|
||||||
|
|
||||||
There are also [regression and integration tests](/test), written
|
The Travis CI system makes sure that every pull request is built, and that unit and sanity tests are automatically run.
|
||||||
in Python, that are run automatically on the build server.
|
|
||||||
These tests can be run (if the [test dependencies](/test) are installed) with: `test/functional/test_runner.py`
|
|
||||||
|
|
||||||
The Travis CI system makes sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.
|
### Testnet
|
||||||
|
|
||||||
### Manual Quality Assurance (QA) Testing
|
Testnet is maintained for testing purposes and can be accessed using the command `./lbrycrdd -testnet`. If you would like to obtain testnet credits, please contact brannon@lbry.io or grin@lbry.io.
|
||||||
|
|
||||||
Changes should be tested by somebody other than the developer who wrote the
|
## License
|
||||||
code. This is especially important for large or high-risk changes. It is useful
|
|
||||||
to add a test plan to the pull request description if testing the changes is
|
|
||||||
not straightforward.
|
|
||||||
|
|
||||||
Translations
|
This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
|
||||||
------------
|
|
||||||
|
|
||||||
Changes to translations as well as new translations can be submitted to
|
## Security
|
||||||
[Bitcoin Core's Transifex page](https://www.transifex.com/projects/p/bitcoin/).
|
|
||||||
|
|
||||||
Translations are periodically pulled from Transifex and merged into the git repository. See the
|
We take security seriously. Please contact security@lbry.io regarding any security issues.
|
||||||
[translation process](doc/translation_process.md) for details on how this works.
|
Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it.
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
|
||||||
|
The primary contact for this project is [@BrannonKing](https://github.com/BrannonKing) (brannon@lbry.io)
|
||||||
|
|
||||||
**Important**: We do not accept translation changes as GitHub pull requests because the next
|
|
||||||
pull from Transifex would automatically overwrite them again.
|
|
||||||
|
|
||||||
Translators should also subscribe to the [mailing list](https://groups.google.com/forum/#!forum/bitcoin-translators).
|
|
||||||
|
|
120
build-aux/m4/ax_boost_locale.m4
Normal file
120
build-aux/m4/ax_boost_locale.m4
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
# ===========================================================================
|
||||||
|
# https://www.gnu.org/software/autoconf-archive/ax_boost_locale.html
|
||||||
|
# ===========================================================================
|
||||||
|
#
|
||||||
|
# SYNOPSIS
|
||||||
|
#
|
||||||
|
# AX_BOOST_LOCALE
|
||||||
|
#
|
||||||
|
# DESCRIPTION
|
||||||
|
#
|
||||||
|
# Test for System library from the Boost C++ libraries. The macro requires
|
||||||
|
# a preceding call to AX_BOOST_BASE. Further documentation is available at
|
||||||
|
# <http://randspringer.de/boost/index.html>.
|
||||||
|
#
|
||||||
|
# This macro calls:
|
||||||
|
#
|
||||||
|
# AC_SUBST(BOOST_LOCALE_LIB)
|
||||||
|
#
|
||||||
|
# And sets:
|
||||||
|
#
|
||||||
|
# HAVE_BOOST_LOCALE
|
||||||
|
#
|
||||||
|
# LICENSE
|
||||||
|
#
|
||||||
|
# Copyright (c) 2012 Xiyue Deng <manphiz@gmail.com>
|
||||||
|
#
|
||||||
|
# Copying and distribution of this file, with or without modification, are
|
||||||
|
# permitted in any medium without royalty provided the copyright notice
|
||||||
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
|
# warranty.
|
||||||
|
|
||||||
|
#serial 2
|
||||||
|
|
||||||
|
AC_DEFUN([AX_BOOST_LOCALE],
|
||||||
|
[
|
||||||
|
AC_ARG_WITH([boost-locale],
|
||||||
|
AS_HELP_STRING([--with-boost-locale@<:@=special-lib@:>@],
|
||||||
|
[use the Locale library from boost - it is possible to specify a certain library for the linker
|
||||||
|
e.g. --with-boost-locale=boost_locale-gcc-mt ]),
|
||||||
|
[
|
||||||
|
if test "$withval" = "no"; then
|
||||||
|
want_boost="no"
|
||||||
|
elif test "$withval" = "yes"; then
|
||||||
|
want_boost="yes"
|
||||||
|
ax_boost_user_locale_lib=""
|
||||||
|
else
|
||||||
|
want_boost="yes"
|
||||||
|
ax_boost_user_locale_lib="$withval"
|
||||||
|
fi
|
||||||
|
],
|
||||||
|
[want_boost="yes"]
|
||||||
|
)
|
||||||
|
|
||||||
|
if test "x$want_boost" = "xyes"; then
|
||||||
|
AC_REQUIRE([AC_PROG_CC])
|
||||||
|
AC_REQUIRE([AC_CANONICAL_BUILD])
|
||||||
|
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||||
|
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||||
|
export CPPFLAGS
|
||||||
|
|
||||||
|
LDFLAGS_SAVED="$LDFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||||
|
export LDFLAGS
|
||||||
|
|
||||||
|
AC_CACHE_CHECK(whether the Boost::Locale library is available,
|
||||||
|
ax_cv_boost_locale,
|
||||||
|
[AC_LANG_PUSH([C++])
|
||||||
|
CXXFLAGS_SAVE=$CXXFLAGS
|
||||||
|
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/locale.hpp>]],
|
||||||
|
[[boost::locale::generator gen;
|
||||||
|
std::locale::global(gen(""));]])],
|
||||||
|
ax_cv_boost_locale=yes, ax_cv_boost_locale=no)
|
||||||
|
CXXFLAGS=$CXXFLAGS_SAVE
|
||||||
|
AC_LANG_POP([C++])
|
||||||
|
])
|
||||||
|
if test "x$ax_cv_boost_locale" = "xyes"; then
|
||||||
|
AC_SUBST(BOOST_CPPFLAGS)
|
||||||
|
|
||||||
|
AC_DEFINE(HAVE_BOOST_LOCALE,,[define if the Boost::Locale library is available])
|
||||||
|
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
|
||||||
|
|
||||||
|
LDFLAGS_SAVE=$LDFLAGS
|
||||||
|
if test "x$ax_boost_user_locale_lib" = "x"; then
|
||||||
|
for libextension in `ls $BOOSTLIBDIR/libboost_locale*.so* $BOOSTLIBDIR/libboost_locale*.dylib* $BOOSTLIBDIR/libboost_locale*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_locale.*\)\.so.*$;\1;' -e 's;^lib\(boost_locale.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_locale.*\)\.a.*$;\1;'` ; do
|
||||||
|
ax_lib=${libextension}
|
||||||
|
AC_CHECK_LIB($ax_lib, exit,
|
||||||
|
[BOOST_LOCALE_LIB="-l$ax_lib"; AC_SUBST(BOOST_LOCALE_LIB) link_locale="yes"; break],
|
||||||
|
[link_locale="no"])
|
||||||
|
done
|
||||||
|
if test "x$link_locale" != "xyes"; then
|
||||||
|
for libextension in `ls $BOOSTLIBDIR/boost_locale*.dll* $BOOSTLIBDIR/boost_locale*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_locale.*\)\.dll.*$;\1;' -e 's;^\(boost_locale.*\)\.a.*$;\1;'` ; do
|
||||||
|
ax_lib=${libextension}
|
||||||
|
AC_CHECK_LIB($ax_lib, exit,
|
||||||
|
[BOOST_LOCALE_LIB="-l$ax_lib"; AC_SUBST(BOOST_LOCALE_LIB) link_locale="yes"; break],
|
||||||
|
[link_locale="no"])
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
for ax_lib in $ax_boost_user_locale_lib boost_locale-$ax_boost_user_locale_lib; do
|
||||||
|
AC_CHECK_LIB($ax_lib, exit,
|
||||||
|
[BOOST_LOCALE_LIB="-l$ax_lib"; AC_SUBST(BOOST_LOCALE_LIB) link_locale="yes"; break],
|
||||||
|
[link_locale="no"])
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
if test "x$ax_lib" = "x"; then
|
||||||
|
AC_MSG_ERROR(Could not find a version of the library!)
|
||||||
|
fi
|
||||||
|
if test "x$link_locale" = "xno"; then
|
||||||
|
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||||
|
LDFLAGS="$LDFLAGS_SAVED"
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
69
configure.ac
69
configure.ac
|
@ -5,19 +5,19 @@ define(_CLIENT_VERSION_MINOR, 17)
|
||||||
define(_CLIENT_VERSION_REVISION, 1)
|
define(_CLIENT_VERSION_REVISION, 1)
|
||||||
define(_CLIENT_VERSION_BUILD, 0)
|
define(_CLIENT_VERSION_BUILD, 0)
|
||||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||||
define(_COPYRIGHT_YEAR, 2018)
|
define(_COPYRIGHT_YEAR, 2019)
|
||||||
define(_COPYRIGHT_HOLDERS,[The %s developers])
|
define(_COPYRIGHT_HOLDERS,[The %s developers])
|
||||||
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Bitcoin Core]])
|
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[LBRYcrd Core]])
|
||||||
AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://bitcoincore.org/])
|
AC_INIT([LBRYcrd Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/lbryio/lbrycrd/issues],[lbrycrd],[https://lbry.com/])
|
||||||
AC_CONFIG_SRCDIR([src/validation.cpp])
|
AC_CONFIG_SRCDIR([src/validation.cpp])
|
||||||
AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
|
AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([build-aux/m4])
|
AC_CONFIG_MACRO_DIR([build-aux/m4])
|
||||||
|
|
||||||
BITCOIN_DAEMON_NAME=bitcoind
|
BITCOIN_DAEMON_NAME=lbrycrdd
|
||||||
BITCOIN_GUI_NAME=bitcoin-qt
|
BITCOIN_GUI_NAME=lbrycrd-qt
|
||||||
BITCOIN_CLI_NAME=bitcoin-cli
|
BITCOIN_CLI_NAME=lbrycrd-cli
|
||||||
BITCOIN_TX_NAME=bitcoin-tx
|
BITCOIN_TX_NAME=lbrycrd-tx
|
||||||
|
|
||||||
dnl Unless the user specified ARFLAGS, force it to be cr
|
dnl Unless the user specified ARFLAGS, force it to be cr
|
||||||
AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])
|
AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])
|
||||||
|
@ -146,6 +146,12 @@ AC_ARG_WITH([qrencode],
|
||||||
[use_qr=$withval],
|
[use_qr=$withval],
|
||||||
[use_qr=auto])
|
[use_qr=auto])
|
||||||
|
|
||||||
|
AC_ARG_WITH([icu],
|
||||||
|
[AS_HELP_STRING([--with-icu],
|
||||||
|
[Required ICU root path])],
|
||||||
|
[ICU_PREFIX=$withval],
|
||||||
|
[ICU_PREFIX=auto])
|
||||||
|
|
||||||
AC_ARG_ENABLE([hardening],
|
AC_ARG_ENABLE([hardening],
|
||||||
[AS_HELP_STRING([--disable-hardening],
|
[AS_HELP_STRING([--disable-hardening],
|
||||||
[do not attempt to harden the resulting executables (default is to harden when possible)])],
|
[do not attempt to harden the resulting executables (default is to harden when possible)])],
|
||||||
|
@ -395,7 +401,7 @@ CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
|
||||||
|
|
||||||
AC_ARG_WITH([utils],
|
AC_ARG_WITH([utils],
|
||||||
[AS_HELP_STRING([--with-utils],
|
[AS_HELP_STRING([--with-utils],
|
||||||
[build bitcoin-cli bitcoin-tx (default=yes)])],
|
[build lbrycrd-cli lbrycrd-tx (default=yes)])],
|
||||||
[build_bitcoin_utils=$withval],
|
[build_bitcoin_utils=$withval],
|
||||||
[build_bitcoin_utils=yes])
|
[build_bitcoin_utils=yes])
|
||||||
|
|
||||||
|
@ -640,6 +646,9 @@ if test x$ac_cv_sys_large_files != x &&
|
||||||
CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
|
CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test x$enable_static != x; then
|
||||||
|
AX_CHECK_LINK_FLAG([[-static-libstdc++]], [LDFLAGS="$LDFLAGS -static-libstdc++"])
|
||||||
|
fi
|
||||||
AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"])
|
AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"])
|
||||||
|
|
||||||
AX_GCC_FUNC_ATTRIBUTE([visibility])
|
AX_GCC_FUNC_ATTRIBUTE([visibility])
|
||||||
|
@ -779,7 +788,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
)
|
)
|
||||||
|
|
||||||
TEMP_LDFLAGS="$LDFLAGS"
|
TEMP_LDFLAGS="$LDFLAGS"
|
||||||
LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS"
|
LDFLAGS="$TEMP_LDFLAGS $PTHREAD_LIBS"
|
||||||
AC_MSG_CHECKING([for thread_local support])
|
AC_MSG_CHECKING([for thread_local support])
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
@ -895,6 +904,7 @@ AX_BOOST_SYSTEM
|
||||||
AX_BOOST_FILESYSTEM
|
AX_BOOST_FILESYSTEM
|
||||||
AX_BOOST_THREAD
|
AX_BOOST_THREAD
|
||||||
AX_BOOST_CHRONO
|
AX_BOOST_CHRONO
|
||||||
|
AX_BOOST_LOCALE
|
||||||
|
|
||||||
dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic
|
dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic
|
||||||
dnl counter implementations. In 1.63 and later the std::atomic approach is default.
|
dnl counter implementations. In 1.63 and later the std::atomic approach is default.
|
||||||
|
@ -961,7 +971,7 @@ fi
|
||||||
|
|
||||||
if test x$use_boost = xyes; then
|
if test x$use_boost = xyes; then
|
||||||
|
|
||||||
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB"
|
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB $BOOST_LOCALE_LIB"
|
||||||
|
|
||||||
|
|
||||||
dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums
|
dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums
|
||||||
|
@ -1052,6 +1062,20 @@ fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AS_IF([test "x$ICU_PREFIX" != xauto], [
|
||||||
|
ICU_CPPFLAGS="-I$ICU_PREFIX/include"
|
||||||
|
ICU_LIBS="-L$ICU_PREFIX/lib -licui18n -licuuc -licudata -ldl"
|
||||||
|
# PKG_CONFIG_PATH="${ICU_PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
|
# export PKG_CONFIG_PATH
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_NOTICE([Using ICU_CPPFLAGS $ICU_CPPFLAGS])
|
||||||
|
AC_MSG_NOTICE([Using ICU_LIBS $ICU_LIBS])
|
||||||
|
|
||||||
|
CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS"
|
||||||
|
ORIG_LDFLAGS=$LDFLAGS
|
||||||
|
LDFLAGS="$LDFLAGS $ICU_LIBS"
|
||||||
|
|
||||||
if test x$use_pkgconfig = xyes; then
|
if test x$use_pkgconfig = xyes; then
|
||||||
: dnl
|
: dnl
|
||||||
m4_ifdef(
|
m4_ifdef(
|
||||||
|
@ -1081,7 +1105,19 @@ if test x$use_pkgconfig = xyes; then
|
||||||
fi
|
fi
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else
|
else # compiling on Window:
|
||||||
|
AC_MSG_NOTICE([Configuring for Windows])
|
||||||
|
|
||||||
|
CPPFLAGS="$CPPFLAGS -Ix86_64-w64-mingw32/include"
|
||||||
|
LDFLAGS="$LDFLAGS -Lx86_64-w64-mingw32/lib"
|
||||||
|
|
||||||
|
AC_CHECK_HEADER([unicode/errorcode.h],,AC_MSG_ERROR(libicu headers missing))
|
||||||
|
AC_CHECK_LIB([icudata], [main], ICU_LIBS=$ICU_LIBS,
|
||||||
|
AC_CHECK_LIB([icu18n], [main],ICU_LIBS=$ICU_LIBS, ICU_LIBS="-L$ICU_PREFIX/lib -lsicuio -lsicuin -lsiculx -lsicule -lsicuuc -lsicudt"))
|
||||||
|
AC_MSG_NOTICE([Using ICU_LIBS=$ICU_LIBS])
|
||||||
|
LDFLAGS="$ORIG_LDFLAGS $ICU_LIBS"
|
||||||
|
AC_CHECK_LIB([sicudt], [main], ICU_LIBS=$ICU_LIBS, AC_MSG_ERROR(icu libraries missing))
|
||||||
|
|
||||||
AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
|
AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
|
||||||
AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
|
AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
|
||||||
|
|
||||||
|
@ -1187,7 +1223,7 @@ AC_MSG_CHECKING([whether to build bitcoind])
|
||||||
AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
|
AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
|
||||||
AC_MSG_RESULT($build_bitcoind)
|
AC_MSG_RESULT($build_bitcoind)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)])
|
AC_MSG_CHECKING([whether to build utils (lbrycrd-cli lbrycrd-tx)])
|
||||||
AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
|
AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
|
||||||
AC_MSG_RESULT($build_bitcoin_utils)
|
AC_MSG_RESULT($build_bitcoin_utils)
|
||||||
|
|
||||||
|
@ -1288,7 +1324,7 @@ if test x$bitcoin_enable_qt != xno; then
|
||||||
AC_MSG_WARN("xgettext is required to update qt translations")
|
AC_MSG_WARN("xgettext is required to update qt translations")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build test_bitcoin-qt])
|
AC_MSG_CHECKING([whether to build test_lbrycrd-qt])
|
||||||
if test x$use_gui_tests$bitcoin_enable_qt_test = xyesyes; then
|
if test x$use_gui_tests$bitcoin_enable_qt_test = xyesyes; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
BUILD_TEST_QT="yes"
|
BUILD_TEST_QT="yes"
|
||||||
|
@ -1299,7 +1335,7 @@ fi
|
||||||
|
|
||||||
AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"])
|
AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build test_bitcoin])
|
AC_MSG_CHECKING([whether to build test_lbrycrd])
|
||||||
if test x$use_tests = xyes; then
|
if test x$use_tests = xyes; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
BUILD_TEST="yes"
|
BUILD_TEST="yes"
|
||||||
|
@ -1385,11 +1421,14 @@ AC_SUBST(LIBTOOL_APP_LDFLAGS)
|
||||||
AC_SUBST(USE_UPNP)
|
AC_SUBST(USE_UPNP)
|
||||||
AC_SUBST(USE_QRCODE)
|
AC_SUBST(USE_QRCODE)
|
||||||
AC_SUBST(BOOST_LIBS)
|
AC_SUBST(BOOST_LIBS)
|
||||||
|
AC_SUBST(ICU_CPPFLAGS)
|
||||||
|
AC_SUBST(ICU_LIBS)
|
||||||
AC_SUBST(TESTDEFS)
|
AC_SUBST(TESTDEFS)
|
||||||
AC_SUBST(LEVELDB_TARGET_FLAGS)
|
AC_SUBST(LEVELDB_TARGET_FLAGS)
|
||||||
AC_SUBST(MINIUPNPC_CPPFLAGS)
|
AC_SUBST(MINIUPNPC_CPPFLAGS)
|
||||||
AC_SUBST(MINIUPNPC_LIBS)
|
AC_SUBST(MINIUPNPC_LIBS)
|
||||||
AC_SUBST(CRYPTO_LIBS)
|
AC_SUBST(CRYPTO_LIBS)
|
||||||
|
AC_SUBST(SSL_CFLAGS)
|
||||||
AC_SUBST(SSL_LIBS)
|
AC_SUBST(SSL_LIBS)
|
||||||
AC_SUBST(EVENT_LIBS)
|
AC_SUBST(EVENT_LIBS)
|
||||||
AC_SUBST(EVENT_PTHREADS_LIBS)
|
AC_SUBST(EVENT_PTHREADS_LIBS)
|
||||||
|
@ -1431,7 +1470,7 @@ if test x$need_bundled_univalue = xyes; then
|
||||||
AC_CONFIG_SUBDIRS([src/univalue])
|
AC_CONFIG_SUBDIRS([src/univalue])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no --enable-module-recovery --disable-jni"
|
ac_configure_args="${ac_configure_args} --enable-static --disable-shared --with-pic --with-bignum=no --enable-module-recovery --disable-jni"
|
||||||
AC_CONFIG_SUBDIRS([src/secp256k1])
|
AC_CONFIG_SUBDIRS([src/secp256k1])
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
277
contrib/devtools/generate_json_api_jrgen.py
Executable file
277
contrib/devtools/generate_json_api_jrgen.py
Executable file
|
@ -0,0 +1,277 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import re
|
||||||
|
import subprocess as sp
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
import urllib.request as req
|
||||||
|
import jsonschema
|
||||||
|
|
||||||
|
|
||||||
|
re_full = re.compile(r'(?P<name>^.*?$)(?P<desc>.*?)(^Argument.*?$(?P<args>.*?))?(^Result[^\n,]*?:\s*$(?P<resl>.*?))?(^Exampl.*?$(?P<exmp>.*))?', re.DOTALL | re.MULTILINE)
|
||||||
|
re_argline = re.compile(r'^("?)(?P<name>\w.*?)\1(\s*:.+?,?\s*)?\s+\((?P<type>.*?)\)\s*(?P<desc>.*?)\s*$', re.DOTALL)
|
||||||
|
|
||||||
|
|
||||||
|
def get_obj_from_dirty_text(full_object: str):
|
||||||
|
lines = full_object.splitlines()
|
||||||
|
lefts = []
|
||||||
|
i = 0
|
||||||
|
while i < len(lines):
|
||||||
|
idx = lines[i].find('(')
|
||||||
|
left = lines[i][0:idx].strip() if idx >= 0 else lines[i]
|
||||||
|
left = left.rstrip('.') # handling , ...
|
||||||
|
left = left.strip()
|
||||||
|
left = left.rstrip(',')
|
||||||
|
lefts.append(left)
|
||||||
|
while idx >= 0 and i < len(lines) - 1:
|
||||||
|
idx2 = len(re.match(r'^\s*', lines[i + 1]).group())
|
||||||
|
if idx2 > idx:
|
||||||
|
lines[i] += lines.pop(i + 1)[idx2 - 1:]
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
ret = None
|
||||||
|
try:
|
||||||
|
property_stack = []
|
||||||
|
object_stack = []
|
||||||
|
name_stack = []
|
||||||
|
|
||||||
|
last_name = None
|
||||||
|
for i in range(0, len(lines)):
|
||||||
|
left = lefts[i]
|
||||||
|
if not left:
|
||||||
|
continue
|
||||||
|
line = lines[i].strip()
|
||||||
|
|
||||||
|
arg_parsed = re_argline.fullmatch(line)
|
||||||
|
property_refined_type = 'object'
|
||||||
|
if arg_parsed is not None:
|
||||||
|
property_name, property_type, property_desc = arg_parsed.group('name', 'type', 'desc')
|
||||||
|
property_refined_type, property_required, property_child = get_type(property_type, None)
|
||||||
|
|
||||||
|
if property_refined_type is not 'array' and property_refined_type is not 'object':
|
||||||
|
property_stack[-1][property_name] = {
|
||||||
|
'type': property_refined_type,
|
||||||
|
'description': property_desc
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
last_name = property_name
|
||||||
|
elif len(left) > 1:
|
||||||
|
match = re.match(r'^(\[)?"(?P<name>\w.*?)"(\])?.*', left)
|
||||||
|
last_name = match.group('name')
|
||||||
|
if match.group(1) is not None and match.group(3) is not None:
|
||||||
|
left = '['
|
||||||
|
property_refined_type = 'string'
|
||||||
|
if 'string' not in line:
|
||||||
|
raise NotImplementedError('Not implemented: ' + line)
|
||||||
|
|
||||||
|
if left.endswith('['):
|
||||||
|
object_stack.append({'type': 'array', 'items': {'type': property_refined_type}})
|
||||||
|
property_stack.append({})
|
||||||
|
name_stack.append(last_name)
|
||||||
|
elif left.endswith('{'):
|
||||||
|
object_stack.append({'type': 'object'})
|
||||||
|
property_stack.append({})
|
||||||
|
name_stack.append(last_name)
|
||||||
|
elif (left.endswith(']') and '[' not in left) or (left.endswith('}') and '{' not in left):
|
||||||
|
obj = object_stack.pop()
|
||||||
|
prop = property_stack.pop()
|
||||||
|
name = name_stack.pop()
|
||||||
|
if len(prop) > 0:
|
||||||
|
if 'items' in obj:
|
||||||
|
obj['items']['properties'] = prop
|
||||||
|
else:
|
||||||
|
obj['properties'] = prop
|
||||||
|
if len(property_stack) > 0:
|
||||||
|
if 'items' in object_stack[-1]:
|
||||||
|
object_stack[-1]['items']['type'] = obj['type']
|
||||||
|
if len(prop) > 0:
|
||||||
|
object_stack[-1]['items']['properties'] = prop
|
||||||
|
else:
|
||||||
|
if name is None:
|
||||||
|
raise RuntimeError('Not expected')
|
||||||
|
property_stack[-1][name] = obj
|
||||||
|
else:
|
||||||
|
ret = obj
|
||||||
|
if ret is not None:
|
||||||
|
if i + 1 < len(lines) - 1:
|
||||||
|
print('Ignoring this data (below the parsed object): ' + "\n".join(lines[i+1:]), file=sys.stderr)
|
||||||
|
return ret
|
||||||
|
except Exception as e:
|
||||||
|
print('Exception: ' + str(e), file=sys.stderr)
|
||||||
|
print('Unable to cope with: ' + '\n'.join(lines), file=sys.stderr)
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def get_type(arg_type: str, full_line: str):
|
||||||
|
if arg_type is None:
|
||||||
|
return 'string', True, None
|
||||||
|
|
||||||
|
required = 'required' in arg_type or 'optional' not in arg_type
|
||||||
|
|
||||||
|
arg_type = arg_type.lower()
|
||||||
|
if 'array' in arg_type:
|
||||||
|
return 'array', required, None
|
||||||
|
if 'numeric' in arg_type:
|
||||||
|
return 'number', required, None
|
||||||
|
if 'bool' in arg_type:
|
||||||
|
return 'boolean', required, None
|
||||||
|
if 'string' in arg_type:
|
||||||
|
return 'string', required, None
|
||||||
|
if 'object' in arg_type:
|
||||||
|
properties = get_obj_from_dirty_text(full_line) if full_line is not None else None
|
||||||
|
return 'object', required, properties
|
||||||
|
|
||||||
|
print('Unable to derive type from: ' + arg_type, file=sys.stderr)
|
||||||
|
return None, False, None
|
||||||
|
|
||||||
|
|
||||||
|
def get_default(arg_refined_type: str, arg_type: str):
|
||||||
|
if 'default=' in arg_type:
|
||||||
|
if 'number' in arg_refined_type:
|
||||||
|
return int(re.match('.*default=([^,)]+)', arg_type).group(1))
|
||||||
|
if 'string' in arg_refined_type:
|
||||||
|
return re.match('.*default=([^,)]+)', arg_type).group(1)
|
||||||
|
if 'boolean' in arg_refined_type:
|
||||||
|
if 'default=true' in arg_type:
|
||||||
|
return True
|
||||||
|
if 'default=false' in arg_type:
|
||||||
|
return False
|
||||||
|
raise NotImplementedError('Not implemented: ' + arg_type)
|
||||||
|
if 'array' in arg_type:
|
||||||
|
raise NotImplementedError('Not implemented: ' + arg_type)
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def parse_single_argument(line: str):
|
||||||
|
if line:
|
||||||
|
line = line.strip()
|
||||||
|
if not line or line.startswith('None'):
|
||||||
|
return None, None, False
|
||||||
|
|
||||||
|
arg_parsed = re_argline.fullmatch(line)
|
||||||
|
if arg_parsed is None:
|
||||||
|
if line.startswith('{') or line.startswith('['):
|
||||||
|
return get_obj_from_dirty_text(line), None, True
|
||||||
|
else:
|
||||||
|
print("Unparsable argument: " + line, file=sys.stderr)
|
||||||
|
descriptor = {
|
||||||
|
'type': 'array' if line.startswith('[') else 'object',
|
||||||
|
'description': line,
|
||||||
|
}
|
||||||
|
return descriptor, None, True
|
||||||
|
|
||||||
|
arg_name, arg_type, arg_desc = arg_parsed.group('name', 'type', 'desc')
|
||||||
|
if not arg_type:
|
||||||
|
raise NotImplementedError('Not implemented: ' + arg_type)
|
||||||
|
arg_refined_type, arg_required, arg_properties = get_type(arg_type, arg_desc)
|
||||||
|
|
||||||
|
if arg_properties is not None:
|
||||||
|
return arg_properties, arg_name, arg_required
|
||||||
|
|
||||||
|
arg_refined_default = get_default(arg_refined_type, arg_type)
|
||||||
|
arg_desc = re.sub('\s+', ' ', arg_desc.strip()) \
|
||||||
|
if arg_desc and arg_refined_type is not 'object' and arg_refined_type is not 'array' \
|
||||||
|
else arg_desc.strip() if arg_desc else ''
|
||||||
|
|
||||||
|
descriptor = {
|
||||||
|
'type': arg_refined_type,
|
||||||
|
'description': arg_desc,
|
||||||
|
}
|
||||||
|
if arg_refined_default is not None:
|
||||||
|
descriptor['default'] = arg_refined_default
|
||||||
|
return descriptor, arg_name, arg_required
|
||||||
|
|
||||||
|
|
||||||
|
def parse_params(args: str):
|
||||||
|
arguments = {}
|
||||||
|
requireds = []
|
||||||
|
if args:
|
||||||
|
for line in re.split('\s*\d+\.\s+', args, re.DOTALL):
|
||||||
|
descriptor, name, required = parse_single_argument(line)
|
||||||
|
if descriptor is None:
|
||||||
|
continue
|
||||||
|
if required:
|
||||||
|
requireds.append(name)
|
||||||
|
arguments[name] = descriptor
|
||||||
|
return arguments, requireds
|
||||||
|
|
||||||
|
|
||||||
|
def get_api(section_name: str, command: str, command_help: str):
|
||||||
|
|
||||||
|
parsed = re_full.fullmatch(command_help)
|
||||||
|
if parsed is None:
|
||||||
|
raise RuntimeError('Unable to resolve help format for ' + command)
|
||||||
|
|
||||||
|
name, desc, args, resl, exmp = parsed.group('name', 'desc', 'args', 'resl', 'exmp')
|
||||||
|
|
||||||
|
properties, required = parse_params(args)
|
||||||
|
result_descriptor, result_name, result_required = parse_single_argument(resl)
|
||||||
|
|
||||||
|
desc = re.sub('\s+', ' ', desc.strip()) if desc else name
|
||||||
|
example_array = exmp.splitlines() if exmp else []
|
||||||
|
|
||||||
|
ret = {
|
||||||
|
'summary': desc,
|
||||||
|
'description': example_array,
|
||||||
|
'tags': [section_name],
|
||||||
|
'params': {
|
||||||
|
'type': 'object',
|
||||||
|
'properties': properties,
|
||||||
|
'required': required
|
||||||
|
},
|
||||||
|
}
|
||||||
|
if result_descriptor is not None:
|
||||||
|
ret['result'] = result_descriptor
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
def write_api():
|
||||||
|
if len(sys.argv) < 2:
|
||||||
|
print("Missing required argument: <path to CLI tool>", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
cli_tool = sys.argv[1]
|
||||||
|
result = sp.run([cli_tool, "help"], stdout=sp.PIPE, universal_newlines=True)
|
||||||
|
commands = result.stdout
|
||||||
|
sections = re.split('^==\s*(.*?)\s*==$', commands, flags=re.MULTILINE)
|
||||||
|
methods = {}
|
||||||
|
for section in sections:
|
||||||
|
if not section:
|
||||||
|
continue
|
||||||
|
lines = section.splitlines()
|
||||||
|
if len(lines) == 1:
|
||||||
|
section_name = lines[0]
|
||||||
|
continue
|
||||||
|
for command in sorted(lines[1:]):
|
||||||
|
if not command:
|
||||||
|
continue
|
||||||
|
command = command.split(' ')[0]
|
||||||
|
result = sp.run([cli_tool, "help", command], stdout=sp.PIPE, universal_newlines=True)
|
||||||
|
methods[command] = get_api(section_name, command, result.stdout)
|
||||||
|
|
||||||
|
version = sp.run([cli_tool, "--version"], stdout=sp.PIPE, universal_newlines=True)
|
||||||
|
wrapper = {
|
||||||
|
'$schema': 'https://rawgit.com/mzernetsch/jrgen/master/jrgen-spec.schema.json',
|
||||||
|
'jrgen': '1.1',
|
||||||
|
'jsonrpc': '1.0', # see https://github.com/bitcoin/bitcoin/pull/12435
|
||||||
|
'info': {
|
||||||
|
'title': 'lbrycrd RPC API',
|
||||||
|
'version': version.stdout.strip(),
|
||||||
|
'description': []
|
||||||
|
},
|
||||||
|
'definitions': {}, # for items used in $ref further down
|
||||||
|
'methods': methods,
|
||||||
|
}
|
||||||
|
|
||||||
|
schema = req.urlopen(wrapper['$schema']).read().decode('utf-8')
|
||||||
|
try:
|
||||||
|
jsonschema.validate(wrapper, schema)
|
||||||
|
except Exception as e:
|
||||||
|
print('From schema validation: ' + str(e), file=sys.stderr)
|
||||||
|
|
||||||
|
print(json.dumps(wrapper, indent=4))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
write_api()
|
129
contrib/devtools/generate_json_api_v1.py
Executable file
129
contrib/devtools/generate_json_api_v1.py
Executable file
|
@ -0,0 +1,129 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import re
|
||||||
|
import subprocess as sp
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
|
||||||
|
re_full = re.compile(r'(?P<name>^.*?$)(?P<desc>.*?)(^Argument.*?$(?P<args>.*?))?(^Result[^\n]*?:\s*$(?P<resl>.*?))?(^Exampl.*?$(?P<exmp>.*))?', re.DOTALL | re.MULTILINE)
|
||||||
|
re_argline = re.compile(r'^("?)(?P<name>.*?)\1\s+\((?P<type>.*?)\)\s*(?P<desc>.*)$', re.DOTALL)
|
||||||
|
|
||||||
|
|
||||||
|
def get_type(arg_type, full_line):
|
||||||
|
if arg_type is None:
|
||||||
|
return 'string'
|
||||||
|
|
||||||
|
arg_type = arg_type.lower()
|
||||||
|
if 'numeric' in arg_type:
|
||||||
|
return 'number'
|
||||||
|
if 'bool' in arg_type:
|
||||||
|
return 'boolean'
|
||||||
|
if 'string' in arg_type:
|
||||||
|
return 'string'
|
||||||
|
if 'object' in arg_type:
|
||||||
|
return 'object'
|
||||||
|
|
||||||
|
raise Exception('Not implemented: ' + arg_type)
|
||||||
|
|
||||||
|
|
||||||
|
def parse_params(args):
|
||||||
|
arguments = []
|
||||||
|
if args:
|
||||||
|
for line in re.split('\s*\d+\.\s+', args, re.DOTALL):
|
||||||
|
if not line or not line.strip() or line.strip().startswith('None'):
|
||||||
|
continue
|
||||||
|
arg_parsed = re_argline.fullmatch(line)
|
||||||
|
if arg_parsed is None:
|
||||||
|
raise Exception("Unparsable argument: " + line)
|
||||||
|
arg_name, arg_type, arg_desc = arg_parsed.group('name', 'type', 'desc')
|
||||||
|
if not arg_type:
|
||||||
|
raise Exception('Not implemented: ' + arg_type)
|
||||||
|
arg_required = 'required' in arg_type or 'optional' not in arg_type
|
||||||
|
arg_refined_type = get_type(arg_type, line)
|
||||||
|
arg_desc = re.sub('\s+', ' ', arg_desc.strip()) if arg_desc else []
|
||||||
|
arguments.append({
|
||||||
|
'name': arg_name,
|
||||||
|
'type': arg_refined_type,
|
||||||
|
'description': arg_desc,
|
||||||
|
'is_required': arg_required
|
||||||
|
})
|
||||||
|
return arguments
|
||||||
|
|
||||||
|
|
||||||
|
def process_examples(examples: str):
|
||||||
|
if not examples:
|
||||||
|
return []
|
||||||
|
examples = examples.strip()
|
||||||
|
splits = examples.split('\n')
|
||||||
|
result = []
|
||||||
|
inner = {}
|
||||||
|
for s in splits:
|
||||||
|
if not s:
|
||||||
|
continue
|
||||||
|
if '> curl' in s:
|
||||||
|
inner['curl'] = s.strip()
|
||||||
|
elif '> lbrycrd' in s:
|
||||||
|
inner['cli'] = s.strip()
|
||||||
|
else:
|
||||||
|
if 'title' in inner:
|
||||||
|
result.append(inner)
|
||||||
|
inner = {}
|
||||||
|
inner['title'] = s.strip()
|
||||||
|
result.append(inner)
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def get_api(section_name, command, command_help):
|
||||||
|
|
||||||
|
parsed = re_full.fullmatch(command_help)
|
||||||
|
if parsed is None:
|
||||||
|
raise Exception('Unable to resolve help format for ' + command)
|
||||||
|
|
||||||
|
name, desc, args, resl, exmp = parsed.group('name', 'desc', 'args', 'resl', 'exmp')
|
||||||
|
|
||||||
|
arguments = parse_params(args)
|
||||||
|
|
||||||
|
cmd_desc = re.sub('\s+', ' ', desc.strip()) if desc else ''
|
||||||
|
examp_desc = process_examples(exmp)
|
||||||
|
cmd_resl = resl.strip() if resl else None
|
||||||
|
|
||||||
|
ret = {
|
||||||
|
'name': command,
|
||||||
|
'namespace': section_name,
|
||||||
|
'description': cmd_desc,
|
||||||
|
'arguments': arguments,
|
||||||
|
'examples': examp_desc
|
||||||
|
}
|
||||||
|
if cmd_resl is not None:
|
||||||
|
ret['returns'] = cmd_resl
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
def write_api():
|
||||||
|
if len(sys.argv) < 2:
|
||||||
|
print("Missing required argument: <path to CLI tool>", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
cli_tool = sys.argv[1]
|
||||||
|
result = sp.run([cli_tool, "help"], stdout=sp.PIPE, universal_newlines=True)
|
||||||
|
commands = result.stdout
|
||||||
|
sections = re.split('^==\s*(.*?)\s*==$', commands, flags=re.MULTILINE)
|
||||||
|
apis = []
|
||||||
|
for section in sections:
|
||||||
|
if not section:
|
||||||
|
continue
|
||||||
|
lines = section.splitlines()
|
||||||
|
if len(lines) == 1:
|
||||||
|
section_name = lines[0]
|
||||||
|
continue
|
||||||
|
for command in sorted(lines[1:]):
|
||||||
|
if not command:
|
||||||
|
continue
|
||||||
|
command = command.split(' ')[0]
|
||||||
|
result = sp.run([cli_tool, "help", command], stdout=sp.PIPE, universal_newlines=True)
|
||||||
|
apis.append(get_api(section_name, command, result.stdout))
|
||||||
|
|
||||||
|
print(json.dumps(apis, indent=4))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
write_api()
|
5118
contrib/devtools/generated/api_jrgen.json
Normal file
5118
contrib/devtools/generated/api_jrgen.json
Normal file
File diff suppressed because it is too large
Load diff
2655
contrib/devtools/generated/api_v1.json
Normal file
2655
contrib/devtools/generated/api_v1.json
Normal file
File diff suppressed because it is too large
Load diff
20
contrib/patches/atomic.patch
Normal file
20
contrib/patches/atomic.patch
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
--- src/dbinc/atomic.h 2013-03-12 14:07:22.000000000 -0400
|
||||||
|
+++ src/dbinc/atomic.h.change 2013-03-12 14:06:35.000000000 -0400
|
||||||
|
@@ -144,7 +144,7 @@
|
||||||
|
#define atomic_inc(env, p) __atomic_inc(p)
|
||||||
|
#define atomic_dec(env, p) __atomic_dec(p)
|
||||||
|
#define atomic_compare_exchange(env, p, o, n) \
|
||||||
|
- __atomic_compare_exchange((p), (o), (n))
|
||||||
|
+ __atomic_compare_exchange_db((p), (o), (n))
|
||||||
|
static inline int __atomic_inc(db_atomic_t *p)
|
||||||
|
{
|
||||||
|
int temp;
|
||||||
|
@@ -176,7 +176,7 @@
|
||||||
|
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
|
||||||
|
* which configure could be changed to use.
|
||||||
|
*/
|
||||||
|
-static inline int __atomic_compare_exchange(
|
||||||
|
+static inline int __atomic_compare_exchange_db(
|
||||||
|
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
|
||||||
|
{
|
||||||
|
atomic_value_t was;
|
3
depends/.gitignore
vendored
3
depends/.gitignore
vendored
|
@ -7,6 +7,3 @@ x86_64*
|
||||||
i686*
|
i686*
|
||||||
mips*
|
mips*
|
||||||
arm*
|
arm*
|
||||||
aarch64*
|
|
||||||
riscv32*
|
|
||||||
riscv64*
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
.NOTPARALLEL :
|
.NOTPARALLEL :
|
||||||
|
|
||||||
SOURCES_PATH ?= $(BASEDIR)/sources
|
SOURCES_PATH ?= $(BASEDIR)/sources
|
||||||
WORK_PATH = $(BASEDIR)/work
|
|
||||||
BASE_CACHE ?= $(BASEDIR)/built
|
BASE_CACHE ?= $(BASEDIR)/built
|
||||||
SDK_PATH ?= $(BASEDIR)/SDKs
|
SDK_PATH ?= $(BASEDIR)/SDKs
|
||||||
NO_QT ?=
|
NO_QT ?=
|
||||||
NO_WALLET ?=
|
NO_WALLET ?=
|
||||||
NO_UPNP ?=
|
NO_UPNP ?=
|
||||||
|
ICU_DIR ?=
|
||||||
|
ICU_ONLY ?=
|
||||||
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
|
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
|
||||||
|
|
||||||
BUILD = $(shell ./config.guess)
|
BUILD = $(shell ./config.guess)
|
||||||
|
@ -22,6 +23,7 @@ BUILD_ID_SALT ?= salt
|
||||||
host:=$(BUILD)
|
host:=$(BUILD)
|
||||||
ifneq ($(HOST),)
|
ifneq ($(HOST),)
|
||||||
host:=$(HOST)
|
host:=$(HOST)
|
||||||
|
host_toolchain:=$(HOST)-
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(DEBUG),)
|
ifneq ($(DEBUG),)
|
||||||
|
@ -30,9 +32,9 @@ else
|
||||||
release_type=release
|
release_type=release
|
||||||
endif
|
endif
|
||||||
|
|
||||||
base_build_dir=$(WORK_PATH)/build
|
base_build_dir=$(BASEDIR)/work/build
|
||||||
base_staging_dir=$(WORK_PATH)/staging
|
base_staging_dir=$(BASEDIR)/work/staging
|
||||||
base_download_dir=$(WORK_PATH)/download
|
base_download_dir=$(BASEDIR)/work/download
|
||||||
canonical_host:=$(shell ./config.sub $(HOST))
|
canonical_host:=$(shell ./config.sub $(HOST))
|
||||||
build:=$(shell ./config.sub $(BUILD))
|
build:=$(shell ./config.sub $(BUILD))
|
||||||
|
|
||||||
|
@ -73,7 +75,11 @@ include hosts/$(host_os).mk
|
||||||
include hosts/default.mk
|
include hosts/default.mk
|
||||||
include builders/$(build_os).mk
|
include builders/$(build_os).mk
|
||||||
include builders/default.mk
|
include builders/default.mk
|
||||||
|
ifeq ($(ICU_ONLY),)
|
||||||
include packages/packages.mk
|
include packages/packages.mk
|
||||||
|
else
|
||||||
|
include packages/packages.icu.mk
|
||||||
|
endif
|
||||||
|
|
||||||
build_id_string:=$(BUILD_ID_SALT)
|
build_id_string:=$(BUILD_ID_SALT)
|
||||||
build_id_string+=$(shell $(build_CC) --version 2>/dev/null)
|
build_id_string+=$(shell $(build_CC) --version 2>/dev/null)
|
||||||
|
@ -89,17 +95,14 @@ $(host_arch)_$(host_os)_id_string+=$(shell $(host_CXX) --version 2>/dev/null)
|
||||||
$(host_arch)_$(host_os)_id_string+=$(shell $(host_RANLIB) --version 2>/dev/null)
|
$(host_arch)_$(host_os)_id_string+=$(shell $(host_RANLIB) --version 2>/dev/null)
|
||||||
$(host_arch)_$(host_os)_id_string+=$(shell $(host_STRIP) --version 2>/dev/null)
|
$(host_arch)_$(host_os)_id_string+=$(shell $(host_STRIP) --version 2>/dev/null)
|
||||||
|
|
||||||
qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages)
|
qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages)
|
||||||
|
qt_native_packages_$(NO_QT) = $(qt_native_packages)
|
||||||
wallet_packages_$(NO_WALLET) = $(wallet_packages)
|
wallet_packages_$(NO_WALLET) = $(wallet_packages)
|
||||||
upnp_packages_$(NO_UPNP) = $(upnp_packages)
|
upnp_packages_$(NO_UPNP) = $(upnp_packages)
|
||||||
|
|
||||||
packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_)
|
packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_)
|
||||||
native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)
|
$(info $$packages is [${packages}])
|
||||||
|
native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) $(qt_native_packages_)
|
||||||
ifneq ($(qt_packages_),)
|
|
||||||
native_packages += $(qt_native_packages)
|
|
||||||
endif
|
|
||||||
|
|
||||||
all_packages = $(packages) $(native_packages)
|
all_packages = $(packages) $(native_packages)
|
||||||
|
|
||||||
meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk
|
meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk
|
||||||
|
@ -134,8 +137,8 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
|
||||||
-e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
|
-e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
|
||||||
-e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
|
-e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
|
||||||
-e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
|
-e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
|
||||||
-e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
|
|
||||||
-e 's|@no_qt@|$(NO_QT)|' \
|
-e 's|@no_qt@|$(NO_QT)|' \
|
||||||
|
-e 's|@ICU_DIR@|$(ICU_DIR)|' \
|
||||||
-e 's|@no_wallet@|$(NO_WALLET)|' \
|
-e 's|@no_wallet@|$(NO_WALLET)|' \
|
||||||
-e 's|@no_upnp@|$(NO_UPNP)|' \
|
-e 's|@no_upnp@|$(NO_UPNP)|' \
|
||||||
-e 's|@debug@|$(DEBUG)|' \
|
-e 's|@debug@|$(DEBUG)|' \
|
||||||
|
@ -166,23 +169,17 @@ $(host_prefix)/share/config.site: check-packages
|
||||||
|
|
||||||
check-packages: check-sources
|
check-packages: check-sources
|
||||||
|
|
||||||
clean-all: clean
|
|
||||||
@rm -rf $(SOURCES_PATH) x86_64* i686* mips* arm* aarch64* riscv32* riscv64*
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@rm -rf $(WORK_PATH) $(BASE_CACHE) $(BUILD)
|
|
||||||
|
|
||||||
install: check-packages $(host_prefix)/share/config.site
|
install: check-packages $(host_prefix)/share/config.site
|
||||||
|
|
||||||
|
|
||||||
download-one: check-sources $(all_sources)
|
download-one: check-sources $(all_sources)
|
||||||
|
|
||||||
download-osx:
|
download-osx:
|
||||||
@$(MAKE) -s HOST=x86_64-apple-darwin14 download-one
|
@$(MAKE) -s HOST=x86_64-apple-darwin11 download-one
|
||||||
download-linux:
|
download-linux:
|
||||||
@$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one
|
@$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one
|
||||||
download-win:
|
download-win:
|
||||||
@$(MAKE) -s HOST=x86_64-w64-mingw32 download-one
|
@$(MAKE) -s HOST=x86_64-w64-mingw32 download-one
|
||||||
download: download-osx download-linux download-win
|
download: download-osx download-linux download-win
|
||||||
|
|
||||||
.PHONY: install cached clean clean-all download-one download-osx download-linux download-win download check-packages check-sources
|
.PHONY: install cached download-one download-osx download-linux download-win download check-packages check-sources
|
||||||
|
|
|
@ -22,42 +22,17 @@ Common `host-platform-triplets` for cross compilation are:
|
||||||
|
|
||||||
- `i686-w64-mingw32` for Win32
|
- `i686-w64-mingw32` for Win32
|
||||||
- `x86_64-w64-mingw32` for Win64
|
- `x86_64-w64-mingw32` for Win64
|
||||||
- `x86_64-apple-darwin14` for macOS
|
- `x86_64-apple-darwin11` for MacOSX
|
||||||
- `arm-linux-gnueabihf` for Linux ARM 32 bit
|
- `arm-linux-gnueabihf` for Linux ARM
|
||||||
- `aarch64-linux-gnu` for Linux ARM 64 bit
|
|
||||||
- `riscv32-linux-gnu` for Linux RISC-V 32 bit
|
|
||||||
- `riscv64-linux-gnu` for Linux RISC-V 64 bit
|
|
||||||
|
|
||||||
No other options are needed, the paths are automatically configured.
|
No other options are needed, the paths are automatically configured.
|
||||||
|
|
||||||
Install the required dependencies: Ubuntu & Debian
|
|
||||||
--------------------------------------------------
|
|
||||||
|
|
||||||
For macOS cross compilation:
|
|
||||||
|
|
||||||
sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python-setuptools
|
|
||||||
|
|
||||||
For Win32/Win64 cross compilation:
|
|
||||||
|
|
||||||
- see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux)
|
|
||||||
|
|
||||||
For linux (including i386, ARM) cross compilation:
|
|
||||||
|
|
||||||
sudo apt-get install curl g++-aarch64-linux-gnu g++-4.8-aarch64-linux-gnu gcc-4.8-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-arm-linux-gnueabihf g++-4.8-arm-linux-gnueabihf gcc-4.8-arm-linux-gnueabihf binutils-arm-linux-gnueabihf g++-4.8-multilib gcc-4.8-multilib binutils-gold bsdmainutils
|
|
||||||
|
|
||||||
For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit):
|
|
||||||
|
|
||||||
sudo apt-get install curl g++-riscv64-linux-gnu binutils-riscv64-linux-gnu
|
|
||||||
|
|
||||||
RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken `test_bitcoin` executable (see https://github.com/bitcoin/bitcoin/pull/13543),
|
|
||||||
this is apparently fixed in gcc-8.1.0.
|
|
||||||
|
|
||||||
Dependency Options:
|
Dependency Options:
|
||||||
The following can be set when running make: make FOO=bar
|
The following can be set when running make: make FOO=bar
|
||||||
|
|
||||||
SOURCES_PATH: downloaded sources will be placed here
|
SOURCES_PATH: downloaded sources will be placed here
|
||||||
BASE_CACHE: built packages will be placed here
|
BASE_CACHE: built packages will be placed here
|
||||||
SDK_PATH: Path where sdk's can be found (used by macOS)
|
SDK_PATH: Path where sdk's can be found (used by OSX)
|
||||||
FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up
|
FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up
|
||||||
NO_QT: Don't download/build/cache qt and its dependencies
|
NO_QT: Don't download/build/cache qt and its dependencies
|
||||||
NO_WALLET: Don't download/build/cache libs needed to enable the wallet
|
NO_WALLET: Don't download/build/cache libs needed to enable the wallet
|
||||||
|
@ -72,7 +47,7 @@ options will be passed to bitcoin's configure. In this case, `--disable-wallet`.
|
||||||
Additional targets:
|
Additional targets:
|
||||||
|
|
||||||
download: run 'make download' to fetch all sources without building them
|
download: run 'make download' to fetch all sources without building them
|
||||||
download-osx: run 'make download-osx' to fetch all sources needed for macOS builds
|
download-osx: run 'make download-osx' to fetch all sources needed for osx builds
|
||||||
download-win: run 'make download-win' to fetch all sources needed for win builds
|
download-win: run 'make download-win' to fetch all sources needed for win builds
|
||||||
download-linux: run 'make download-linux' to fetch all sources needed for linux builds
|
download-linux: run 'make download-linux' to fetch all sources needed for linux builds
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
build_darwin_CC:=$(shell xcrun -f clang)
|
build_darwin_CC: = $(shell xcrun -f clang)
|
||||||
build_darwin_CXX:=$(shell xcrun -f clang++)
|
build_darwin_CXX: = $(shell xcrun -f clang++)
|
||||||
build_darwin_AR:=$(shell xcrun -f ar)
|
build_darwin_AR: = $(shell xcrun -f ar)
|
||||||
build_darwin_RANLIB:=$(shell xcrun -f ranlib)
|
build_darwin_RANLIB: = $(shell xcrun -f ranlib)
|
||||||
build_darwin_STRIP:=$(shell xcrun -f strip)
|
build_darwin_STRIP: = $(shell xcrun -f strip)
|
||||||
build_darwin_OTOOL:=$(shell xcrun -f otool)
|
build_darwin_OTOOL: = $(shell xcrun -f otool)
|
||||||
build_darwin_NM:=$(shell xcrun -f nm)
|
build_darwin_NM: = $(shell xcrun -f nm)
|
||||||
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
|
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
|
||||||
build_darwin_SHA256SUM=shasum -a 256
|
build_darwin_SHA256SUM = shasum -a 256
|
||||||
build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
|
build_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
|
||||||
|
|
||||||
#darwin host on darwin builder. overrides darwin host preferences.
|
#darwin host on darwin builder. overrides darwin host preferences.
|
||||||
darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION)
|
darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION)
|
||||||
darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++
|
darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION)
|
||||||
darwin_AR:=$(shell xcrun -f ar)
|
darwin_AR:=$(shell xcrun -f ar)
|
||||||
darwin_RANLIB:=$(shell xcrun -f ranlib)
|
darwin_RANLIB:=$(shell xcrun -f ranlib)
|
||||||
darwin_STRIP:=$(shell xcrun -f strip)
|
darwin_STRIP:=$(shell xcrun -f strip)
|
||||||
|
|
609
depends/config.guess
vendored
609
depends/config.guess
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,25 +1,27 @@
|
||||||
depends_prefix="`dirname ${ac_site_file}`/.."
|
|
||||||
|
|
||||||
cross_compiling=maybe
|
cross_compiling=maybe
|
||||||
host_alias=@HOST@
|
host_alias=@HOST@
|
||||||
ac_tool_prefix=${host_alias}-
|
ac_tool_prefix=${host_alias}-
|
||||||
|
|
||||||
if test -z $with_boost; then
|
if test -z $with_boost; then
|
||||||
with_boost=$depends_prefix
|
with_boost=$prefix
|
||||||
fi
|
fi
|
||||||
if test -z $with_qt_plugindir; then
|
if test -z $with_qt_plugindir; then
|
||||||
with_qt_plugindir=$depends_prefix/plugins
|
with_qt_plugindir=$prefix/plugins
|
||||||
fi
|
fi
|
||||||
if test -z $with_qt_translationdir; then
|
if test -z $with_qt_translationdir; then
|
||||||
with_qt_translationdir=$depends_prefix/translations
|
with_qt_translationdir=$prefix/translations
|
||||||
fi
|
fi
|
||||||
if test -z $with_qt_bindir && test -z "@no_qt@"; then
|
if test -z $with_qt_bindir; then
|
||||||
with_qt_bindir=$depends_prefix/native/bin
|
with_qt_bindir=$prefix/native/bin
|
||||||
fi
|
fi
|
||||||
if test -z $with_protoc_bindir && test -z "@no_qt@"; then
|
if test -z $with_protoc_bindir; then
|
||||||
with_protoc_bindir=$depends_prefix/native/bin
|
with_protoc_bindir=$prefix/native/bin
|
||||||
|
fi
|
||||||
|
if test -z $with_comparison_tool; then
|
||||||
|
with_comparison_tool=$prefix/native/share/BitcoindComparisonTool_jar/BitcoindComparisonTool.jar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
with_icu_dir=@icu_dir@
|
||||||
|
|
||||||
if test -z $enable_wallet && test -n "@no_wallet@"; then
|
if test -z $enable_wallet && test -n "@no_wallet@"; then
|
||||||
enable_wallet=no
|
enable_wallet=no
|
||||||
|
@ -40,31 +42,32 @@ fi
|
||||||
|
|
||||||
if test x@host_os@ = xmingw32; then
|
if test x@host_os@ = xmingw32; then
|
||||||
if test -z $with_qt_incdir; then
|
if test -z $with_qt_incdir; then
|
||||||
with_qt_incdir=$depends_prefix/include
|
with_qt_incdir=$prefix/include
|
||||||
fi
|
fi
|
||||||
if test -z $with_qt_libdir; then
|
if test -z $with_qt_libdir; then
|
||||||
with_qt_libdir=$depends_prefix/lib
|
with_qt_libdir=$prefix/lib
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PATH=$depends_prefix/native/bin:$PATH
|
PATH=$prefix/native/bin:$PATH
|
||||||
PKG_CONFIG="`which pkg-config` --static"
|
PKG_CONFIG="`which pkg-config` --static"
|
||||||
|
|
||||||
# These two need to remain exported because pkg-config does not see them
|
# These two need to remain exported because pkg-config does not see them
|
||||||
# otherwise. That means they must be unexported at the end of configure.ac to
|
# otherwise. That means they must be unexported at the end of configure.ac to
|
||||||
# avoid ruining the cache. Sigh.
|
# avoid ruining the cache. Sigh.
|
||||||
export PKG_CONFIG_PATH=$depends_prefix/share/pkgconfig:$depends_prefix/lib/pkgconfig
|
|
||||||
if test -z "@allow_host_packages@"; then
|
|
||||||
export PKGCONFIG_LIBDIR=
|
|
||||||
fi
|
|
||||||
|
|
||||||
CPPFLAGS="-I$depends_prefix/include/ $CPPFLAGS"
|
export PKG_CONFIG_LIBDIR=$prefix/lib/pkgconfig
|
||||||
LDFLAGS="-L$depends_prefix/lib $LDFLAGS"
|
export PKG_CONFIG_PATH=$prefix/share/pkgconfig
|
||||||
|
|
||||||
|
CPPFLAGS="-I$prefix/include/ $CPPFLAGS"
|
||||||
|
LDFLAGS="-L$prefix/lib $LDFLAGS"
|
||||||
|
|
||||||
CC="@CC@"
|
CC="@CC@"
|
||||||
CXX="@CXX@"
|
CXX="@CXX@"
|
||||||
OBJC="${CC}"
|
OBJC="${CC}"
|
||||||
PYTHONPATH=$depends_prefix/native/lib/python/dist-packages:$PYTHONPATH
|
OBJCXX="${CXX}"
|
||||||
|
CCACHE=$prefix/native/bin/ccache
|
||||||
|
PYTHONPATH=$prefix/native/lib/python/dist-packages:$PYTHONPATH
|
||||||
|
|
||||||
if test -n "@AR@"; then
|
if test -n "@AR@"; then
|
||||||
AR=@AR@
|
AR=@AR@
|
||||||
|
@ -97,3 +100,6 @@ fi
|
||||||
if test -n "@LDFLAGS@"; then
|
if test -n "@LDFLAGS@"; then
|
||||||
LDFLAGS="@LDFLAGS@ $LDFLAGS"
|
LDFLAGS="@LDFLAGS@ $LDFLAGS"
|
||||||
fi
|
fi
|
||||||
|
if test -n "@ICU_DIR@"; then
|
||||||
|
ICU_DIR="@ICU_DIR@"
|
||||||
|
fi
|
||||||
|
|
1669
depends/config.sub
vendored
1669
depends/config.sub
vendored
File diff suppressed because it is too large
Load diff
|
@ -7,7 +7,7 @@ In theory, binaries for any target OS/architecture can be created, from a
|
||||||
builder running any OS/architecture. In practice, build-side tools must be
|
builder running any OS/architecture. In practice, build-side tools must be
|
||||||
specified when the defaults don't fit, and packages must be amended to work
|
specified when the defaults don't fit, and packages must be amended to work
|
||||||
on new hosts. For now, a build architecture of x86_64 is assumed, either on
|
on new hosts. For now, a build architecture of x86_64 is assumed, either on
|
||||||
Linux or macOS.
|
Linux or OSX.
|
||||||
|
|
||||||
### No reliance on timestamps
|
### No reliance on timestamps
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
OSX_MIN_VERSION=10.10
|
OSX_MIN_VERSION=10.7
|
||||||
OSX_SDK_VERSION=10.11
|
OSX_SDK_VERSION=10.9
|
||||||
OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk
|
OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk
|
||||||
LD64_VERSION=253.9
|
LD64_VERSION=241.9
|
||||||
darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
|
darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
|
||||||
darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -stdlib=libc++
|
darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
|
||||||
|
|
||||||
darwin_CFLAGS=-pipe
|
darwin_CFLAGS=-pipe
|
||||||
darwin_CXXFLAGS=$(darwin_CFLAGS)
|
darwin_CXXFLAGS=$(darwin_CFLAGS)
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
ifneq ($(host),$(build))
|
|
||||||
host_toolchain:=$(host)-
|
|
||||||
endif
|
|
||||||
|
|
||||||
default_host_CC = $(host_toolchain)gcc
|
default_host_CC = $(host_toolchain)gcc
|
||||||
default_host_CXX = $(host_toolchain)g++
|
default_host_CXX = $(host_toolchain)g++
|
||||||
default_host_AR = $(host_toolchain)ar
|
default_host_AR = $(host_toolchain)ar
|
||||||
|
|
|
@ -9,13 +9,11 @@ define $(package)_set_vars
|
||||||
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
|
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
|
||||||
$(package)_config_opts_mingw32=--enable-mingw
|
$(package)_config_opts_mingw32=--enable-mingw
|
||||||
$(package)_config_opts_linux=--with-pic
|
$(package)_config_opts_linux=--with-pic
|
||||||
$(package)_cxxflags=-std=c++11
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_preprocess_cmds
|
define $(package)_preprocess_cmds
|
||||||
sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h && \
|
sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h && \
|
||||||
sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c && \
|
sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c
|
||||||
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_config_cmds
|
define $(package)_config_cmds
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
package=boost
|
package=boost
|
||||||
$(package)_version=1_64_0
|
$(package)_version=1_59_0
|
||||||
$(package)_download_path=https://dl.bintray.com/boostorg/release/1.64.0/source/
|
$(package)_download_path=http://sourceforge.net/projects/boost/files/boost/1.59.0
|
||||||
$(package)_file_name=$(package)_$($(package)_version).tar.bz2
|
$(package)_file_name=$(package)_$($(package)_version).tar.bz2
|
||||||
$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332
|
$(package)_sha256_hash=727a932322d94287b62abb1bd2d41723eec4356a7728909e38adb65ca25241ca
|
||||||
|
$(package)_dependencies:icu
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_opts_release=variant=release
|
$(package)_config_opts_release=variant=release
|
||||||
$(package)_config_opts_debug=variant=debug
|
$(package)_config_opts_debug=variant=debug
|
||||||
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
|
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam boost.locale.iconv=off boost.locale.posix=off
|
||||||
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
|
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 -sICU_PATH=$(ICU_DIR)
|
||||||
|
$(package)_config_opts+=-sICU_LINK=-L$(ICU_DIR) -lsicudt -lsicuin -lsicuio -lsicule -lsiculx -lsicutest -lsicutu -lsicuuc
|
||||||
$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
|
$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
|
||||||
$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared
|
$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared
|
||||||
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
|
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
|
||||||
|
@ -19,9 +21,17 @@ $(package)_toolset_$(host_os)=gcc
|
||||||
$(package)_archiver_$(host_os)=$($(package)_ar)
|
$(package)_archiver_$(host_os)=$($(package)_ar)
|
||||||
$(package)_toolset_darwin=darwin
|
$(package)_toolset_darwin=darwin
|
||||||
$(package)_archiver_darwin=$($(package)_libtool)
|
$(package)_archiver_darwin=$($(package)_libtool)
|
||||||
$(package)_config_libraries=chrono,filesystem,system,thread,test
|
$(package)_config_libraries=chrono,filesystem,program_options,system,locale,regex,thread,test
|
||||||
$(package)_cxxflags=-std=c++11 -fvisibility=hidden
|
$(package)_cxxflags=-fvisibility=hidden
|
||||||
$(package)_cxxflags_linux=-fPIC
|
$(package)_cxxflags_linux=-fPIC
|
||||||
|
$(package)_config_env+=BOOST_ICU_ICONV="off"
|
||||||
|
$(package)_config_env+=BOOST_ICU_POSIX="off"
|
||||||
|
$(package)_config_env+=ICU_PREFIX=$(ICU_DIR)
|
||||||
|
$(package)_config_env+=BOOST_ICU_LIBS="-L$(ICU_DIR) -lsicudt -lsicuin -lsicuio -lsicule -lsiculx -lsicutest -lsicutu -lsicuuc"
|
||||||
|
$(package)_build_env+=BOOST_ICU_ICONV="off"
|
||||||
|
$(package)_build_env+=BOOST_ICU_POSIX="off"
|
||||||
|
$(package)_build_env+=ICU_PREFIX=$(ICU_DIR)
|
||||||
|
$(package)_build_env+=BOOST_ICU_LIBS="-L$(ICU_DIR) -lsicudt -lsicuin -lsicuio -lsicule -lsiculx -lsicutest -lsicutu -lsicuuc"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_preprocess_cmds
|
define $(package)_preprocess_cmds
|
||||||
|
@ -29,13 +39,12 @@ define $(package)_preprocess_cmds
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_config_cmds
|
define $(package)_config_cmds
|
||||||
./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries)
|
echo "int main() { return 0; }" > ./libs/locale/build/has_icu_test.cpp && echo "int main() { return 0; }" > ./libs/regex/build/has_icu_test.cpp && echo "ICU INSTALL: $(ICU_DIR)" && echo "BOOST CONFIG LIBRARIES: $(boost_config_libraries)" && ./bootstrap.sh --with-icu=$(ICU_DIR) --with-libraries=$(boost_config_libraries)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
|
ICU_PATH=$(ICU_DIR) ./b2 link=static cxxflags=-fPIC -d0 -q -j12 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_stage_cmds
|
define $(package)_stage_cmds
|
||||||
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
|
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package=dbus
|
package=dbus
|
||||||
$(package)_version=1.10.18
|
$(package)_version=1.8.6
|
||||||
$(package)_download_path=https://dbus.freedesktop.org/releases/dbus
|
$(package)_download_path=http://dbus.freedesktop.org/releases/dbus
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||||
$(package)_sha256_hash=6049ddd5f3f3e2618f615f1faeda0a115104423a7996b7aa73e2f36e38cc514a
|
$(package)_sha256_hash=eded83ca007b719f32761e60fd8b9ffd0f5796a4caf455b01b5a5ef740ebd23f
|
||||||
$(package)_dependencies=expat
|
$(package)_dependencies=expat
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package=expat
|
package=expat
|
||||||
$(package)_version=2.2.5
|
$(package)_version=2.1.0
|
||||||
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_5/
|
$(package)_download_path=http://sourceforge.net/projects/expat/files/expat/$($(package)_version)
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||||
$(package)_sha256_hash=d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
|
$(package)_sha256_hash=823705472f816df21c8f6aa026dd162b280806838bb55b3432b0fb1fcca7eb86
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_opts=--disable-static
|
$(package)_config_opts=--disable-static
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package=fontconfig
|
package=fontconfig
|
||||||
$(package)_version=2.12.1
|
$(package)_version=2.11.1
|
||||||
$(package)_download_path=http://www.freedesktop.org/software/fontconfig/release/
|
$(package)_download_path=http://www.freedesktop.org/software/fontconfig/release/
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||||
$(package)_sha256_hash=b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f7d6c7f3
|
$(package)_sha256_hash=dc62447533bca844463a3c3fd4083b57c90f18a70506e7a9f4936b5a1e516a99
|
||||||
$(package)_dependencies=freetype expat
|
$(package)_dependencies=freetype expat
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
|
@ -13,13 +13,7 @@ define $(package)_config_cmds
|
||||||
$($(package)_autoconf)
|
$($(package)_autoconf)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# 2.12.1 uses CHAR_WIDTH which is reserved and clashes with some glibc versions, but newer versions of fontconfig
|
|
||||||
# have broken makefiles which needlessly attempt to re-generate headers with gperf.
|
|
||||||
# Instead, change all uses of CHAR_WIDTH, and disable the rule that forces header re-generation.
|
|
||||||
# This can be removed once the upstream build is fixed.
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
sed -i 's/CHAR_WIDTH/CHARWIDTH/g' fontconfig/fontconfig.h src/fcobjshash.gperf src/fcobjs.h src/fcobjshash.h && \
|
|
||||||
sed -i 's/fcobjshash.h: fcobjshash.gperf/fcobjshash.h:/' src/Makefile && \
|
|
||||||
$(MAKE)
|
$(MAKE)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package=freetype
|
package=freetype
|
||||||
$(package)_version=2.7.1
|
$(package)_version=2.5.3
|
||||||
$(package)_download_path=http://download.savannah.gnu.org/releases/$(package)
|
$(package)_download_path=http://downloads.sourceforge.net/$(package)
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||||
$(package)_sha256_hash=3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4aa82f88
|
$(package)_sha256_hash=c0848b29d52ef3ca27ad92e08351f023c5e24ce8cea7d8fe69fc96358e65f75e
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_opts=--without-zlib --without-png --disable-static
|
$(package)_config_opts=--without-zlib --without-png --disable-static
|
||||||
|
|
25
depends/packages/icu.mk
Normal file
25
depends/packages/icu.mk
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package=icu
|
||||||
|
$(package)_version=57_1
|
||||||
|
$(package)_download_path=http://download.icu-project.org/files/icu4c/57.1
|
||||||
|
$(package)_file_name=$(package)4c-$($(package)_version)-src.tgz
|
||||||
|
$(package)_sha256_hash=ff8c67cb65949b1e7808f2359f2b80f722697048e90e7cfc382ec1fe229e9581
|
||||||
|
$(package)_build_subdir=source
|
||||||
|
|
||||||
|
define $(package)_set_vars
|
||||||
|
$(package)_config_opts=--enable-debug --disable-release --host=x86_64-w64-mingw32 --with-cross-build=/tmp/icu_staging/icu/source --enable-extras=no --enable-strict=no --enable-static --enable-shared=no --enable-tests=no --enable-samples=no --enable-dyload=no
|
||||||
|
$(package)_config_opts_release=--disable-debug --enable-release
|
||||||
|
$(package)_config_opts_mingw32=--host=x86_64-w64-mingw32
|
||||||
|
$(package)_config_opts_linux=--with-pic
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_config_cmds
|
||||||
|
$($(package)_autoconf)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_build_cmds
|
||||||
|
$(MAKE)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_stage_cmds
|
||||||
|
$(MAKE) DESTDIR=/tmp/icu_install install
|
||||||
|
endef
|
|
@ -1,15 +1,16 @@
|
||||||
package=libevent
|
package=libevent
|
||||||
$(package)_version=2.1.8-stable
|
$(package)_version=2.0.22
|
||||||
$(package)_download_path=https://github.com/libevent/libevent/archive/
|
$(package)_download_path=https://github.com/libevent/libevent/releases/download/release-2.0.22-stable
|
||||||
$(package)_file_name=release-$($(package)_version).tar.gz
|
$(package)_file_name=$(package)-$($(package)_version)-stable.tar.gz
|
||||||
$(package)_sha256_hash=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d
|
$(package)_sha256_hash=71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3
|
||||||
|
$(package)_patches=reuseaddr.patch
|
||||||
|
|
||||||
define $(package)_preprocess_cmds
|
define $(package)_preprocess_cmds
|
||||||
./autogen.sh
|
patch -p1 < $($(package)_patch_dir)/reuseaddr.patch
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples
|
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress
|
||||||
$(package)_config_opts_release=--disable-debug-mode
|
$(package)_config_opts_release=--disable-debug-mode
|
||||||
$(package)_config_opts_linux=--with-pic
|
$(package)_config_opts_linux=--with-pic
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package=miniupnpc
|
package=miniupnpc
|
||||||
$(package)_version=2.0.20180203
|
$(package)_version=1.9.20160209
|
||||||
$(package)_download_path=http://miniupnp.free.fr/files
|
$(package)_download_path=http://miniupnp.free.fr/files
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||||
$(package)_sha256_hash=90dda8c7563ca6cd4a83e23b3c66dbbea89603a1675bfdb852897c2c9cc220b7
|
$(package)_sha256_hash=572171eacc1d72537ce47b6f4571260757ab7bcfdaf54c3a55c7f88594d94b6f
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_build_opts=CC="$($(package)_cc)"
|
$(package)_build_opts=CC="$($(package)_cc)"
|
||||||
$(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)"
|
$(package)_build_opts_darwin=OS=Darwin LIBTOOL="$($(package)_libtool)"
|
||||||
$(package)_build_opts_mingw32=-f Makefile.mingw
|
$(package)_build_opts_mingw32=-f Makefile.mingw
|
||||||
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
|
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package=native_biplist
|
package=native_biplist
|
||||||
$(package)_version=1.0.3
|
$(package)_version=0.9
|
||||||
$(package)_download_path=https://bitbucket.org/wooster/biplist/downloads
|
$(package)_download_path=https://pypi.python.org/packages/source/b/biplist
|
||||||
$(package)_file_name=biplist-$($(package)_version).tar.gz
|
$(package)_file_name=biplist-$($(package)_version).tar.gz
|
||||||
$(package)_sha256_hash=4c0549764c5fe50b28042ec21aa2e14fe1a2224e239a1dae77d9e7f3932aa4c6
|
$(package)_sha256_hash=b57cadfd26e4754efdf89e9e37de87885f9b5c847b2615688ca04adfaf6ca604
|
||||||
$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
|
$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
|
||||||
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
|
|
25
depends/packages/native_ccache.mk
Normal file
25
depends/packages/native_ccache.mk
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package=native_ccache
|
||||||
|
$(package)_version=3.2.4
|
||||||
|
$(package)_download_path=http://samba.org/ftp/ccache
|
||||||
|
$(package)_file_name=ccache-$($(package)_version).tar.bz2
|
||||||
|
$(package)_sha256_hash=ffeb967edb549e67da0bd5f44f729a2022de9fdde65dfd80d2a7204d7f75332e
|
||||||
|
|
||||||
|
define $(package)_set_vars
|
||||||
|
$(package)_config_opts=
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_config_cmds
|
||||||
|
$($(package)_autoconf)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_build_cmds
|
||||||
|
$(MAKE)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_stage_cmds
|
||||||
|
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_postprocess_cmds
|
||||||
|
rm -rf lib include
|
||||||
|
endef
|
|
@ -1,14 +1,14 @@
|
||||||
package=native_cctools
|
package=native_cctools
|
||||||
$(package)_version=807d6fd1be5d2224872e381870c0a75387fe05e6
|
$(package)_version=ee31ae567931c426136c94aad457c7b51d844beb
|
||||||
$(package)_download_path=https://github.com/theuni/cctools-port/archive
|
$(package)_download_path=https://github.com/theuni/cctools-port/archive
|
||||||
$(package)_file_name=$($(package)_version).tar.gz
|
$(package)_file_name=$($(package)_version).tar.gz
|
||||||
$(package)_sha256_hash=a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a
|
$(package)_sha256_hash=ef107e6ab1b3994cb22e14f4f5c59ea0c0b5a988e6b21d42ed9616b018bbcbf9
|
||||||
$(package)_build_subdir=cctools
|
$(package)_build_subdir=cctools
|
||||||
$(package)_clang_version=3.7.1
|
$(package)_clang_version=3.3
|
||||||
$(package)_clang_download_path=http://llvm.org/releases/$($(package)_clang_version)
|
$(package)_clang_download_path=http://llvm.org/releases/$($(package)_clang_version)
|
||||||
$(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz
|
$(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-amd64-Ubuntu-12.04.2.tar.gz
|
||||||
$(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz
|
$(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-amd64-Ubuntu-12.04.2.tar.gz
|
||||||
$(package)_clang_sha256_hash=99b28a6b48e793705228a390471991386daa33a9717cd9ca007fcdde69608fd9
|
$(package)_clang_sha256_hash=60d8f69f032d62ef61bf527857ebb933741ec3352d4d328c5516aa520662dab7
|
||||||
$(package)_extra_sources=$($(package)_clang_file_name)
|
$(package)_extra_sources=$($(package)_clang_file_name)
|
||||||
|
|
||||||
define $(package)_fetch_cmds
|
define $(package)_fetch_cmds
|
||||||
|
@ -23,7 +23,6 @@ define $(package)_extract_cmds
|
||||||
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||||
mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \
|
mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \
|
||||||
tar --strip-components=1 -C toolchain -xf $($(package)_source_dir)/$($(package)_clang_file_name) && \
|
tar --strip-components=1 -C toolchain -xf $($(package)_source_dir)/$($(package)_clang_file_name) && \
|
||||||
rm -f toolchain/lib/libc++abi.so* && \
|
|
||||||
echo "#!/bin/sh" > toolchain/bin/$(host)-dsymutil && \
|
echo "#!/bin/sh" > toolchain/bin/$(host)-dsymutil && \
|
||||||
echo "exit 0" >> toolchain/bin/$(host)-dsymutil && \
|
echo "exit 0" >> toolchain/bin/$(host)-dsymutil && \
|
||||||
chmod +x toolchain/bin/$(host)-dsymutil && \
|
chmod +x toolchain/bin/$(host)-dsymutil && \
|
||||||
|
@ -31,15 +30,14 @@ define $(package)_extract_cmds
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_opts=--target=$(host) --disable-lto-support
|
$(package)_config_opts=--target=$(host) --disable-libuuid
|
||||||
$(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib
|
$(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib
|
||||||
$(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang
|
$(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang
|
||||||
$(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++
|
$(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_preprocess_cmds
|
define $(package)_preprocess_cmds
|
||||||
cd $($(package)_build_subdir); ./autogen.sh && \
|
cd $($(package)_build_subdir); ./autogen.sh
|
||||||
sed -i.old "/define HAVE_PTHREADS/d" ld64/src/ld/InputFiles.h
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_config_cmds
|
define $(package)_config_cmds
|
||||||
|
@ -55,11 +53,10 @@ define $(package)_stage_cmds
|
||||||
cd $($(package)_extract_dir)/toolchain && \
|
cd $($(package)_extract_dir)/toolchain && \
|
||||||
mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include && \
|
mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include && \
|
||||||
mkdir -p $($(package)_staging_prefix_dir)/bin $($(package)_staging_prefix_dir)/include && \
|
mkdir -p $($(package)_staging_prefix_dir)/bin $($(package)_staging_prefix_dir)/include && \
|
||||||
cp bin/clang $($(package)_staging_prefix_dir)/bin/ &&\
|
cp -P bin/clang bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\
|
||||||
cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\
|
|
||||||
cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
|
cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
|
||||||
cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \
|
cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \
|
||||||
cp bin/llvm-dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \
|
cp bin/$(host)-dsymutil $($(package)_staging_prefix_dir)/bin && \
|
||||||
if `test -d include/c++/`; then cp -rf include/c++/ $($(package)_staging_prefix_dir)/include/; fi && \
|
if `test -d include/c++/`; then cp -rf include/c++/ $($(package)_staging_prefix_dir)/include/; fi && \
|
||||||
if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi
|
if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi
|
||||||
endef
|
endef
|
||||||
|
|
21
depends/packages/native_comparisontool.mk
Normal file
21
depends/packages/native_comparisontool.mk
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package=native_comparisontool
|
||||||
|
$(package)_version=8c6666f
|
||||||
|
$(package)_download_path=https://github.com/theuni/bitcoind-comparisontool/raw/master
|
||||||
|
$(package)_file_name=pull-tests-$($(package)_version).jar
|
||||||
|
$(package)_sha256_hash=a865332b3827abcde684ab79f5f43c083b0b6a4c97ff5508c79f29fee24f11cd
|
||||||
|
$(package)_install_dirname=BitcoindComparisonTool_jar
|
||||||
|
$(package)_install_filename=BitcoindComparisonTool.jar
|
||||||
|
|
||||||
|
define $(package)_extract_cmds
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_configure_cmds
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_build_cmds
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_stage_cmds
|
||||||
|
mkdir -p $($(package)_staging_prefix_dir)/share/$($(package)_install_dirname) && \
|
||||||
|
cp $($(package)_source) $($(package)_staging_prefix_dir)/share/$($(package)_install_dirname)/$($(package)_install_filename)
|
||||||
|
endef
|
|
@ -1,8 +1,9 @@
|
||||||
package=native_ds_store
|
package=native_ds_store
|
||||||
$(package)_version=1.1.2
|
$(package)_version=c80c23706eae
|
||||||
$(package)_download_path=https://github.com/al45tair/ds_store/archive/
|
$(package)_download_path=https://bitbucket.org/al45tair/ds_store/get
|
||||||
$(package)_file_name=v$($(package)_version).tar.gz
|
$(package)_download_file=$($(package)_version).tar.bz2
|
||||||
$(package)_sha256_hash=3b3ecb7bf0a5157f5b6010bc3af7c141fb0ad3527084e63336220d22744bc20c
|
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||||
|
$(package)_sha256_hash=ce1aa412211610c63d567bbe3e06213006a2d5ba5d76d89399c151b5472cb0da
|
||||||
$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
|
$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
|
||||||
$(package)_dependencies=native_biplist
|
$(package)_dependencies=native_biplist
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
package=native_mac_alias
|
package=native_mac_alias
|
||||||
$(package)_version=2.0.7
|
$(package)_version=1.1.0
|
||||||
$(package)_download_path=https://github.com/al45tair/mac_alias/archive/
|
$(package)_download_path=https://bitbucket.org/al45tair/mac_alias/get
|
||||||
$(package)_file_name=v$($(package)_version).tar.gz
|
$(package)_download_file=v$($(package)_version).tar.bz2
|
||||||
$(package)_sha256_hash=6f606d3b6bccd2112aeabf1a063f5b5ece87005a5d7e97c8faca23b916e88838
|
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||||
|
$(package)_sha256_hash=87ad827e66790028361e43fc754f68ed041a9bdb214cca03c853f079b04fb120
|
||||||
$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
|
$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
|
||||||
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
|
|
|
@ -6,54 +6,18 @@ $(package)_sha256_hash=8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fce
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
|
$(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
|
||||||
$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl
|
$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl no-zlib no-shared no-dso
|
||||||
$(package)_config_opts+=no-camellia
|
$(package)_config_opts+=no-krb5 no-camellia no-capieng no-cast no-cms no-dtls1 no-gost no-gmp no-heartbeats no-idea no-jpake no-md2
|
||||||
$(package)_config_opts+=no-capieng
|
$(package)_config_opts+=no-mdc2 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-static_engine no-whirlpool no-rc2 no-rc4 no-ssl2 no-ssl3
|
||||||
$(package)_config_opts+=no-cast
|
|
||||||
$(package)_config_opts+=no-comp
|
|
||||||
$(package)_config_opts+=no-dso
|
|
||||||
$(package)_config_opts+=no-dtls1
|
|
||||||
$(package)_config_opts+=no-ec_nistp_64_gcc_128
|
|
||||||
$(package)_config_opts+=no-gost
|
|
||||||
$(package)_config_opts+=no-gmp
|
|
||||||
$(package)_config_opts+=no-heartbeats
|
|
||||||
$(package)_config_opts+=no-idea
|
|
||||||
$(package)_config_opts+=no-jpake
|
|
||||||
$(package)_config_opts+=no-krb5
|
|
||||||
$(package)_config_opts+=no-libunbound
|
|
||||||
$(package)_config_opts+=no-md2
|
|
||||||
$(package)_config_opts+=no-mdc2
|
|
||||||
$(package)_config_opts+=no-rc4
|
|
||||||
$(package)_config_opts+=no-rc5
|
|
||||||
$(package)_config_opts+=no-rdrand
|
|
||||||
$(package)_config_opts+=no-rfc3779
|
|
||||||
$(package)_config_opts+=no-rsax
|
|
||||||
$(package)_config_opts+=no-sctp
|
|
||||||
$(package)_config_opts+=no-seed
|
|
||||||
$(package)_config_opts+=no-sha0
|
|
||||||
$(package)_config_opts+=no-shared
|
|
||||||
$(package)_config_opts+=no-ssl-trace
|
|
||||||
$(package)_config_opts+=no-ssl2
|
|
||||||
$(package)_config_opts+=no-ssl3
|
|
||||||
$(package)_config_opts+=no-static_engine
|
|
||||||
$(package)_config_opts+=no-store
|
|
||||||
$(package)_config_opts+=no-unit-test
|
|
||||||
$(package)_config_opts+=no-weak-ssl-ciphers
|
|
||||||
$(package)_config_opts+=no-whirlpool
|
|
||||||
$(package)_config_opts+=no-zlib
|
|
||||||
$(package)_config_opts+=no-zlib-dynamic
|
|
||||||
$(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags)
|
$(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags)
|
||||||
$(package)_config_opts_linux=-fPIC -Wa,--noexecstack
|
$(package)_config_opts_linux=-fPIC -Wa,--noexecstack
|
||||||
$(package)_config_opts_x86_64_linux=linux-x86_64
|
$(package)_config_opts_x86_64_linux=linux-x86_64
|
||||||
$(package)_config_opts_i686_linux=linux-generic32
|
$(package)_config_opts_i686_linux=linux-generic32
|
||||||
$(package)_config_opts_arm_linux=linux-generic32
|
$(package)_config_opts_arm_linux=linux-generic32
|
||||||
$(package)_config_opts_armv7l_linux=linux-generic32
|
|
||||||
$(package)_config_opts_aarch64_linux=linux-generic64
|
$(package)_config_opts_aarch64_linux=linux-generic64
|
||||||
$(package)_config_opts_mipsel_linux=linux-generic32
|
$(package)_config_opts_mipsel_linux=linux-generic32
|
||||||
$(package)_config_opts_mips_linux=linux-generic32
|
$(package)_config_opts_mips_linux=linux-generic32
|
||||||
$(package)_config_opts_powerpc_linux=linux-generic32
|
$(package)_config_opts_powerpc_linux=linux-generic32
|
||||||
$(package)_config_opts_riscv32_linux=linux-generic32
|
|
||||||
$(package)_config_opts_riscv64_linux=linux-generic64
|
|
||||||
$(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc
|
$(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc
|
||||||
$(package)_config_opts_x86_64_mingw32=mingw64
|
$(package)_config_opts_x86_64_mingw32=mingw64
|
||||||
$(package)_config_opts_i686_mingw32=mingw
|
$(package)_config_opts_i686_mingw32=mingw
|
||||||
|
|
1
depends/packages/packages.icu.mk
Normal file
1
depends/packages/packages.icu.mk
Normal file
|
@ -0,0 +1 @@
|
||||||
|
packages:=icu
|
|
@ -1,10 +1,12 @@
|
||||||
packages:=boost openssl libevent zeromq
|
packages:=boost openssl libevent
|
||||||
|
darwin_packages:=zeromq
|
||||||
|
linux_packages:=zeromq
|
||||||
|
native_packages := native_ccache native_comparisontool
|
||||||
|
|
||||||
qt_native_packages = native_protobuf
|
qt_native_packages = native_protobuf
|
||||||
qt_packages = qrencode protobuf zlib
|
qt_packages = qrencode protobuf
|
||||||
|
|
||||||
qt_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
|
|
||||||
|
|
||||||
|
qt_linux_packages= qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
|
||||||
qt_darwin_packages=qt
|
qt_darwin_packages=qt
|
||||||
qt_mingw32_packages=qt
|
qt_mingw32_packages=qt
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ $(package)_download_path=$(native_$(package)_download_path)
|
||||||
$(package)_file_name=$(native_$(package)_file_name)
|
$(package)_file_name=$(native_$(package)_file_name)
|
||||||
$(package)_sha256_hash=$(native_$(package)_sha256_hash)
|
$(package)_sha256_hash=$(native_$(package)_sha256_hash)
|
||||||
$(package)_dependencies=native_$(package)
|
$(package)_dependencies=native_$(package)
|
||||||
$(package)_cxxflags=-std=c++11
|
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc
|
$(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package=qrencode
|
package=qrencode
|
||||||
$(package)_version=3.4.4
|
$(package)_version=3.4.4
|
||||||
$(package)_download_path=https://fukuchi.org/works/qrencode/
|
$(package)_download_path=https://fukuchi.org/works/qrencode/
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
$(package)_file_name=qrencode-$(qrencode_version).tar.bz2
|
||||||
$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5
|
$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
PACKAGE=qt
|
PACKAGE=qt
|
||||||
$(package)_version=5.9.6
|
$(package)_version=5.5.0
|
||||||
$(package)_download_path=https://download.qt.io/official_releases/qt/5.9/$($(package)_version)/submodules
|
$(package)_download_path=http://download.qt.io/official_releases/qt/5.5/$($(package)_version)/submodules
|
||||||
$(package)_suffix=opensource-src-$($(package)_version).tar.xz
|
$(package)_suffix=opensource-src-$($(package)_version).tar.gz
|
||||||
$(package)_file_name=qtbase-$($(package)_suffix)
|
$(package)_file_name=qtbase-$($(package)_suffix)
|
||||||
$(package)_sha256_hash=eed620cb268b199bd83b3fc6a471c51d51e1dc2dbb5374fc97a0cc75facbe36f
|
$(package)_sha256_hash=7e82b1318f88e56a2a9376e069aa608d4fd96b48cb0e1b880ae658b0a1af0561
|
||||||
$(package)_dependencies=openssl zlib
|
$(package)_dependencies=openssl
|
||||||
$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext
|
$(package)_linux_dependencies=freetype fontconfig dbus libxcb libX11 xproto libXext
|
||||||
$(package)_build_subdir=qtbase
|
$(package)_build_subdir=qtbase
|
||||||
$(package)_qt_libs=corelib network widgets gui plugins testlib
|
$(package)_qt_libs=corelib network widgets gui plugins testlib
|
||||||
$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch xkb-default.patch
|
$(package)_patches=mac-qmake.conf fix-xcb-include-order.patch mingw-uuidof.patch pidlist_absolute.patch
|
||||||
|
|
||||||
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
|
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
|
||||||
$(package)_qttranslations_sha256_hash=9822084f8e2d2939ba39f4af4c0c2320e45d5996762a9423f833055607604ed8
|
$(package)_qttranslations_sha256_hash=c4bd6db6e426965c6f8824c54e81f68bbd61e2bae1bcadc328c6e81c45902a0d
|
||||||
|
|
||||||
$(package)_qttools_file_name=qttools-$($(package)_suffix)
|
$(package)_qttools_file_name=qttools-$($(package)_suffix)
|
||||||
$(package)_qttools_sha256_hash=50e75417ec0c74bb8b1989d1d8e981ee83690dce7dfc0c2169f7c00f397e5117
|
$(package)_qttools_sha256_hash=d9e06bd19ecc86afba5e95d45a906d1bc1ad579aa70001e36143c1aaf695bdd6
|
||||||
|
|
||||||
$(package)_extra_sources = $($(package)_qttranslations_file_name)
|
$(package)_extra_sources = $($(package)_qttranslations_file_name)
|
||||||
$(package)_extra_sources += $($(package)_qttools_file_name)
|
$(package)_extra_sources += $($(package)_qttools_file_name)
|
||||||
|
@ -22,26 +22,21 @@ $(package)_extra_sources += $($(package)_qttools_file_name)
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_opts_release = -release
|
$(package)_config_opts_release = -release
|
||||||
$(package)_config_opts_debug = -debug
|
$(package)_config_opts_debug = -debug
|
||||||
$(package)_config_opts += -bindir $(build_prefix)/bin
|
$(package)_config_opts += -opensource -confirm-license
|
||||||
$(package)_config_opts += -c++std c++11
|
$(package)_config_opts += -no-audio-backend
|
||||||
$(package)_config_opts += -confirm-license
|
|
||||||
$(package)_config_opts += -dbus-runtime
|
|
||||||
$(package)_config_opts += -hostprefix $(build_prefix)
|
|
||||||
$(package)_config_opts += -no-cups
|
|
||||||
$(package)_config_opts += -no-egl
|
|
||||||
$(package)_config_opts += -no-eglfs
|
|
||||||
$(package)_config_opts += -no-freetype
|
|
||||||
$(package)_config_opts += -no-gif
|
|
||||||
$(package)_config_opts += -no-glib
|
$(package)_config_opts += -no-glib
|
||||||
$(package)_config_opts += -no-icu
|
$(package)_config_opts += -no-icu
|
||||||
|
$(package)_config_opts += -no-cups
|
||||||
$(package)_config_opts += -no-iconv
|
$(package)_config_opts += -no-iconv
|
||||||
$(package)_config_opts += -no-kms
|
$(package)_config_opts += -no-gif
|
||||||
$(package)_config_opts += -no-linuxfb
|
$(package)_config_opts += -no-freetype
|
||||||
$(package)_config_opts += -no-libudev
|
$(package)_config_opts += -no-nis
|
||||||
$(package)_config_opts += -no-mtdev
|
$(package)_config_opts += -no-pch
|
||||||
$(package)_config_opts += -no-openvg
|
|
||||||
$(package)_config_opts += -no-reduce-relocations
|
|
||||||
$(package)_config_opts += -no-qml-debug
|
$(package)_config_opts += -no-qml-debug
|
||||||
|
$(package)_config_opts += -nomake examples
|
||||||
|
$(package)_config_opts += -nomake tests
|
||||||
|
$(package)_config_opts += -no-feature-style-windowsmobile
|
||||||
|
$(package)_config_opts += -no-feature-style-windowsce
|
||||||
$(package)_config_opts += -no-sql-db2
|
$(package)_config_opts += -no-sql-db2
|
||||||
$(package)_config_opts += -no-sql-ibase
|
$(package)_config_opts += -no-sql-ibase
|
||||||
$(package)_config_opts += -no-sql-oci
|
$(package)_config_opts += -no-sql-oci
|
||||||
|
@ -51,27 +46,36 @@ $(package)_config_opts += -no-sql-odbc
|
||||||
$(package)_config_opts += -no-sql-psql
|
$(package)_config_opts += -no-sql-psql
|
||||||
$(package)_config_opts += -no-sql-sqlite
|
$(package)_config_opts += -no-sql-sqlite
|
||||||
$(package)_config_opts += -no-sql-sqlite2
|
$(package)_config_opts += -no-sql-sqlite2
|
||||||
$(package)_config_opts += -no-use-gold-linker
|
|
||||||
$(package)_config_opts += -no-xinput2
|
|
||||||
$(package)_config_opts += -nomake examples
|
|
||||||
$(package)_config_opts += -nomake tests
|
|
||||||
$(package)_config_opts += -opensource
|
|
||||||
$(package)_config_opts += -openssl-linked
|
|
||||||
$(package)_config_opts += -optimized-qmake
|
|
||||||
$(package)_config_opts += -pch
|
|
||||||
$(package)_config_opts += -pkg-config
|
|
||||||
$(package)_config_opts += -prefix $(host_prefix)
|
$(package)_config_opts += -prefix $(host_prefix)
|
||||||
$(package)_config_opts += -qt-libpng
|
$(package)_config_opts += -hostprefix $(build_prefix)
|
||||||
$(package)_config_opts += -qt-libjpeg
|
$(package)_config_opts += -bindir $(build_prefix)/bin
|
||||||
$(package)_config_opts += -qt-pcre
|
$(package)_config_opts += -no-c++11
|
||||||
$(package)_config_opts += -system-zlib
|
$(package)_config_opts += -openssl-linked
|
||||||
|
$(package)_config_opts += -v
|
||||||
$(package)_config_opts += -static
|
$(package)_config_opts += -static
|
||||||
$(package)_config_opts += -silent
|
$(package)_config_opts += -silent
|
||||||
$(package)_config_opts += -v
|
$(package)_config_opts += -pkg-config
|
||||||
$(package)_config_opts += -no-feature-printer
|
$(package)_config_opts += -qt-libpng
|
||||||
$(package)_config_opts += -no-feature-printdialog
|
$(package)_config_opts += -qt-libjpeg
|
||||||
$(package)_config_opts += -no-feature-concurrent
|
$(package)_config_opts += -qt-zlib
|
||||||
$(package)_config_opts += -no-feature-xml
|
$(package)_config_opts += -qt-pcre
|
||||||
|
$(package)_config_opts += -no-pulseaudio
|
||||||
|
$(package)_config_opts += -no-openvg
|
||||||
|
$(package)_config_opts += -no-xrender
|
||||||
|
$(package)_config_opts += -no-alsa
|
||||||
|
$(package)_config_opts += -no-mtdev
|
||||||
|
$(package)_config_opts += -no-gstreamer
|
||||||
|
$(package)_config_opts += -no-mitshm
|
||||||
|
$(package)_config_opts += -no-kms
|
||||||
|
$(package)_config_opts += -no-reduce-relocations
|
||||||
|
$(package)_config_opts += -no-egl
|
||||||
|
$(package)_config_opts += -no-eglfs
|
||||||
|
$(package)_config_opts += -no-linuxfb
|
||||||
|
$(package)_config_opts += -no-xinput2
|
||||||
|
$(package)_config_opts += -no-libudev
|
||||||
|
$(package)_config_opts += -no-use-gold-linker
|
||||||
|
$(package)_config_opts += -reduce-exports
|
||||||
|
$(package)_config_opts += -optimized-qmake
|
||||||
|
|
||||||
ifneq ($(build_os),darwin)
|
ifneq ($(build_os),darwin)
|
||||||
$(package)_config_opts_darwin = -xplatform macx-clang-linux
|
$(package)_config_opts_darwin = -xplatform macx-clang-linux
|
||||||
|
@ -83,19 +87,16 @@ $(package)_config_opts_darwin += -device-option MAC_TARGET=$(host)
|
||||||
$(package)_config_opts_darwin += -device-option MAC_LD64_VERSION=$(LD64_VERSION)
|
$(package)_config_opts_darwin += -device-option MAC_LD64_VERSION=$(LD64_VERSION)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(package)_config_opts_linux = -qt-xkbcommon-x11
|
$(package)_config_opts_linux = -qt-xkbcommon
|
||||||
$(package)_config_opts_linux += -qt-xcb
|
$(package)_config_opts_linux += -qt-xcb
|
||||||
$(package)_config_opts_linux += -system-freetype
|
$(package)_config_opts_linux += -system-freetype
|
||||||
$(package)_config_opts_linux += -no-feature-sessionmanager
|
$(package)_config_opts_linux += -no-sm
|
||||||
$(package)_config_opts_linux += -fontconfig
|
$(package)_config_opts_linux += -fontconfig
|
||||||
$(package)_config_opts_linux += -no-opengl
|
$(package)_config_opts_linux += -no-opengl
|
||||||
$(package)_config_opts_arm_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
|
$(package)_config_opts_arm_linux = -platform linux-g++ -xplatform $(host)
|
||||||
$(package)_config_opts_i686_linux = -xplatform linux-g++-32
|
$(package)_config_opts_i686_linux = -xplatform linux-g++-32
|
||||||
$(package)_config_opts_x86_64_linux = -xplatform linux-g++-64
|
|
||||||
$(package)_config_opts_aarch64_linux = -xplatform linux-aarch64-gnu-g++
|
|
||||||
$(package)_config_opts_mingw32 = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE="$(host)-"
|
$(package)_config_opts_mingw32 = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE="$(host)-"
|
||||||
$(package)_build_env = QT_RCC_TEST=1
|
$(package)_build_env = QT_RCC_TEST=1
|
||||||
$(package)_build_env += QT_RCC_SOURCE_DATE_OVERRIDE=1
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_fetch_cmds
|
define $(package)_fetch_cmds
|
||||||
|
@ -119,33 +120,24 @@ define $(package)_extract_cmds
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_preprocess_cmds
|
define $(package)_preprocess_cmds
|
||||||
sed -i.old "s|FT_Get_Font_Format|FT_Get_X11_Font_Format|" qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp && \
|
|
||||||
sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
|
sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
|
||||||
sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \
|
sed -i.old "s/src_plugins.depends = src_sql src_xml src_network/src_plugins.depends = src_xml src_network/" qtbase/src/src.pro && \
|
||||||
sed -i.old "s/src_plugins.depends = src_sql src_network/src_plugins.depends = src_network/" qtbase/src/src.pro && \
|
|
||||||
sed -i.old "s|X11/extensions/XIproto.h|X11/X.h|" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \
|
sed -i.old "s|X11/extensions/XIproto.h|X11/X.h|" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \
|
||||||
sed -i.old 's/if \[ "$$$$XPLATFORM_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/if \[ "$$$$BUILD_ON_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/' qtbase/configure && \
|
sed -i.old 's/if \[ "$$$$XPLATFORM_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/if \[ "$$$$BUILD_ON_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/' qtbase/configure && \
|
||||||
sed -i.old 's/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0)/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft)/' qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm && \
|
|
||||||
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
|
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
|
||||||
cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\
|
cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\
|
||||||
cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\
|
cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\
|
||||||
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
|
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
|
||||||
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
|
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
|
||||||
cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \
|
patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch && \
|
||||||
sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
patch -p1 < $($(package)_patch_dir)/mingw-uuidof.patch && \
|
||||||
patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch &&\
|
patch -p1 < $($(package)_patch_dir)/pidlist_absolute.patch && \
|
||||||
patch -p1 -i $($(package)_patch_dir)/fix_configure_mac.patch &&\
|
echo "QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
||||||
patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch &&\
|
echo "QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
||||||
patch -p1 -i $($(package)_patch_dir)/fix_rcc_determinism.patch &&\
|
echo "QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
||||||
patch -p1 -i $($(package)_patch_dir)/xkb-default.patch &&\
|
sed -i.old "s|QMAKE_CFLAGS = |QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
|
||||||
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
sed -i.old "s|QMAKE_LFLAGS = |QMAKE_LFLAGS = $($(package)_ldflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
|
||||||
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
sed -i.old "s|QMAKE_CXXFLAGS = |QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf
|
||||||
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
|
||||||
echo "QMAKE_LINK_OBJECT_MAX = 10" >> qtbase/mkspecs/win32-g++/qmake.conf &&\
|
|
||||||
echo "QMAKE_LINK_OBJECT_SCRIPT = object_script" >> qtbase/mkspecs/win32-g++/qmake.conf &&\
|
|
||||||
sed -i.old "s|QMAKE_CFLAGS = |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
|
|
||||||
sed -i.old "s|QMAKE_LFLAGS = |!host_build: QMAKE_LFLAGS = $($(package)_ldflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
|
|
||||||
sed -i.old "s|QMAKE_CXXFLAGS = |!host_build: QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_config_cmds
|
define $(package)_config_cmds
|
||||||
|
@ -153,26 +145,21 @@ define $(package)_config_cmds
|
||||||
export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
|
export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
|
||||||
export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \
|
export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \
|
||||||
./configure $($(package)_config_opts) && \
|
./configure $($(package)_config_opts) && \
|
||||||
echo "host_build: QT_CONFIG ~= s/system-zlib/zlib" >> mkspecs/qconfig.pri && \
|
|
||||||
echo "CONFIG += force_bootstrap" >> mkspecs/qconfig.pri && \
|
|
||||||
$(MAKE) sub-src-clean && \
|
$(MAKE) sub-src-clean && \
|
||||||
cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \
|
cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \
|
||||||
cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. && \
|
cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. &&\
|
||||||
cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile && \
|
cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile
|
||||||
cd ../lupdate/ && ../../../../qtbase/bin/qmake lupdate.pro -o Makefile && cd ../../../..
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
$(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \
|
$(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \
|
||||||
$(MAKE) -C ../qttools/src/linguist/lrelease && \
|
$(MAKE) -C ../qttools/src/linguist/lrelease && \
|
||||||
$(MAKE) -C ../qttools/src/linguist/lupdate && \
|
|
||||||
$(MAKE) -C ../qttranslations
|
$(MAKE) -C ../qttranslations
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_stage_cmds
|
define $(package)_stage_cmds
|
||||||
$(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. && \
|
$(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. &&\
|
||||||
$(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \
|
$(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \
|
||||||
$(MAKE) -C qttools/src/linguist/lupdate INSTALL_ROOT=$($(package)_staging_dir) install_target && \
|
|
||||||
$(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \
|
$(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \
|
||||||
if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \
|
if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \
|
||||||
cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \
|
cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \
|
||||||
|
|
66
depends/packages/qt46.mk
Normal file
66
depends/packages/qt46.mk
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
PACKAGE=qt46
|
||||||
|
$(package)_version=4.6.4
|
||||||
|
$(package)_download_path=http://download.qt-project.org/archive/qt/4.6/
|
||||||
|
$(package)_file_name=qt-everywhere-opensource-src-$($(package)_version).tar.gz
|
||||||
|
$(package)_sha256_hash=9ad4d46c721b53a429ed5a2eecfd3c239a9ab566562f183f99d3125f1a234250
|
||||||
|
$(package)_dependencies=openssl freetype dbus libX11 xproto libXext libICE libSM
|
||||||
|
$(package)_patches=stlfix.patch
|
||||||
|
|
||||||
|
define $(package)_set_vars
|
||||||
|
$(package)_config_opts = -prefix $(host_prefix) -headerdir $(host_prefix)/include/qt4 -bindir $(build_prefix)/bin
|
||||||
|
$(package)_config_opts += -release -no-separate-debug-info -opensource -confirm-license
|
||||||
|
$(package)_config_opts += -stl -qt-zlib
|
||||||
|
|
||||||
|
$(package)_config_opts += -nomake examples -nomake tests -nomake tools -nomake translations -nomake demos -nomake docs
|
||||||
|
$(package)_config_opts += -no-audio-backend -no-glib -no-nis -no-cups -no-iconv -no-gif -no-pch
|
||||||
|
$(package)_config_opts += -no-xkb -no-xrender -no-xrandr -no-xfixes -no-xcursor -no-xinerama -no-xsync -no-xinput -no-mitshm -no-xshape
|
||||||
|
$(package)_config_opts += -no-libtiff -no-fontconfig -openssl-linked
|
||||||
|
$(package)_config_opts += -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql
|
||||||
|
$(package)_config_opts += -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2
|
||||||
|
$(package)_config_opts += -no-xmlpatterns -no-multimedia -no-phonon -no-scripttools -no-declarative
|
||||||
|
$(package)_config_opts += -no-phonon-backend -no-webkit -no-javascript-jit -no-script
|
||||||
|
$(package)_config_opts += -no-svg -no-libjpeg -no-libtiff -no-libpng -no-libmng -no-qt3support -no-opengl
|
||||||
|
|
||||||
|
$(package)_config_opts_x86_64_linux += -platform linux-g++-64
|
||||||
|
$(package)_config_opts_i686_linux = -platform linux-g++-32
|
||||||
|
$(package)_build_env = QT_RCC_TEST=1
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_preprocess_cmds
|
||||||
|
sed -i.old "s|/include /usr/include||" config.tests/unix/freetype/freetype.pri && \
|
||||||
|
sed -i.old "s|src_plugins.depends = src_gui src_sql src_svg|src_plugins.depends = src_gui src_sql|" src/src.pro && \
|
||||||
|
sed -i.old "s|\.lower(|\.toLower(|g" src/network/ssl/qsslsocket_openssl.cpp && \
|
||||||
|
sed -i.old "s|Key_BackSpace|Key_Backspace|" src/gui/itemviews/qabstractitemview.cpp && \
|
||||||
|
sed -i.old "s|/usr/X11R6/lib64|$(host_prefix)/lib|" mkspecs/*/*.conf && \
|
||||||
|
sed -i.old "s|/usr/X11R6/lib|$(host_prefix)/lib|" mkspecs/*/*.conf && \
|
||||||
|
sed -i.old "s|/usr/X11R6/include|$(host_prefix)/include|" mkspecs/*/*.conf && \
|
||||||
|
sed -i.old "s|QMAKE_LFLAGS_SHLIB\t+= -shared|QMAKE_LFLAGS_SHLIB\t+= -shared -Wl,--exclude-libs,ALL|" mkspecs/common/g++.conf && \
|
||||||
|
sed -i.old "/SSLv2_client_method/d" src/network/ssl/qsslsocket_openssl.cpp src/network/ssl/qsslsocket_openssl_symbols.cpp && \
|
||||||
|
sed -i.old "/SSLv2_server_method/d" src/network/ssl/qsslsocket_openssl.cpp src/network/ssl/qsslsocket_openssl_symbols.cpp && \
|
||||||
|
patch -p1 < $($(package)_patch_dir)/stlfix.patch
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_config_cmds
|
||||||
|
export PKG_CONFIG_SYSROOT_DIR=/ && \
|
||||||
|
export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
|
||||||
|
export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \
|
||||||
|
export CPATH=$(host_prefix)/include && \
|
||||||
|
OPENSSL_LIBS='-L$(host_prefix)/lib -lssl -lcrypto' ./configure $($(package)_config_opts) && \
|
||||||
|
cd tools/linguist/lrelease; ../../../bin/qmake -o Makefile lrelease.pro
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_build_cmds
|
||||||
|
export CPATH=$(host_prefix)/include && \
|
||||||
|
$(MAKE) -C src && \
|
||||||
|
$(MAKE) -C tools/linguist/lrelease
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_stage_cmds
|
||||||
|
$(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) install && \
|
||||||
|
$(MAKE) -C tools/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_postprocess_cmds
|
||||||
|
rm -rf mkspecs/ lib/cmake/ lib/*.prl lib/*.la && \
|
||||||
|
find native/bin -type f -exec mv {} {}-qt4 \;
|
||||||
|
endef
|
|
@ -4,10 +4,6 @@ $(package)_download_path=http://xorg.freedesktop.org/releases/individual/proto
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||||
$(package)_sha256_hash=f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0
|
$(package)_sha256_hash=f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0
|
||||||
|
|
||||||
define $(package)_preprocess_cmds
|
|
||||||
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
|
|
||||||
endef
|
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_opts=--disable-shared
|
$(package)_config_opts=--disable-shared
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -1,20 +1,12 @@
|
||||||
package=zeromq
|
package=zeromq
|
||||||
$(package)_version=4.3.1
|
$(package)_version=4.0.7
|
||||||
$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/
|
$(package)_download_path=http://download.zeromq.org
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||||
$(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb
|
$(package)_sha256_hash=e00b2967e074990d0538361cc79084a0a92892df2c6e7585da34e4c61ee47b03
|
||||||
$(package)_patches=0001-fix-build-with-older-mingw64.patch 0002-disable-pthread_set_name_np.patch
|
|
||||||
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_config_opts=--without-docs --disable-shared --without-libsodium --disable-curve --disable-curve-keygen --disable-perf --disable-Werror
|
$(package)_config_opts=--without-documentation --disable-shared
|
||||||
$(package)_config_opts_linux=--with-pic
|
$(package)_config_opts_linux=--with-pic
|
||||||
$(package)_cxxflags=-std=c++11
|
|
||||||
endef
|
|
||||||
|
|
||||||
define $(package)_preprocess_cmds
|
|
||||||
patch -p1 < $($(package)_patch_dir)/0001-fix-build-with-older-mingw64.patch && \
|
|
||||||
patch -p1 < $($(package)_patch_dir)/0002-disable-pthread_set_name_np.patch && \
|
|
||||||
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_config_cmds
|
define $(package)_config_cmds
|
||||||
|
@ -22,14 +14,13 @@ define $(package)_config_cmds
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
$(MAKE) src/libzmq.la
|
$(MAKE) -C src
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_stage_cmds
|
define $(package)_stage_cmds
|
||||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA
|
$(MAKE) -C src DESTDIR=$($(package)_staging_dir) install
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_postprocess_cmds
|
define $(package)_postprocess_cmds
|
||||||
sed -i.old "s/ -lstdc++//" lib/pkgconfig/libzmq.pc && \
|
|
||||||
rm -rf bin share
|
rm -rf bin share
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
package=zlib
|
|
||||||
$(package)_version=1.2.11
|
|
||||||
$(package)_download_path=http://www.zlib.net
|
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
|
||||||
$(package)_sha256_hash=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
|
|
||||||
|
|
||||||
define $(package)_set_vars
|
|
||||||
$(package)_build_opts= CC="$($(package)_cc)"
|
|
||||||
$(package)_build_opts+=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC"
|
|
||||||
$(package)_build_opts+=RANLIB="$($(package)_ranlib)"
|
|
||||||
$(package)_build_opts+=AR="$($(package)_ar)"
|
|
||||||
$(package)_build_opts_darwin+=AR="$($(package)_libtool)"
|
|
||||||
$(package)_build_opts_darwin+=ARFLAGS="-o"
|
|
||||||
endef
|
|
||||||
|
|
||||||
define $(package)_config_cmds
|
|
||||||
./configure --static --prefix=$(host_prefix)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define $(package)_build_cmds
|
|
||||||
$(MAKE) $($(package)_build_opts) libz.a
|
|
||||||
endef
|
|
||||||
|
|
||||||
define $(package)_stage_cmds
|
|
||||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install $($(package)_build_opts)
|
|
||||||
endef
|
|
||||||
|
|
21
depends/patches/libevent/reuseaddr.patch
Normal file
21
depends/patches/libevent/reuseaddr.patch
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
--- old/evutil.c 2015-08-28 19:26:23.488765923 -0400
|
||||||
|
+++ new/evutil.c 2015-08-28 19:27:41.392767019 -0400
|
||||||
|
@@ -321,15 +321,16 @@
|
||||||
|
int
|
||||||
|
evutil_make_listen_socket_reuseable(evutil_socket_t sock)
|
||||||
|
{
|
||||||
|
-#ifndef WIN32
|
||||||
|
int one = 1;
|
||||||
|
+#ifndef WIN32
|
||||||
|
/* REUSEADDR on Unix means, "don't hang on to this address after the
|
||||||
|
* listener is closed." On Windows, though, it means "don't keep other
|
||||||
|
* processes from binding to this address while we're using it. */
|
||||||
|
return setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*) &one,
|
||||||
|
(ev_socklen_t)sizeof(one));
|
||||||
|
#else
|
||||||
|
- return 0;
|
||||||
|
+ return setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char*) &one,
|
||||||
|
+ (ev_socklen_t)sizeof(one));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
45
depends/patches/qt/fix-xcb-include-order.patch
Normal file
45
depends/patches/qt/fix-xcb-include-order.patch
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
--- old/qtbase/src/plugins/platforms/xcb/xcb_qpa_lib.pro 2015-03-17 02:06:42.705930685 +0000
|
||||||
|
+++ new/qtbase/src/plugins/platforms/xcb/xcb_qpa_lib.pro 2015-03-17 02:08:41.281926351 +0000
|
||||||
|
@@ -94,8 +94,6 @@
|
||||||
|
|
||||||
|
DEFINES += $$QMAKE_DEFINES_XCB
|
||||||
|
LIBS += $$QMAKE_LIBS_XCB
|
||||||
|
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB
|
||||||
|
-QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB
|
||||||
|
|
||||||
|
CONFIG += qpa/genericunixfontdatabase
|
||||||
|
|
||||||
|
@@ -104,7 +102,8 @@
|
||||||
|
contains(QT_CONFIG, xcb-qt) {
|
||||||
|
DEFINES += XCB_USE_RENDER
|
||||||
|
XCB_DIR = ../../../3rdparty/xcb
|
||||||
|
- INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude
|
||||||
|
+ QMAKE_CFLAGS += -I$$XCB_DIR/include -I$$XCB_DIR/sysinclude $$QMAKE_CFLAGS_XCB
|
||||||
|
+ QMAKE_CXXFLAGS += -I$$XCB_DIR/include -I$$XCB_DIR/sysinclude $$QMAKE_CFLAGS_XCB
|
||||||
|
LIBS += -lxcb -L$$OUT_PWD/xcb-static -lxcb-static
|
||||||
|
} else {
|
||||||
|
LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms
|
||||||
|
--- old/qtbase/src/plugins/platforms/xcb/xcb-static/xcb-static.pro 2015-03-17 02:07:04.641929383 +0000
|
||||||
|
+++ new/qtbase/src/plugins/platforms/xcb/xcb-static/xcb-static.pro 2015-03-17 02:10:15.485922059 +0000
|
||||||
|
@@ -8,7 +8,8 @@
|
||||||
|
|
||||||
|
XCB_DIR = ../../../../3rdparty/xcb
|
||||||
|
|
||||||
|
-INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/include/xcb $$XCB_DIR/sysinclude
|
||||||
|
+QMAKE_CFLAGS += -I$$XCB_DIR/include -I$$XCB_DIR/include/xcb -I$$XCB_DIR/sysinclude
|
||||||
|
+QMAKE_CXXFLAGS += -I$$XCB_DIR/include -I$$XCB_DIR/include/xcb -I$$XCB_DIR/sysinclude
|
||||||
|
|
||||||
|
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB
|
||||||
|
QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB
|
||||||
|
--- old/qtbase/src/plugins/platforms/xcb/xcb-plugin.pro 2015-07-24 16:02:59.530038830 -0400
|
||||||
|
+++ new/qtbase/src/plugins/platforms/xcb/xcb-plugin.pro 2015-07-24 16:01:22.106037459 -0400
|
||||||
|
@@ -11,3 +11,9 @@
|
||||||
|
qxcbmain.cpp
|
||||||
|
OTHER_FILES += xcb.json README
|
||||||
|
|
||||||
|
+contains(QT_CONFIG, xcb-qt) {
|
||||||
|
+ DEFINES += XCB_USE_RENDER
|
||||||
|
+ XCB_DIR = ../../../3rdparty/xcb
|
||||||
|
+ QMAKE_CFLAGS += -I$$XCB_DIR/include -I$$XCB_DIR/sysinclude $$QMAKE_CFLAGS_XCB
|
||||||
|
+ QMAKE_CXXFLAGS += -I$$XCB_DIR/include -I$$XCB_DIR/sysinclude $$QMAKE_CFLAGS_XCB
|
||||||
|
+}
|
|
@ -1,50 +0,0 @@
|
||||||
--- old/qtbase/mkspecs/features/mac/sdk.prf 2018-02-08 10:24:48.000000000 -0800
|
|
||||||
+++ new/qtbase/mkspecs/features/mac/sdk.prf 2018-03-23 10:38:56.000000000 -0700
|
|
||||||
@@ -8,21 +8,21 @@
|
|
||||||
defineReplace(xcodeSDKInfo) {
|
|
||||||
info = $$1
|
|
||||||
equals(info, "Path"): \
|
|
||||||
- info = --show-sdk-path
|
|
||||||
+ infoarg = --show-sdk-path
|
|
||||||
equals(info, "PlatformPath"): \
|
|
||||||
- info = --show-sdk-platform-path
|
|
||||||
+ infoarg = --show-sdk-platform-path
|
|
||||||
equals(info, "SDKVersion"): \
|
|
||||||
- info = --show-sdk-version
|
|
||||||
+ infoarg = --show-sdk-version
|
|
||||||
sdk = $$2
|
|
||||||
isEmpty(sdk): \
|
|
||||||
sdk = $$QMAKE_MAC_SDK
|
|
||||||
|
|
||||||
isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
|
|
||||||
- QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$info 2>/dev/null")
|
|
||||||
+ QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$infoarg 2>/dev/null")
|
|
||||||
# --show-sdk-platform-path won't work for Command Line Tools; this is fine
|
|
||||||
# only used by the XCTest backend to testlib
|
|
||||||
- isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(info, "--show-sdk-platform-path")): \
|
|
||||||
- error("Could not resolve SDK $$info for \'$$sdk\'")
|
|
||||||
+ isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(infoarg, "--show-sdk-platform-path")): \
|
|
||||||
+ error("Could not resolve SDK $$info for \'$$sdk\' using $$infoarg")
|
|
||||||
cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info})
|
|
||||||
}
|
|
||||||
|
|
||||||
--- old/qtbase/configure 2018-02-08 10:24:48.000000000 -0800
|
|
||||||
+++ new/qtbase/configure 2018-03-23 05:42:29.000000000 -0700
|
|
||||||
@@ -232,8 +232,13 @@
|
|
||||||
|
|
||||||
sdk=$(getSingleQMakeVariable "QMAKE_MAC_SDK" "$1")
|
|
||||||
if [ -z "$sdk" ]; then echo "QMAKE_MAC_SDK must be set when building on Mac" >&2; exit 1; fi
|
|
||||||
- sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null)
|
|
||||||
- if [ -z "$sysroot" ]; then echo "Failed to resolve SDK path for '$sdk'" >&2; exit 1; fi
|
|
||||||
+ sysroot=$(getSingleQMakeVariable "QMAKE_MAC_SDK_PATH" "$1")
|
|
||||||
+
|
|
||||||
+ echo "sysroot pre-configured as $sysroot";
|
|
||||||
+ if [ -z "$sysroot" ]; then
|
|
||||||
+ sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null)
|
|
||||||
+ if [ -z "$sysroot" ]; then echo "Failed to resolve SDK path for '$sdk'" >&2; exit 1; fi
|
|
||||||
+ fi
|
|
||||||
|
|
||||||
case "$sdk" in
|
|
||||||
macosx*)
|
|
||||||
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
--- x/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h
|
|
||||||
+++ y/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h
|
|
||||||
@@ -52,6 +52,7 @@
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
|
||||||
+#include <qpa/qplatformprintdevice.h>
|
|
||||||
|
|
||||||
#ifndef QT_NO_PRINTER
|
|
||||||
|
|
||||||
--- x/qtbase/src/plugins/plugins.pro
|
|
||||||
+++ y/qtbase/src/plugins/plugins.pro
|
|
||||||
@@ -8,6 +8,3 @@ qtHaveModule(gui) {
|
|
||||||
qtConfig(imageformatplugin): SUBDIRS *= imageformats
|
|
||||||
!android:qtConfig(library): SUBDIRS *= generic
|
|
||||||
}
|
|
||||||
-
|
|
||||||
-!winrt:qtHaveModule(printsupport): \
|
|
||||||
- SUBDIRS += printsupport
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- old/qtbase/mkspecs/features/qt_module.prf
|
|
||||||
+++ new/qtbase/mkspecs/features/qt_module.prf
|
|
||||||
@@ -245,7 +245,7 @@
|
|
||||||
load(qt_targets)
|
|
||||||
|
|
||||||
# this builds on top of qt_common
|
|
||||||
-!internal_module:!lib_bundle:if(unix|mingw) {
|
|
||||||
+unix|mingw {
|
|
||||||
CONFIG += create_pc
|
|
||||||
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
|
|
||||||
host_build: \
|
|
|
@ -1,15 +0,0 @@
|
||||||
--- old/qtbase/src/tools/rcc/rcc.cpp
|
|
||||||
+++ new/qtbase/src/tools/rcc/rcc.cpp
|
|
||||||
@@ -207,7 +207,11 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
|
|
||||||
if (lib.formatVersion() >= 2) {
|
|
||||||
// last modified time stamp
|
|
||||||
const QDateTime lastModified = m_fileInfo.lastModified();
|
|
||||||
- lib.writeNumber8(quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0));
|
|
||||||
+ quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
|
|
||||||
+ static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
|
|
||||||
+ if (sourceDate != 0)
|
|
||||||
+ lastmod = sourceDate;
|
|
||||||
+ lib.writeNumber8(lastmod);
|
|
||||||
if (text || pass1)
|
|
||||||
lib.writeChar('\n');
|
|
||||||
}
|
|
|
@ -1,5 +1,6 @@
|
||||||
MAKEFILE_GENERATOR = UNIX
|
MAKEFILE_GENERATOR = UNIX
|
||||||
CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname absolute_library_soname
|
CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname absolute_library_soname
|
||||||
|
DEFINES += QT_NO_PRINTER QT_NO_PRINTDIALOG
|
||||||
QMAKE_INCREMENTAL_STYLE = sublib
|
QMAKE_INCREMENTAL_STYLE = sublib
|
||||||
include(../common/macx.conf)
|
include(../common/macx.conf)
|
||||||
include(../common/gcc-base-mac.conf)
|
include(../common/gcc-base-mac.conf)
|
||||||
|
@ -10,15 +11,14 @@ QMAKE_XCODE_VERSION=4.3
|
||||||
QMAKE_XCODE_DEVELOPER_PATH=/Developer
|
QMAKE_XCODE_DEVELOPER_PATH=/Developer
|
||||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = $${MAC_MIN_VERSION}
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = $${MAC_MIN_VERSION}
|
||||||
QMAKE_MAC_SDK=macosx
|
QMAKE_MAC_SDK=macosx
|
||||||
QMAKE_MAC_SDK.macosx.Path = $${MAC_SDK_PATH}
|
QMAKE_MAC_SDK.macosx.path = $${MAC_SDK_PATH}
|
||||||
QMAKE_MAC_SDK.macosx.platform_name = macosx
|
QMAKE_MAC_SDK.macosx.platform_name = macosx
|
||||||
QMAKE_MAC_SDK.macosx.SDKVersion = $${MAC_SDK_VERSION}
|
QMAKE_MAC_SDK.macosx.version = $${MAC_SDK_VERSION}
|
||||||
QMAKE_MAC_SDK.macosx.PlatformPath = /phony
|
QMAKE_MAC_SDK.macosx.platform_path = /phony
|
||||||
QMAKE_APPLE_DEVICE_ARCHS=x86_64
|
QMAKE_CFLAGS += -target $${MAC_TARGET}
|
||||||
!host_build: QMAKE_CFLAGS += -target $${MAC_TARGET}
|
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS
|
||||||
!host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS
|
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS
|
||||||
!host_build: QMAKE_CXXFLAGS += $$QMAKE_CFLAGS
|
QMAKE_LFLAGS += -target $${MAC_TARGET} -mlinker-version=$${MAC_LD64_VERSION}
|
||||||
!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} -mlinker-version=$${MAC_LD64_VERSION}
|
|
||||||
QMAKE_AR = $${CROSS_COMPILE}ar cq
|
QMAKE_AR = $${CROSS_COMPILE}ar cq
|
||||||
QMAKE_RANLIB=$${CROSS_COMPILE}ranlib
|
QMAKE_RANLIB=$${CROSS_COMPILE}ranlib
|
||||||
QMAKE_LIBTOOL=$${CROSS_COMPILE}libtool
|
QMAKE_LIBTOOL=$${CROSS_COMPILE}libtool
|
||||||
|
|
44
depends/patches/qt/mingw-uuidof.patch
Normal file
44
depends/patches/qt/mingw-uuidof.patch
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
--- old/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp 2015-06-20 17:40:20.956781548 -0400
|
||||||
|
+++ new/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp 2015-06-20 17:29:32.052772416 -0400
|
||||||
|
@@ -69,7 +69,7 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <windowsx.h>
|
||||||
|
-#ifndef Q_OS_WINCE
|
||||||
|
+#if !defined(Q_OS_WINCE) && (!defined(USE___UUIDOF) || (defined(USE___UUIDOF) && USE___UUIDOF == 1))
|
||||||
|
# include <comdef.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -762,7 +762,7 @@
|
||||||
|
HWND_MESSAGE, NULL, (HINSTANCE)GetModuleHandle(0), NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
-#ifndef Q_OS_WINCE
|
||||||
|
+#if !defined(Q_OS_WINCE) && (!defined(USE___UUIDOF) || (defined(USE___UUIDOF) && USE___UUIDOF == 1))
|
||||||
|
// Re-engineered from the inline function _com_error::ErrorMessage().
|
||||||
|
// We cannot use it directly since it uses swprintf_s(), which is not
|
||||||
|
// present in the MSVCRT.DLL found on Windows XP (QTBUG-35617).
|
||||||
|
@@ -781,7 +781,7 @@
|
||||||
|
return QStringLiteral("IDispatch error #") + QString::number(wCode);
|
||||||
|
return QStringLiteral("Unknown error 0x0") + QString::number(comError.Error(), 16);
|
||||||
|
}
|
||||||
|
-#endif // !Q_OS_WINCE
|
||||||
|
+#endif // !defined(Q_OS_WINCE) && (!defined(USE___UUIDOF) || (defined(USE___UUIDOF) && USE___UUIDOF == 1))
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Common COM error strings.
|
||||||
|
@@ -846,12 +846,12 @@
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
-#ifndef Q_OS_WINCE
|
||||||
|
+#if !defined(Q_OS_WINCE) && (!defined(USE___UUIDOF) || (defined(USE___UUIDOF) && USE___UUIDOF == 1))
|
||||||
|
_com_error error(hr);
|
||||||
|
result += QByteArrayLiteral(" (");
|
||||||
|
result += errorMessageFromComError(error);
|
||||||
|
result += ')';
|
||||||
|
-#endif // !Q_OS_WINCE
|
||||||
|
+#endif // !defined(Q_OS_WINCE) && (!defined(USE___UUIDOF) || (defined(USE___UUIDOF) && USE___UUIDOF == 1))
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
37
depends/patches/qt/pidlist_absolute.patch
Normal file
37
depends/patches/qt/pidlist_absolute.patch
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
diff -dur old/qtbase/src/plugins/platforms/windows/qwindowscontext.h new/qtbase/src/plugins/platforms/windows/qwindowscontext.h
|
||||||
|
--- old/qtbase/src/plugins/platforms/windows/qwindowscontext.h 2015-06-29 22:04:40.000000000 +0200
|
||||||
|
+++ new/qtbase/src/plugins/platforms/windows/qwindowscontext.h 2015-11-01 12:55:59.751234846 +0100
|
||||||
|
@@ -124,10 +124,18 @@
|
||||||
|
inline void init();
|
||||||
|
|
||||||
|
typedef HRESULT (WINAPI *SHCreateItemFromParsingName)(PCWSTR, IBindCtx *, const GUID&, void **);
|
||||||
|
+#if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3)
|
||||||
|
+ typedef HRESULT (WINAPI *SHGetKnownFolderIDList)(const GUID &, DWORD, HANDLE, ITEMIDLIST **);
|
||||||
|
+#else
|
||||||
|
typedef HRESULT (WINAPI *SHGetKnownFolderIDList)(const GUID &, DWORD, HANDLE, PIDLIST_ABSOLUTE *);
|
||||||
|
+#endif
|
||||||
|
typedef HRESULT (WINAPI *SHGetStockIconInfo)(int , int , _SHSTOCKICONINFO *);
|
||||||
|
typedef HRESULT (WINAPI *SHGetImageList)(int, REFIID , void **);
|
||||||
|
+#if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3)
|
||||||
|
+ typedef HRESULT (WINAPI *SHCreateItemFromIDList)(const ITEMIDLIST *, REFIID, void **);
|
||||||
|
+#else
|
||||||
|
typedef HRESULT (WINAPI *SHCreateItemFromIDList)(PCIDLIST_ABSOLUTE, REFIID, void **);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
SHCreateItemFromParsingName sHCreateItemFromParsingName;
|
||||||
|
SHGetKnownFolderIDList sHGetKnownFolderIDList;
|
||||||
|
diff -dur old/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp new/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
|
||||||
|
--- old/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp 2015-06-29 22:04:40.000000000 +0200
|
||||||
|
+++ new/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp 2015-11-01 13:41:09.503149772 +0100
|
||||||
|
@@ -1008,7 +1008,11 @@
|
||||||
|
qWarning() << __FUNCTION__ << ": Invalid CLSID: " << url.path();
|
||||||
|
return Q_NULLPTR;
|
||||||
|
}
|
||||||
|
+#if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3)
|
||||||
|
+ ITEMIDLIST *idList;
|
||||||
|
+#else
|
||||||
|
PIDLIST_ABSOLUTE idList;
|
||||||
|
+#endif
|
||||||
|
HRESULT hr = QWindowsContext::shell32dll.sHGetKnownFolderIDList(uuid, 0, 0, &idList);
|
||||||
|
if (FAILED(hr)) {
|
||||||
|
qErrnoWarning("%s: SHGetKnownFolderIDList(%s)) failed", __FUNCTION__, qPrintable(url.toString()));
|
|
@ -1,26 +0,0 @@
|
||||||
--- old/qtbase/src/gui/configure.pri 2018-06-06 17:28:10.000000000 -0400
|
|
||||||
+++ new/qtbase/src/gui/configure.pri 2018-08-17 18:43:01.589384567 -0400
|
|
||||||
@@ -43,18 +43,11 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
defineTest(qtConfTest_xkbConfigRoot) {
|
|
||||||
- qtConfTest_getPkgConfigVariable($${1}): return(true)
|
|
||||||
-
|
|
||||||
- for (dir, $$list("/usr/share/X11/xkb", "/usr/local/share/X11/xkb")) {
|
|
||||||
- exists($$dir) {
|
|
||||||
- $${1}.value = $$dir
|
|
||||||
- export($${1}.value)
|
|
||||||
- $${1}.cache += value
|
|
||||||
- export($${1}.cache)
|
|
||||||
- return(true)
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- return(false)
|
|
||||||
+ $${1}.value = "/usr/share/X11/xkb"
|
|
||||||
+ export($${1}.value)
|
|
||||||
+ $${1}.cache += value
|
|
||||||
+ export($${1}.cache)
|
|
||||||
+ return(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
defineTest(qtConfTest_qpaDefaultPlatform) {
|
|
10
depends/patches/qt46/stlfix.patch
Normal file
10
depends/patches/qt46/stlfix.patch
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
--- old/config.tests/unix/stl/stltest.cpp 2011-06-23 03:45:23.000000000 -0400
|
||||||
|
+++ new/config.tests/unix/stl/stltest.cpp 2014-08-28 00:54:04.154837604 -0400
|
||||||
|
@@ -49,6 +49,7 @@
|
||||||
|
#include <vector>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <iostream>
|
||||||
|
+#include <cstddef>
|
||||||
|
|
||||||
|
// something mean to see if the compiler and C++ standard lib are good enough
|
||||||
|
template<class K, class T>
|
|
@ -1,30 +0,0 @@
|
||||||
From 1a159c128c69a42d90819375c06a39994f3fbfc1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Cory Fields <cory-nospam-@coryfields.com>
|
|
||||||
Date: Tue, 28 Nov 2017 20:33:25 -0500
|
|
||||||
Subject: [PATCH] fix build with older mingw64
|
|
||||||
|
|
||||||
---
|
|
||||||
src/windows.hpp | 7 +++++++
|
|
||||||
1 file changed, 7 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/src/windows.hpp b/src/windows.hpp
|
|
||||||
index 99e889d..e69038e 100644
|
|
||||||
--- a/src/windows.hpp
|
|
||||||
+++ b/src/windows.hpp
|
|
||||||
@@ -55,6 +55,13 @@
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#include <mswsock.h>
|
|
||||||
+
|
|
||||||
+#if defined __MINGW64_VERSION_MAJOR && __MINGW64_VERSION_MAJOR < 4
|
|
||||||
+// Workaround for mingw-w64 < v4.0 which did not include ws2ipdef.h in iphlpapi.h.
|
|
||||||
+// Fixed in mingw-w64 by 9bd8fe9148924840d315b4c915dd099955ea89d1.
|
|
||||||
+#include <ws2def.h>
|
|
||||||
+#include <ws2ipdef.h>
|
|
||||||
+#endif
|
|
||||||
#include <iphlpapi.h>
|
|
||||||
|
|
||||||
#if !defined __MINGW32__
|
|
||||||
--
|
|
||||||
2.7.4
|
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
From 6e6b47d5ab381c3df3b30bb0b0a6cf210dfb1eba Mon Sep 17 00:00:00 2001
|
|
||||||
From: Cory Fields <cory-nospam-@coryfields.com>
|
|
||||||
Date: Mon, 5 Mar 2018 14:22:05 -0500
|
|
||||||
Subject: [PATCH] disable pthread_set_name_np
|
|
||||||
|
|
||||||
pthread_set_name_np adds a Glibc requirement on >= 2.12.
|
|
||||||
---
|
|
||||||
src/thread.cpp | 4 +++-
|
|
||||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/thread.cpp b/src/thread.cpp
|
|
||||||
index 4fc59c3e..c3fdfd46 100644
|
|
||||||
--- a/src/thread.cpp
|
|
||||||
+++ b/src/thread.cpp
|
|
||||||
@@ -220,7 +220,7 @@ void zmq::thread_t::setThreadName(const char *name_)
|
|
||||||
*/
|
|
||||||
if (!name_)
|
|
||||||
return;
|
|
||||||
-
|
|
||||||
+#if 0
|
|
||||||
#if defined(ZMQ_HAVE_PTHREAD_SETNAME_1)
|
|
||||||
int rc = pthread_setname_np(name_);
|
|
||||||
if(rc) return;
|
|
||||||
@@ -233,6 +233,8 @@ void zmq::thread_t::setThreadName(const char *name_)
|
|
||||||
#elif defined(ZMQ_HAVE_PTHREAD_SET_NAME)
|
|
||||||
pthread_set_name_np(descriptor, name_);
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
+ return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
--
|
|
||||||
2.11.1
|
|
||||||
|
|
|
@ -17,10 +17,16 @@ Given a transaction hash: returns a transaction in binary, hex-encoded binary, o
|
||||||
For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option.
|
For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option.
|
||||||
|
|
||||||
#### Blocks
|
#### Blocks
|
||||||
|
`GET /rest/block/tip.<bin|hex|json>`
|
||||||
`GET /rest/block/<BLOCK-HASH>.<bin|hex|json>`
|
`GET /rest/block/<BLOCK-HASH>.<bin|hex|json>`
|
||||||
|
`GET /rest/block/<BLOCK-HEIGHT>.<bin|hex|json>`
|
||||||
|
`GET /rest/block/notxdetails/tip.<bin|hex|json>`
|
||||||
`GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>`
|
`GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>`
|
||||||
|
`GET /rest/block/notxdetails/<BLOCK-HEIGHT>.<bin|hex|json>`
|
||||||
|
|
||||||
Given a block hash: returns a block, in binary, hex-encoded binary or JSON formats.
|
Given a block hash: returns a block, in binary, hex-encoded binary or JSON formats.
|
||||||
|
You can give a block height instead of a hash. Height 0 is not available,
|
||||||
|
but can be negative to go back that many blocks from the tip.
|
||||||
|
|
||||||
The HTTP request and response are both handled entirely in-memory, thus making maximum memory usage at least 2.66MB (1 MB max block, plus hex encoding) per request.
|
The HTTP request and response are both handled entirely in-memory, thus making maximum memory usage at least 2.66MB (1 MB max block, plus hex encoding) per request.
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
dist_man1_MANS=
|
dist_man1_MANS=
|
||||||
|
|
||||||
if BUILD_BITCOIND
|
if BUILD_BITCOIND
|
||||||
dist_man1_MANS+=bitcoind.1
|
dist_man1_MANS+=lbrycrdd.1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ENABLE_QT
|
if ENABLE_QT
|
||||||
dist_man1_MANS+=bitcoin-qt.1
|
dist_man1_MANS+=lbrycrd-qt.1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if BUILD_BITCOIN_UTILS
|
if BUILD_BITCOIN_UTILS
|
||||||
dist_man1_MANS+=bitcoin-cli.1 bitcoin-tx.1
|
dist_man1_MANS+=lbrycrd-cli.1 lbrycrd-tx.1
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||||
.TH BITCOIN-CLI "1" "December 2018" "bitcoin-cli v0.17.1.0" "User Commands"
|
.TH BITCOIN-CLI "1" "December 2018" "lbrycrd-cli v0.17.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoin-cli \- manual page for bitcoin-cli v0.17.1.0
|
lbrycrd-cli \- manual page for lbrycrd-cli v0.17.1.0
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bitcoin-cli
|
.B lbrycrd-cli
|
||||||
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR] \fI\,Send command to Bitcoin Core\/\fR
|
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR] \fI\,Send command to LBRYcrd Core\/\fR
|
||||||
.br
|
.br
|
||||||
.B bitcoin-cli
|
.B lbrycrd-cli
|
||||||
[\fI\,options\/\fR] \fI\,-named <command> \/\fR[\fI\,name=value\/\fR]... \fI\,Send command to Bitcoin Core (with named arguments)\/\fR
|
[\fI\,options\/\fR] \fI\,-named <command> \/\fR[\fI\,name=value\/\fR]... \fI\,Send command to LBRYcrd Core (with named arguments)\/\fR
|
||||||
.br
|
.br
|
||||||
.B bitcoin-cli
|
.B lbrycrd-cli
|
||||||
[\fI\,options\/\fR] \fI\,help List commands\/\fR
|
[\fI\,options\/\fR] \fI\,help List commands\/\fR
|
||||||
.br
|
.br
|
||||||
.B bitcoin-cli
|
.B lbrycrd-cli
|
||||||
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
|
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core RPC client version v0.17.1.0
|
LBRYcrd Core RPC client version v0.17.1.0
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.HP
|
.HP
|
||||||
\-?
|
\-?
|
||||||
|
@ -25,7 +25,7 @@ This help message
|
||||||
\fB\-conf=\fR<file>
|
\fB\-conf=\fR<file>
|
||||||
.IP
|
.IP
|
||||||
Specify configuration file. Relative paths will be prefixed by datadir
|
Specify configuration file. Relative paths will be prefixed by datadir
|
||||||
location. (default: bitcoin.conf)
|
location. (default: lbrycrd.conf)
|
||||||
.HP
|
.HP
|
||||||
\fB\-datadir=\fR<dir>
|
\fB\-datadir=\fR<dir>
|
||||||
.IP
|
.IP
|
||||||
|
@ -76,7 +76,7 @@ Wait for RPC server to start
|
||||||
\fB\-rpcwallet=\fR<walletname>
|
\fB\-rpcwallet=\fR<walletname>
|
||||||
.IP
|
.IP
|
||||||
Send RPC for non\-default wallet on RPC server (needs to exactly match
|
Send RPC for non\-default wallet on RPC server (needs to exactly match
|
||||||
corresponding \fB\-wallet\fR option passed to bitcoind)
|
corresponding \fB\-wallet\fR option passed to lbrycrdd)
|
||||||
.HP
|
.HP
|
||||||
\fB\-stdin\fR
|
\fB\-stdin\fR
|
||||||
.IP
|
.IP
|
||||||
|
@ -101,11 +101,11 @@ Chain selection options:
|
||||||
.IP
|
.IP
|
||||||
Use the test chain
|
Use the test chain
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
Copyright (C) 2009-2018 The Bitcoin Core developers
|
Copyright (C) 2009-2018 The LBRYcrd Core developers
|
||||||
|
|
||||||
Please contribute if you find Bitcoin Core useful. Visit
|
Please contribute if you find LBRYcrd Core useful. Visit
|
||||||
<https://bitcoincore.org> for further information about the software.
|
<https://lbrycrdcore.org> for further information about the software.
|
||||||
The source code is available from <https://github.com/bitcoin/bitcoin>.
|
The source code is available from <https://github.com/lbrycrd/lbrycrd>.
|
||||||
|
|
||||||
This is experimental software.
|
This is experimental software.
|
||||||
Distributed under the MIT software license, see the accompanying file COPYING
|
Distributed under the MIT software license, see the accompanying file COPYING
|
|
@ -1,12 +1,12 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||||
.TH BITCOIN-QT "1" "December 2018" "bitcoin-qt v0.17.1.0" "User Commands"
|
.TH BITCOIN-QT "1" "December 2018" "lbrycrd-qt v0.17.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoin-qt \- manual page for bitcoin-qt v0.17.1.0
|
lbrycrd-qt \- manual page for lbrycrd-qt v0.17.1.0
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bitcoin-qt
|
.B lbrycrd-qt
|
||||||
[\fI\,command-line options\/\fR]
|
[\fI\,command-line options\/\fR]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core version v0.17.1.0 (64\-bit)
|
LBRYcrd Core version v0.17.1.0 (64\-bit)
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.HP
|
.HP
|
||||||
\-?
|
\-?
|
||||||
|
@ -44,7 +44,7 @@ Specify blocks directory (default: <datadir>/blocks)
|
||||||
\fB\-conf=\fR<file>
|
\fB\-conf=\fR<file>
|
||||||
.IP
|
.IP
|
||||||
Specify configuration file. Relative paths will be prefixed by datadir
|
Specify configuration file. Relative paths will be prefixed by datadir
|
||||||
location. (default: bitcoin.conf)
|
location. (default: lbrycrd.conf)
|
||||||
.HP
|
.HP
|
||||||
\fB\-daemon\fR
|
\fB\-daemon\fR
|
||||||
.IP
|
.IP
|
||||||
|
@ -98,7 +98,7 @@ Whether to save the mempool on shutdown and load on restart (default: 1)
|
||||||
\fB\-pid=\fR<file>
|
\fB\-pid=\fR<file>
|
||||||
.IP
|
.IP
|
||||||
Specify pid file. Relative paths will be prefixed by a net\-specific
|
Specify pid file. Relative paths will be prefixed by a net\-specific
|
||||||
datadir location. (default: bitcoind.pid)
|
datadir location. (default: lbrycrdd.pid)
|
||||||
.HP
|
.HP
|
||||||
\fB\-prune=\fR<n>
|
\fB\-prune=\fR<n>
|
||||||
.IP
|
.IP
|
||||||
|
@ -604,11 +604,11 @@ Set SSL root certificates for payment request (default: \fB\-system\-\fR)
|
||||||
.IP
|
.IP
|
||||||
Show splash screen on startup (default: 1)
|
Show splash screen on startup (default: 1)
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
Copyright (C) 2009-2018 The Bitcoin Core developers
|
Copyright (C) 2009-2018 The LBRYcrd Core developers
|
||||||
|
|
||||||
Please contribute if you find Bitcoin Core useful. Visit
|
Please contribute if you find LBRYcrd Core useful. Visit
|
||||||
<https://bitcoincore.org> for further information about the software.
|
<https://lbrycrdcore.org> for further information about the software.
|
||||||
The source code is available from <https://github.com/bitcoin/bitcoin>.
|
The source code is available from <https://github.com/lbrycrd/lbrycrd>.
|
||||||
|
|
||||||
This is experimental software.
|
This is experimental software.
|
||||||
Distributed under the MIT software license, see the accompanying file COPYING
|
Distributed under the MIT software license, see the accompanying file COPYING
|
|
@ -1,15 +1,15 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||||
.TH BITCOIN-TX "1" "December 2018" "bitcoin-tx v0.17.1.0" "User Commands"
|
.TH BITCOIN-TX "1" "December 2018" "lbrycrd-tx v0.17.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoin-tx \- manual page for bitcoin-tx v0.17.1.0
|
lbrycrd-tx \- manual page for lbrycrd-tx v0.17.1.0
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bitcoin-tx
|
.B lbrycrd-tx
|
||||||
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded bitcoin transaction\/\fR
|
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded lbrycrd transaction\/\fR
|
||||||
.br
|
.br
|
||||||
.B bitcoin-tx
|
.B lbrycrd-tx
|
||||||
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded bitcoin transaction\/\fR
|
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded lbrycrd transaction\/\fR
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core bitcoin\-tx utility version v0.17.1.0
|
LBRYcrd Core lbrycrd\-tx utility version v0.17.1.0
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.HP
|
.HP
|
||||||
\-?
|
\-?
|
||||||
|
@ -105,11 +105,11 @@ set=NAME:JSON\-STRING
|
||||||
.IP
|
.IP
|
||||||
Set register NAME to given JSON\-STRING
|
Set register NAME to given JSON\-STRING
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
Copyright (C) 2009-2018 The Bitcoin Core developers
|
Copyright (C) 2009-2018 The LBRYcrd Core developers
|
||||||
|
|
||||||
Please contribute if you find Bitcoin Core useful. Visit
|
Please contribute if you find LBRYcrd Core useful. Visit
|
||||||
<https://bitcoincore.org> for further information about the software.
|
<https://lbrycrdcore.org> for further information about the software.
|
||||||
The source code is available from <https://github.com/bitcoin/bitcoin>.
|
The source code is available from <https://github.com/lbrycrd/lbrycrd>.
|
||||||
|
|
||||||
This is experimental software.
|
This is experimental software.
|
||||||
Distributed under the MIT software license, see the accompanying file COPYING
|
Distributed under the MIT software license, see the accompanying file COPYING
|
|
@ -1,12 +1,12 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||||
.TH BITCOIND "1" "December 2018" "bitcoind v0.17.1.0" "User Commands"
|
.TH BITCOIND "1" "December 2018" "lbrycrdd v0.17.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoind \- manual page for bitcoind v0.17.1.0
|
lbrycrdd \- manual page for lbrycrdd v0.17.1.0
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bitcoind
|
.B lbrycrdd
|
||||||
[\fI\,options\/\fR] \fI\,Start Bitcoin Core Daemon\/\fR
|
[\fI\,options\/\fR] \fI\,Start LBRYcrd Core Daemon\/\fR
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core Daemon version v0.17.1.0
|
LBRYcrd Core Daemon version v0.17.1.0
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.HP
|
.HP
|
||||||
\-?
|
\-?
|
||||||
|
@ -44,7 +44,7 @@ Specify blocks directory (default: <datadir>/blocks)
|
||||||
\fB\-conf=\fR<file>
|
\fB\-conf=\fR<file>
|
||||||
.IP
|
.IP
|
||||||
Specify configuration file. Relative paths will be prefixed by datadir
|
Specify configuration file. Relative paths will be prefixed by datadir
|
||||||
location. (default: bitcoin.conf)
|
location. (default: lbrycrd.conf)
|
||||||
.HP
|
.HP
|
||||||
\fB\-daemon\fR
|
\fB\-daemon\fR
|
||||||
.IP
|
.IP
|
||||||
|
@ -98,7 +98,7 @@ Whether to save the mempool on shutdown and load on restart (default: 1)
|
||||||
\fB\-pid=\fR<file>
|
\fB\-pid=\fR<file>
|
||||||
.IP
|
.IP
|
||||||
Specify pid file. Relative paths will be prefixed by a net\-specific
|
Specify pid file. Relative paths will be prefixed by a net\-specific
|
||||||
datadir location. (default: bitcoind.pid)
|
datadir location. (default: lbrycrdd.pid)
|
||||||
.HP
|
.HP
|
||||||
\fB\-prune=\fR<n>
|
\fB\-prune=\fR<n>
|
||||||
.IP
|
.IP
|
||||||
|
@ -578,11 +578,11 @@ Username for JSON\-RPC connections
|
||||||
.IP
|
.IP
|
||||||
Accept command line and JSON\-RPC commands
|
Accept command line and JSON\-RPC commands
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
Copyright (C) 2009-2018 The Bitcoin Core developers
|
Copyright (C) 2009-2018 The LBRYcrd Core developers
|
||||||
|
|
||||||
Please contribute if you find Bitcoin Core useful. Visit
|
Please contribute if you find LBRYcrd Core useful. Visit
|
||||||
<https://bitcoincore.org> for further information about the software.
|
<https://lbrycrdcore.org> for further information about the software.
|
||||||
The source code is available from <https://github.com/bitcoin/bitcoin>.
|
The source code is available from <https://github.com/lbrycrd/lbrycrd>.
|
||||||
|
|
||||||
This is experimental software.
|
This is experimental software.
|
||||||
Distributed under the MIT software license, see the accompanying file COPYING
|
Distributed under the MIT software license, see the accompanying file COPYING
|
64
packaging/build_windows.sh
Executable file
64
packaging/build_windows.sh
Executable file
|
@ -0,0 +1,64 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends \
|
||||||
|
g++-mingw-w64-i686 mingw-w64-i686-dev g++-mingw-w64-x86-64 \
|
||||||
|
mingw-w64-x86-64-dev build-essential libtool autotools-dev automake pkg-config \
|
||||||
|
libssl-dev libevent-dev bsdmainutils curl ca-certificates
|
||||||
|
|
||||||
|
echo "1" | sudo update-alternatives --config x86_64-w64-mingw32-g++
|
||||||
|
echo "1" | sudo update-alternatives --config x86_64-w64-mingw32-gcc
|
||||||
|
|
||||||
|
|
||||||
|
#################################################################
|
||||||
|
# Build ICU for Linux first so that we can cross compile it below
|
||||||
|
# It's a strange ICU thing in that it requries a working
|
||||||
|
# Linux build of itself to be used as part of the cross-compile
|
||||||
|
#################################################################
|
||||||
|
icu_version=63.1
|
||||||
|
icu_release=icu4c-63_1-src.tgz
|
||||||
|
staging_dir=/tmp/icu_staging
|
||||||
|
icu_linux_dir=$staging_dir/build_icu_linux
|
||||||
|
mkdir -p $staging_dir
|
||||||
|
pushd $staging_dir
|
||||||
|
wget -c http://download.icu-project.org/files/icu4c/$icu_version/$icu_release
|
||||||
|
tar -xzf $icu_release
|
||||||
|
pushd icu/source
|
||||||
|
CC="gcc" CXX="g++" ./runConfigureICU Linux --prefix=$icu_linux_dir --enable-extras=no --enable-strict=no --enable-static --enable-shared=no --enable-tests=no --enable-samples=no --enable-dyload=no
|
||||||
|
make -j4
|
||||||
|
make install
|
||||||
|
popd
|
||||||
|
popd
|
||||||
|
|
||||||
|
export CXXFLAGS="-std=c++11"
|
||||||
|
|
||||||
|
pushd depends
|
||||||
|
# Remove the dir saying that dependencies are built (although ccache
|
||||||
|
# is still enabled).
|
||||||
|
rm -rf built
|
||||||
|
mkdir -p sources
|
||||||
|
cp "$staging_dir/$icu_release" sources/
|
||||||
|
|
||||||
|
# Build and install the cross compiled ICU package.
|
||||||
|
make -j4 HOST=x86_64-w64-mingw32 NO_QT=1 ICU_ONLY=1
|
||||||
|
|
||||||
|
# Then build the rest of the dependencies (now that it exists and we
|
||||||
|
# can determine the location for it).
|
||||||
|
icu_mingw_dir=$(find /tmp/icu_install -name x86_64-w64-mingw32 -type d)
|
||||||
|
|
||||||
|
make -j4 HOST=x86_64-w64-mingw32 NO_QT=1 ICU_DIR=$icu_mingw_dir V=1
|
||||||
|
popd
|
||||||
|
|
||||||
|
./autogen.sh
|
||||||
|
echo "Using --with-icu=$icu_mingw_dir"
|
||||||
|
PREFIX=`pwd`/depends/x86_64-w64-mingw32
|
||||||
|
CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" ./configure --prefix=$PREFIX --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --without-gui --with-icu=$icu_mingw_dir --enable-static --disable-shared
|
||||||
|
./configure --prefix=$PREFIX --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --without-gui --with-icu=$icu_mingw_dir --enable-static --disable-shared
|
||||||
|
make -j4
|
||||||
|
|
||||||
|
rm -rf $staging_dir
|
||||||
|
# Remove hardcoded cross compiled ICU package path.
|
||||||
|
rm -rf /tmp/icu_install
|
||||||
|
echo "Windows build is complete"
|
23
packaging/remove_consensus.patch
Normal file
23
packaging/remove_consensus.patch
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||||
|
index a9f0a94..d71bfeb 100644
|
||||||
|
--- a/src/Makefile.am
|
||||||
|
+++ b/src/Makefile.am
|
||||||
|
@@ -64,12 +64,12 @@ if ENABLE_ZMQ
|
||||||
|
EXTRA_LIBRARIES += libbitcoin_zmq.a
|
||||||
|
endif
|
||||||
|
|
||||||
|
-if BUILD_BITCOIN_LIBS
|
||||||
|
-lib_LTLIBRARIES = libbitcoinconsensus.la
|
||||||
|
-LIBBITCOINCONSENSUS=libbitcoinconsensus.la
|
||||||
|
-else
|
||||||
|
-LIBBITCOINCONSENSUS=
|
||||||
|
-endif
|
||||||
|
+# if BUILD_BITCOIN_LIBS
|
||||||
|
+# lib_LTLIBRARIES = libbitcoinconsensus.la
|
||||||
|
+# LIBBITCOINCONSENSUS=libbitcoinconsensus.la
|
||||||
|
+# else
|
||||||
|
+# LIBBITCOINCONSENSUS=
|
||||||
|
+# endif
|
||||||
|
|
||||||
|
bin_PROGRAMS =
|
||||||
|
TESTS =
|
451
reproducible_build.sh
Executable file
451
reproducible_build.sh
Executable file
|
@ -0,0 +1,451 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euox pipefail
|
||||||
|
|
||||||
|
function HELP {
|
||||||
|
echo "Build lbrycrd"
|
||||||
|
echo "-----"
|
||||||
|
echo "When run without any arguments, this script expects the current directory"
|
||||||
|
echo "to be the lbrycrd repo and it builds what is in that directory"
|
||||||
|
echo
|
||||||
|
echo "This is a long build process so it can be split into two parts"
|
||||||
|
echo "Specify the -d flag to build only the dependencies"
|
||||||
|
echo "and the -l flag to build only lbrycrd. This will fail"
|
||||||
|
echo "if the dependencies weren't built earlier"
|
||||||
|
echo
|
||||||
|
echo "Optional arguments:"
|
||||||
|
echo
|
||||||
|
echo "-f: check formatting of committed code relative to master"
|
||||||
|
echo "-r: remove intermediate files."
|
||||||
|
echo "-l: build only lbrycrd"
|
||||||
|
echo "-d: build only the dependencies"
|
||||||
|
echo "-o: timeout build after 40 minutes"
|
||||||
|
echo "-t: turn trace on"
|
||||||
|
echo "-h: show help"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
CLEAN=false
|
||||||
|
CHECK_CODE_FORMAT=false
|
||||||
|
BUILD_DEPENDENCIES=true
|
||||||
|
BUILD_LBRYCRD=true
|
||||||
|
TIMEOUT=false
|
||||||
|
THREE_MB=3145728
|
||||||
|
# this flag gets set to False if
|
||||||
|
# the script exits due to a timeout
|
||||||
|
OUTPUT_LOG=true
|
||||||
|
|
||||||
|
while getopts :crfldoth:w:d: FLAG; do
|
||||||
|
case $FLAG in
|
||||||
|
r)
|
||||||
|
CLEAN=true
|
||||||
|
;;
|
||||||
|
f)
|
||||||
|
CHECK_CODE_FORMAT=true
|
||||||
|
;;
|
||||||
|
l)
|
||||||
|
BUILD_DEPENDENCIES=false
|
||||||
|
;;
|
||||||
|
d)
|
||||||
|
BUILD_LBRYCRD=false
|
||||||
|
;;
|
||||||
|
o)
|
||||||
|
TIMEOUT=true
|
||||||
|
;;
|
||||||
|
t)
|
||||||
|
set -o xtrace
|
||||||
|
;;
|
||||||
|
h)
|
||||||
|
HELP
|
||||||
|
;;
|
||||||
|
\?) #unrecognized option - show help
|
||||||
|
echo "Option -$OPTARG not allowed."
|
||||||
|
HELP
|
||||||
|
;;
|
||||||
|
:)
|
||||||
|
echo "Option -$OPTARG requires an argument."
|
||||||
|
HELP
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
SUDO=''
|
||||||
|
if (( EUID != 0 )); then
|
||||||
|
SUDO='sudo'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$(basename "$PWD")" != "lbrycrd" ]; then
|
||||||
|
echo "Not currently in the lbrycrd directory. Cowardly refusing to go forward"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
SOURCE_DIR=$PWD
|
||||||
|
|
||||||
|
if [ -z "${TRAVIS_OS_NAME+x}" ]; then
|
||||||
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
|
OS_NAME="osx"
|
||||||
|
else
|
||||||
|
OS_NAME="linux"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
OS_NAME="${TRAVIS_OS_NAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${TRAVIS_BUILD_DIR+x}" ]; then
|
||||||
|
START_TIME_FILE="$PWD/start_time"
|
||||||
|
else
|
||||||
|
# if we are on travis (the primary use case for setting a timeout)
|
||||||
|
# this file is created when the build starts
|
||||||
|
START_TIME_FILE="$TRAVIS_BUILD_DIR/start_time"
|
||||||
|
fi
|
||||||
|
rm -f ${START_TIME_FILE}
|
||||||
|
date +%s > ${START_TIME_FILE}
|
||||||
|
|
||||||
|
NEXT_TIME=60
|
||||||
|
function exit_at_60() {
|
||||||
|
if [ -f "${START_TIME_FILE}" ]; then
|
||||||
|
NOW=$(date +%s)
|
||||||
|
START=$(cat "${START_TIME_FILE}")
|
||||||
|
TIMEOUT_SECS=3600 # 60 * 60
|
||||||
|
TIME=$((NOW - START))
|
||||||
|
if (( TIME > NEXT_TIME )); then
|
||||||
|
echo "Build has taken $((TIME / 60)) minutes: $1"
|
||||||
|
NEXT_TIME=$((TIME + 60))
|
||||||
|
fi
|
||||||
|
if [ "$TIMEOUT" = true ] && (( TIME > TIMEOUT_SECS )); then
|
||||||
|
echo 'Exiting at 60 minutes to allow the cache to populate'
|
||||||
|
OUTPUT_LOG=false
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# two arguments
|
||||||
|
# - pid (probably from $!)
|
||||||
|
# - echo message
|
||||||
|
function wait_and_echo() {
|
||||||
|
PID=$1
|
||||||
|
TIME=0
|
||||||
|
SLEEP=3
|
||||||
|
# loop until the process is no longer running
|
||||||
|
# check every $SLEEP seconds, echoing a message every minute
|
||||||
|
while (ps -p "${PID}" > /dev/null); do
|
||||||
|
exit_at_60 "$2"
|
||||||
|
sleep "${SLEEP}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# run a command ($1) in the background
|
||||||
|
# logging its stdout and stderr to $2
|
||||||
|
# and wait until it completed
|
||||||
|
function background() {
|
||||||
|
eval $1 >> "$2" 2>&1 &
|
||||||
|
BACKGROUND_PID=$!
|
||||||
|
(
|
||||||
|
set +xe # do not echo each sleep call in trace mode
|
||||||
|
wait_and_echo $BACKGROUND_PID "$3"
|
||||||
|
)
|
||||||
|
wait $BACKGROUND_PID
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanup() {
|
||||||
|
rv=$?
|
||||||
|
if [ $rv -eq 0 ]; then
|
||||||
|
return $rv
|
||||||
|
fi
|
||||||
|
# cat the log file if it exists
|
||||||
|
if [ -f "$2" ] && [ "${OUTPUT_LOG}" = true ]; then
|
||||||
|
echo
|
||||||
|
echo "Output of log file $2"
|
||||||
|
echo
|
||||||
|
cat "$2"
|
||||||
|
# tail -n 200 "$2"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
# delete the build directory
|
||||||
|
rm -rf "$1"
|
||||||
|
echo "Build failed. Removing $1"
|
||||||
|
exit $rv
|
||||||
|
}
|
||||||
|
|
||||||
|
function cat_and_exit() {
|
||||||
|
rv=$?
|
||||||
|
# cat the log file if it exists
|
||||||
|
if [ -f "$1" ] && [ "${OUTPUT_LOG}" = true ]; then
|
||||||
|
echo
|
||||||
|
echo "Output of log file $1"
|
||||||
|
echo
|
||||||
|
# This used to be the last 3MB but outputing that
|
||||||
|
# caused problems on travis.
|
||||||
|
# Hopefully the last 1000 lines is enough
|
||||||
|
# to debug whatever went wrong
|
||||||
|
tail -n 1000 "$1"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
exit $rv
|
||||||
|
}
|
||||||
|
|
||||||
|
function brew_if_not_installed() {
|
||||||
|
if ! brew ls | grep $1 --quiet; then
|
||||||
|
brew install $1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_brew_packages() {
|
||||||
|
brew update > /dev/null
|
||||||
|
brew unlink python
|
||||||
|
brew_if_not_installed autoconf
|
||||||
|
brew_if_not_installed automake
|
||||||
|
# something weird happened where glibtoolize was failing to find
|
||||||
|
# sed, and reinstalling fixes it.
|
||||||
|
brew reinstall libtool
|
||||||
|
brew_if_not_installed pkg-config
|
||||||
|
brew_if_not_installed protobuf
|
||||||
|
brew_if_not_installed gmp
|
||||||
|
|
||||||
|
if [ "${CHECK_CODE_FORMAT}" = true ]; then
|
||||||
|
brew_if_not_installed clang-format
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_apt_packages() {
|
||||||
|
if [ -d "${OUTPUT_DIR}" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${TRAVIS+x}" ]; then
|
||||||
|
# if not on travis, its nice to see progress
|
||||||
|
QUIET=""
|
||||||
|
else
|
||||||
|
QUIET="-qq"
|
||||||
|
fi
|
||||||
|
# get the required OS packages
|
||||||
|
$SUDO apt-get ${QUIET} update
|
||||||
|
$SUDO apt-get ${QUIET} install -y --no-install-recommends \
|
||||||
|
build-essential python-dev libbz2-dev libtool \
|
||||||
|
autotools-dev autoconf git pkg-config wget \
|
||||||
|
ca-certificates automake bsdmainutils
|
||||||
|
|
||||||
|
if [ "${CHECK_CODE_FORMAT}" = true ]; then
|
||||||
|
$SUDO apt-get ${QUIET} install -y --no-install-recommends \
|
||||||
|
clang-format-3.9
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_dependencies() {
|
||||||
|
if [ "${OS_NAME}" = "osx" ]; then
|
||||||
|
PARALLEL="-j $(sysctl -n hw.ncpu)"
|
||||||
|
install_brew_packages
|
||||||
|
else
|
||||||
|
PARALLEL="-j $(grep -c processor /proc/cpuinfo)"
|
||||||
|
install_apt_packages
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$CLEAN" = true ]; then
|
||||||
|
rm -rf "${LBRYCRD_DEPENDENCIES}"
|
||||||
|
rm -rf "${OUTPUT_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${LBRYCRD_DEPENDENCIES}"
|
||||||
|
|
||||||
|
# Download required dependencies (if not already present)
|
||||||
|
pushd ${LBRYCRD_DEPENDENCIES} > /dev/null
|
||||||
|
if [ ! -f db-4.8.30.NC.zip ]; then
|
||||||
|
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.zip
|
||||||
|
unzip -o -q db-4.8.30.NC.zip
|
||||||
|
fi
|
||||||
|
if [ ! -f libevent-2.1.8-stable.tar.gz ]; then
|
||||||
|
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
|
||||||
|
tar -xzf libevent-2.1.8-stable.tar.gz
|
||||||
|
fi
|
||||||
|
if [ ! -f openssl-1.0.2r.tar.gz ]; then
|
||||||
|
wget https://www.openssl.org/source/openssl-1.0.2r.tar.gz
|
||||||
|
tar -xzf openssl-1.0.2r.tar.gz
|
||||||
|
fi
|
||||||
|
if [ ! -f icu4c-63_1-src.tgz ]; then
|
||||||
|
wget http://download.icu-project.org/files/icu4c/63.1/icu4c-63_1-src.tgz
|
||||||
|
tar -xzf icu4c-63_1-src.tgz
|
||||||
|
fi
|
||||||
|
if [ ! -f boost_1_64_0.tar.bz2 ]; then
|
||||||
|
wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2
|
||||||
|
tar -xjf boost_1_64_0.tar.bz2
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${LOG_DIR}"
|
||||||
|
|
||||||
|
build_dependency "${OPENSSL_PREFIX}" "${LOG_DIR}/openssl_build.log" build_openssl
|
||||||
|
build_dependency "${ICU_PREFIX}" "${LOG_DIR}/icu_build.log" build_icu
|
||||||
|
build_dependency "${BDB_PREFIX}" "${LOG_DIR}/bdb_build.log" build_bdb
|
||||||
|
|
||||||
|
set +u
|
||||||
|
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${OPENSSL_PREFIX}/lib/pkgconfig"
|
||||||
|
set -u
|
||||||
|
|
||||||
|
build_dependency "${BOOST_PREFIX}" "${LOG_DIR}/boost_build.log" build_boost
|
||||||
|
build_dependency "${LIBEVENT_PREFIX}" "${LOG_DIR}/libevent_build.log" build_libevent
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_bdb() {
|
||||||
|
BDB_LOG="$1"
|
||||||
|
if [ "${OS_NAME}" = "osx" ]; then
|
||||||
|
# TODO: make this handle already patched files
|
||||||
|
patch db-4.8.30.NC/dbinc/atomic.h < ../contrib/patches/atomic.patch
|
||||||
|
fi
|
||||||
|
cd db-4.8.30.NC/build_unix
|
||||||
|
echo "Building bdb. tail -f $BDB_LOG to see the details and monitor progress"
|
||||||
|
../dist/configure --prefix="${BDB_PREFIX}" --enable-cxx --disable-shared --with-pic > "${BDB_LOG}"
|
||||||
|
background "make ${PARALLEL}" "${BDB_LOG}" "Waiting for bdb to finish building"
|
||||||
|
make install >> "${BDB_LOG}" 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_openssl() {
|
||||||
|
OPENSSL_LOG="$1"
|
||||||
|
mkdir -p "${OPENSSL_PREFIX}/ssl"
|
||||||
|
cd openssl-1.0.2r
|
||||||
|
echo "Building openssl. tail -f $OPENSSL_LOG to see the details and monitor progress"
|
||||||
|
if [ "${OS_NAME}" = "osx" ]; then
|
||||||
|
./Configure --prefix="${OPENSSL_PREFIX}" --openssldir="${OPENSSL_PREFIX}/ssl" \
|
||||||
|
-fPIC darwin64-x86_64-cc \
|
||||||
|
no-shared no-dso no-engines > "${OPENSSL_LOG}"
|
||||||
|
make depend
|
||||||
|
else
|
||||||
|
[[ $(uname -m) = 'i686' ]] && OS_ARCH="linux-generic32" || OS_ARCH="linux-x86_64"
|
||||||
|
./Configure --prefix="${OPENSSL_PREFIX}" --openssldir="${OPENSSL_PREFIX}/ssl" \
|
||||||
|
${OS_ARCH} -fPIC -static no-shared no-dso > "${OPENSSL_LOG}"
|
||||||
|
fi
|
||||||
|
background "make ${PARALLEL}" "${OPENSSL_LOG}" "Waiting for openssl to finish building"
|
||||||
|
make install >> "${OPENSSL_LOG}" 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_boost() {
|
||||||
|
BOOST_LOG="$1"
|
||||||
|
cd boost_1_64_0
|
||||||
|
|
||||||
|
echo "int main() { return 0; }" > libs/regex/build/has_icu_test.cpp
|
||||||
|
echo "int main() { return 0; }" > libs/locale/build/has_icu_test.cpp
|
||||||
|
|
||||||
|
export BOOST_ICU_LIBS="-L${ICU_PREFIX}/lib -licui18n -licuuc -licudata -ldl"
|
||||||
|
export BOOST_LIBRARIES="chrono,filesystem,program_options,system,locale,regex,thread,test"
|
||||||
|
|
||||||
|
echo "Building Boost. tail -f ${BOOST_LOG} to see the details and monitor progress"
|
||||||
|
./bootstrap.sh --prefix="${BOOST_PREFIX}" --with-icu="${ICU_PREFIX}" --with-libraries=${BOOST_LIBRARIES} > "${BOOST_LOG}" 2>&1
|
||||||
|
b2cmd="./b2 --reconfigure ${PARALLEL} link=static cxxflags=\"-std=c++11 -fPIC\" install boost.locale.iconv=off boost.locale.posix=off -sICU_PATH=\"${ICU_PREFIX}\" -sICU_LINK=\"${BOOST_ICU_LIBS}\""
|
||||||
|
background "${b2cmd}" "${BOOST_LOG}" "Waiting for boost to finish building"
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_icu() {
|
||||||
|
ICU_LOG="$1"
|
||||||
|
mkdir -p "${ICU_PREFIX}/icu"
|
||||||
|
pushd icu/source > /dev/null
|
||||||
|
echo "Building icu. tail -f $ICU_LOG to see the details and monitor progress"
|
||||||
|
./configure --prefix="${ICU_PREFIX}" --enable-draft --enable-tools \
|
||||||
|
--disable-shared --enable-static --disable-extras --disable-icuio --disable-dyload \
|
||||||
|
--disable-layout --disable-layoutex --disable-tests --disable-samples CFLAGS=-fPIC CPPFLAGS=-fPIC > "${ICU_LOG}"
|
||||||
|
if [ ! -z ${TARGET+x} ]; then
|
||||||
|
TMP_TARGET="${TARGET}"
|
||||||
|
unset TARGET
|
||||||
|
fi
|
||||||
|
set +e
|
||||||
|
background "make ${PARALLEL} VERBOSE=1" "${ICU_LOG}" "Waiting for icu to finish building"
|
||||||
|
make install >> "${ICU_LOG}" 2>&1
|
||||||
|
if [ ! -z ${TARGET+x} ]; then
|
||||||
|
TARGET="${TMP_TARGET}"
|
||||||
|
fi
|
||||||
|
set -e
|
||||||
|
popd > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_libevent() {
|
||||||
|
LIBEVENT_LOG="$1"
|
||||||
|
cd libevent-2.1.8-stable
|
||||||
|
echo "Building libevent. tail -f ${LIBEVENT_LOG} to see the details and monitor progress"
|
||||||
|
./autogen.sh > "${LIBEVENT_LOG}" 2>&1
|
||||||
|
./configure --prefix="${LIBEVENT_PREFIX}" --enable-static --disable-shared --with-pic \
|
||||||
|
LDFLAGS="-L${OPENSSL_PREFIX}/lib" \
|
||||||
|
CPPFLAGS="-I${OPENSSL_PREFIX}/include" >> "${LIBEVENT_LOG}" 2>&1
|
||||||
|
background "make ${PARALLEL}" "${LIBEVENT_LOG}" "Waiting for libevent to finish building"
|
||||||
|
make install >> "${LIBEVENT_LOG}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_dependency() {
|
||||||
|
pushd .
|
||||||
|
PREFIX=$1
|
||||||
|
LOG=$2
|
||||||
|
BUILD=$3
|
||||||
|
cd "${LBRYCRD_DEPENDENCIES}"
|
||||||
|
mkdir -p "${PREFIX}"
|
||||||
|
trap 'cleanup "${PREFIX}" "${LOG}"' INT TERM EXIT
|
||||||
|
"${BUILD}" "${LOG}"
|
||||||
|
trap - INT TERM EXIT
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_lbrycrd() {
|
||||||
|
cd "${SOURCE_DIR}"
|
||||||
|
./autogen.sh > "${LBRYCRD_LOG}" 2>&1
|
||||||
|
LDFLAGS="-L${OPENSSL_PREFIX}/lib -L${BDB_PREFIX}/lib -L${LIBEVENT_PREFIX}/lib"
|
||||||
|
OPTIONS="--enable-cxx --enable-static --disable-shared --with-pic"
|
||||||
|
if [ "${OS_NAME}" = "osx" ]; then
|
||||||
|
CPPFLAGS="-I${OPENSSL_PREFIX}/include -I${BDB_PREFIX}/include -I${LIBEVENT_PREFIX}/include -I${ICU_PREFIX}/include"
|
||||||
|
else
|
||||||
|
CPPFLAGS="-I${OPENSSL_PREFIX}/include -I${BDB_PREFIX}/include -I${LIBEVENT_PREFIX}/include -I${ICU_PREFIX}/include -Wno-unused-local-typedefs -Wno-deprecated -Wno-implicit-fallthrough"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" \
|
||||||
|
./configure --without-gui ${OPTIONS} \
|
||||||
|
--with-boost="${BOOST_PREFIX}" \
|
||||||
|
--with-icu="${ICU_PREFIX}" >> "${LBRYCRD_LOG}" 2>&1
|
||||||
|
|
||||||
|
background "make ${PARALLEL}" "${LBRYCRD_LOG}" "Waiting for lbrycrd to finish building"
|
||||||
|
}
|
||||||
|
|
||||||
|
function clang_format_diff(){
|
||||||
|
# run a code formatting check on any commits not in master
|
||||||
|
# requires clang-format
|
||||||
|
git diff -U0 origin/master -- '*.h' '*.cpp' | ./contrib/devtools/clang-format-diff.py -p1
|
||||||
|
}
|
||||||
|
|
||||||
|
# these variables are needed in both functions
|
||||||
|
LBRYCRD_DEPENDENCIES="$(pwd)/lbrycrd-dependencies"
|
||||||
|
OUTPUT_DIR="$(pwd)/build"
|
||||||
|
LOG_DIR="$(pwd)/logs"
|
||||||
|
ICU_PREFIX="${OUTPUT_DIR}/icu"
|
||||||
|
BDB_PREFIX="${OUTPUT_DIR}/bdb"
|
||||||
|
OPENSSL_PREFIX="${OUTPUT_DIR}/openssl"
|
||||||
|
BOOST_PREFIX="${OUTPUT_DIR}/boost"
|
||||||
|
LIBEVENT_PREFIX="${OUTPUT_DIR}/libevent"
|
||||||
|
|
||||||
|
if [ "${BUILD_DEPENDENCIES}" = true ]; then
|
||||||
|
build_dependencies
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${CHECK_CODE_FORMAT}" = true ]; then
|
||||||
|
LINES_W_FORMAT_REQUIRED=$(clang_format_diff | wc -l)
|
||||||
|
if [ ${LINES_W_FORMAT_REQUIRED} -ne 0 ]; then
|
||||||
|
echo "Failed to pass clang format diff: See below for the diff"
|
||||||
|
clang_format_diff
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
set +u
|
||||||
|
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${OPENSSL_PREFIX}/lib/pkgconfig:${LIBEVENT_PREFIX}/lib/pkgconfig:${ICU_PREFIX}/lib/pkgconfig"
|
||||||
|
set -u
|
||||||
|
|
||||||
|
if [ "${BUILD_LBRYCRD}" = true ]; then
|
||||||
|
LBRYCRD_LOG="${LOG_DIR}/lbrycrd_build.log"
|
||||||
|
echo "Building lbrycrd. tail -f ${LBRYCRD_LOG} to see the details and monitor progress"
|
||||||
|
trap 'cat_and_exit "${LBRYCRD_LOG}"' INT TERM EXIT
|
||||||
|
build_lbrycrd
|
||||||
|
trap - INT TERM EXIT
|
||||||
|
|
||||||
|
./src/test/test_lbrycrd
|
||||||
|
set +u
|
||||||
|
if [[ ! $CXXFLAGS =~ -g ]]; then
|
||||||
|
strip src/lbrycrdd
|
||||||
|
strip src/lbrycrd-cli
|
||||||
|
strip src/lbrycrd-tx
|
||||||
|
fi
|
||||||
|
fi
|
|
@ -19,7 +19,7 @@ else
|
||||||
LIBUNIVALUE = $(UNIVALUE_LIBS)
|
LIBUNIVALUE = $(UNIVALUE_LIBS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BITCOIN_INCLUDES=-I$(builddir) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
|
BITCOIN_INCLUDES=-I$(builddir) $(BDB_CPPFLAGS) $(ICU_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS)
|
||||||
|
|
||||||
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
|
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
|
||||||
BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
|
BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
|
||||||
|
@ -80,11 +80,11 @@ TESTS =
|
||||||
BENCHMARKS =
|
BENCHMARKS =
|
||||||
|
|
||||||
if BUILD_BITCOIND
|
if BUILD_BITCOIND
|
||||||
bin_PROGRAMS += bitcoind
|
bin_PROGRAMS += lbrycrdd
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if BUILD_BITCOIN_UTILS
|
if BUILD_BITCOIN_UTILS
|
||||||
bin_PROGRAMS += bitcoin-cli bitcoin-tx
|
bin_PROGRAMS += lbrycrd-cli lbrycrd-tx
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: FORCE check-symbols check-security
|
.PHONY: FORCE check-symbols check-security
|
||||||
|
@ -102,6 +102,8 @@ BITCOIN_CORE_H = \
|
||||||
chainparamsseeds.h \
|
chainparamsseeds.h \
|
||||||
checkpoints.h \
|
checkpoints.h \
|
||||||
checkqueue.h \
|
checkqueue.h \
|
||||||
|
claimscriptop.h \
|
||||||
|
claimtrie.h \
|
||||||
clientversion.h \
|
clientversion.h \
|
||||||
coins.h \
|
coins.h \
|
||||||
compat.h \
|
compat.h \
|
||||||
|
@ -127,12 +129,14 @@ BITCOIN_CORE_H = \
|
||||||
key.h \
|
key.h \
|
||||||
key_io.h \
|
key_io.h \
|
||||||
keystore.h \
|
keystore.h \
|
||||||
|
lbry.h \
|
||||||
dbwrapper.h \
|
dbwrapper.h \
|
||||||
limitedmap.h \
|
limitedmap.h \
|
||||||
logging.h \
|
logging.h \
|
||||||
memusage.h \
|
memusage.h \
|
||||||
merkleblock.h \
|
merkleblock.h \
|
||||||
miner.h \
|
miner.h \
|
||||||
|
nameclaim.h \
|
||||||
net.h \
|
net.h \
|
||||||
net_processing.h \
|
net_processing.h \
|
||||||
netaddress.h \
|
netaddress.h \
|
||||||
|
@ -178,10 +182,12 @@ BITCOIN_CORE_H = \
|
||||||
txdb.h \
|
txdb.h \
|
||||||
txmempool.h \
|
txmempool.h \
|
||||||
ui_interface.h \
|
ui_interface.h \
|
||||||
|
uint256.h \
|
||||||
undo.h \
|
undo.h \
|
||||||
util.h \
|
util.h \
|
||||||
utilmemory.h \
|
utilmemory.h \
|
||||||
utilmoneystr.h \
|
utilmoneystr.h \
|
||||||
|
utilstrencodings.h \
|
||||||
utiltime.h \
|
utiltime.h \
|
||||||
validation.h \
|
validation.h \
|
||||||
validationinterface.h \
|
validationinterface.h \
|
||||||
|
@ -221,6 +227,9 @@ libbitcoin_server_a_SOURCES = \
|
||||||
blockencodings.cpp \
|
blockencodings.cpp \
|
||||||
chain.cpp \
|
chain.cpp \
|
||||||
checkpoints.cpp \
|
checkpoints.cpp \
|
||||||
|
claimscriptop.cpp \
|
||||||
|
claimtrie.cpp \
|
||||||
|
claimtrieforks.cpp \
|
||||||
consensus/tx_verify.cpp \
|
consensus/tx_verify.cpp \
|
||||||
httprpc.cpp \
|
httprpc.cpp \
|
||||||
httpserver.cpp \
|
httpserver.cpp \
|
||||||
|
@ -228,8 +237,10 @@ libbitcoin_server_a_SOURCES = \
|
||||||
index/txindex.cpp \
|
index/txindex.cpp \
|
||||||
init.cpp \
|
init.cpp \
|
||||||
dbwrapper.cpp \
|
dbwrapper.cpp \
|
||||||
|
lbry.cpp \
|
||||||
merkleblock.cpp \
|
merkleblock.cpp \
|
||||||
miner.cpp \
|
miner.cpp \
|
||||||
|
nameclaim.cpp \
|
||||||
net.cpp \
|
net.cpp \
|
||||||
net_processing.cpp \
|
net_processing.cpp \
|
||||||
noui.cpp \
|
noui.cpp \
|
||||||
|
@ -240,6 +251,7 @@ libbitcoin_server_a_SOURCES = \
|
||||||
pow.cpp \
|
pow.cpp \
|
||||||
rest.cpp \
|
rest.cpp \
|
||||||
rpc/blockchain.cpp \
|
rpc/blockchain.cpp \
|
||||||
|
rpc/claimtrie.cpp \
|
||||||
rpc/mining.cpp \
|
rpc/mining.cpp \
|
||||||
rpc/misc.cpp \
|
rpc/misc.cpp \
|
||||||
rpc/net.cpp \
|
rpc/net.cpp \
|
||||||
|
@ -253,6 +265,8 @@ libbitcoin_server_a_SOURCES = \
|
||||||
txdb.cpp \
|
txdb.cpp \
|
||||||
txmempool.cpp \
|
txmempool.cpp \
|
||||||
ui_interface.cpp \
|
ui_interface.cpp \
|
||||||
|
uint256.cpp \
|
||||||
|
utilstrencodings.cpp \
|
||||||
validation.cpp \
|
validation.cpp \
|
||||||
validationinterface.cpp \
|
validationinterface.cpp \
|
||||||
versionbits.cpp \
|
versionbits.cpp \
|
||||||
|
@ -383,6 +397,7 @@ libbitcoin_common_a_SOURCES = \
|
||||||
key.cpp \
|
key.cpp \
|
||||||
key_io.cpp \
|
key_io.cpp \
|
||||||
keystore.cpp \
|
keystore.cpp \
|
||||||
|
nameclaim.cpp \
|
||||||
netaddress.cpp \
|
netaddress.cpp \
|
||||||
netbase.cpp \
|
netbase.cpp \
|
||||||
policy/feerate.cpp \
|
policy/feerate.cpp \
|
||||||
|
@ -399,7 +414,7 @@ libbitcoin_common_a_SOURCES = \
|
||||||
# This library *must* be included to make sure that the glibc
|
# This library *must* be included to make sure that the glibc
|
||||||
# backward-compatibility objects and their sanity checks are linked.
|
# backward-compatibility objects and their sanity checks are linked.
|
||||||
libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||||
libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) $(CRYPTO_CFLAGS)
|
||||||
libbitcoin_util_a_SOURCES = \
|
libbitcoin_util_a_SOURCES = \
|
||||||
support/lockedpool.cpp \
|
support/lockedpool.cpp \
|
||||||
chainparamsbase.cpp \
|
chainparamsbase.cpp \
|
||||||
|
@ -416,6 +431,7 @@ libbitcoin_util_a_SOURCES = \
|
||||||
support/cleanse.cpp \
|
support/cleanse.cpp \
|
||||||
sync.cpp \
|
sync.cpp \
|
||||||
threadinterrupt.cpp \
|
threadinterrupt.cpp \
|
||||||
|
uint256.cpp \
|
||||||
util.cpp \
|
util.cpp \
|
||||||
utilmoneystr.cpp \
|
utilmoneystr.cpp \
|
||||||
utilstrencodings.cpp \
|
utilstrencodings.cpp \
|
||||||
|
@ -427,7 +443,7 @@ libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
|
||||||
AM_LDFLAGS += $(COMPAT_LDFLAGS)
|
AM_LDFLAGS += $(COMPAT_LDFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# cli: shared between bitcoin-cli and bitcoin-qt
|
# cli: shared between lbrycrd-cli and bitcoin-qt
|
||||||
libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||||
libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||||
libbitcoin_cli_a_SOURCES = \
|
libbitcoin_cli_a_SOURCES = \
|
||||||
|
@ -438,16 +454,16 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
|
||||||
#
|
#
|
||||||
|
|
||||||
# bitcoind binary #
|
# bitcoind binary #
|
||||||
bitcoind_SOURCES = bitcoind.cpp
|
lbrycrdd_SOURCES = bitcoind.cpp
|
||||||
bitcoind_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
lbrycrdd_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||||
bitcoind_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
lbrycrdd_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||||
bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
lbrycrdd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||||
|
|
||||||
if TARGET_WINDOWS
|
if TARGET_WINDOWS
|
||||||
bitcoind_SOURCES += bitcoind-res.rc
|
lbrycrdd_SOURCES += bitcoind-res.rc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bitcoind_LDADD = \
|
lbrycrdd_LDADD = \
|
||||||
$(LIBBITCOIN_SERVER) \
|
$(LIBBITCOIN_SERVER) \
|
||||||
$(LIBBITCOIN_WALLET) \
|
$(LIBBITCOIN_WALLET) \
|
||||||
$(LIBBITCOIN_COMMON) \
|
$(LIBBITCOIN_COMMON) \
|
||||||
|
@ -461,38 +477,38 @@ bitcoind_LDADD = \
|
||||||
$(LIBMEMENV) \
|
$(LIBMEMENV) \
|
||||||
$(LIBSECP256K1)
|
$(LIBSECP256K1)
|
||||||
|
|
||||||
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS)
|
lbrycrdd_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(ICU_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS)
|
||||||
|
|
||||||
# bitcoin-cli binary #
|
# lbrycrd-cli binary #
|
||||||
bitcoin_cli_SOURCES = bitcoin-cli.cpp
|
lbrycrd_cli_SOURCES = bitcoin-cli.cpp
|
||||||
bitcoin_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
|
lbrycrd_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
|
||||||
bitcoin_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
lbrycrd_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||||
bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
lbrycrd_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||||
|
|
||||||
if TARGET_WINDOWS
|
if TARGET_WINDOWS
|
||||||
bitcoin_cli_SOURCES += bitcoin-cli-res.rc
|
lbrycrd_cli_SOURCES += bitcoin-cli-res.rc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bitcoin_cli_LDADD = \
|
lbrycrd_cli_LDADD = \
|
||||||
$(LIBBITCOIN_CLI) \
|
$(LIBBITCOIN_CLI) \
|
||||||
$(LIBUNIVALUE) \
|
$(LIBUNIVALUE) \
|
||||||
$(LIBBITCOIN_UTIL) \
|
$(LIBBITCOIN_UTIL) \
|
||||||
$(LIBBITCOIN_CRYPTO)
|
$(LIBBITCOIN_CRYPTO)
|
||||||
|
|
||||||
bitcoin_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(EVENT_LIBS)
|
lbrycrd_cli_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) $(ICU_LIBS) $(EVENT_LIBS)
|
||||||
#
|
#
|
||||||
|
|
||||||
# bitcoin-tx binary #
|
# bitcoin-tx binary #
|
||||||
bitcoin_tx_SOURCES = bitcoin-tx.cpp
|
lbrycrd_tx_SOURCES = bitcoin-tx.cpp
|
||||||
bitcoin_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
lbrycrd_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||||
bitcoin_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
lbrycrd_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||||
bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
lbrycrd_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||||
|
|
||||||
if TARGET_WINDOWS
|
if TARGET_WINDOWS
|
||||||
bitcoin_tx_SOURCES += bitcoin-tx-res.rc
|
lbrycrd_tx_SOURCES += bitcoin-tx-res.rc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bitcoin_tx_LDADD = \
|
lbrycrd_tx_LDADD = \
|
||||||
$(LIBUNIVALUE) \
|
$(LIBUNIVALUE) \
|
||||||
$(LIBBITCOIN_COMMON) \
|
$(LIBBITCOIN_COMMON) \
|
||||||
$(LIBBITCOIN_UTIL) \
|
$(LIBBITCOIN_UTIL) \
|
||||||
|
@ -500,7 +516,7 @@ bitcoin_tx_LDADD = \
|
||||||
$(LIBBITCOIN_CRYPTO) \
|
$(LIBBITCOIN_CRYPTO) \
|
||||||
$(LIBSECP256K1)
|
$(LIBSECP256K1)
|
||||||
|
|
||||||
bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
|
lbrycrd_tx_LDADD += $(BOOST_LIBS) $(ICU_LIBS) $(CRYPTO_LIBS)
|
||||||
#
|
#
|
||||||
|
|
||||||
# bitcoinconsensus library #
|
# bitcoinconsensus library #
|
||||||
|
|
|
@ -55,7 +55,7 @@ if ENABLE_WALLET
|
||||||
bench_bench_bitcoin_SOURCES += bench/coin_selection.cpp
|
bench_bench_bitcoin_SOURCES += bench/coin_selection.cpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bench_bench_bitcoin_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
|
bench_bench_bitcoin_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(ICU_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
|
||||||
bench_bench_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
bench_bench_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||||
|
|
||||||
CLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno $(GENERATED_BENCH_FILES)
|
CLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno $(GENERATED_BENCH_FILES)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
bin_PROGRAMS += qt/bitcoin-qt
|
bin_PROGRAMS += qt/lbrycrd-qt
|
||||||
EXTRA_LIBRARIES += qt/libbitcoinqt.a
|
EXTRA_LIBRARIES += qt/libbitcoinqt.a
|
||||||
|
|
||||||
# bitcoin qt core #
|
# bitcoin qt core #
|
||||||
|
@ -366,7 +366,7 @@ BITCOIN_RC = qt/res/bitcoin-qt-res.rc
|
||||||
BITCOIN_QT_INCLUDES = -DQT_NO_KEYWORDS
|
BITCOIN_QT_INCLUDES = -DQT_NO_KEYWORDS
|
||||||
|
|
||||||
qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
|
qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
|
||||||
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)
|
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS) $(SSL_CFLAGS)
|
||||||
qt_libbitcoinqt_a_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
|
qt_libbitcoinqt_a_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
|
||||||
qt_libbitcoinqt_a_OBJCXXFLAGS = $(AM_OBJCXXFLAGS) $(QT_PIE_FLAGS)
|
qt_libbitcoinqt_a_OBJCXXFLAGS = $(AM_OBJCXXFLAGS) $(QT_PIE_FLAGS)
|
||||||
|
|
||||||
|
@ -382,37 +382,37 @@ QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:
|
||||||
# Most files will depend on the forms and moc files as includes. Generate them
|
# Most files will depend on the forms and moc files as includes. Generate them
|
||||||
# before anything else.
|
# before anything else.
|
||||||
$(QT_MOC): $(QT_FORMS_H)
|
$(QT_MOC): $(QT_FORMS_H)
|
||||||
$(qt_libbitcoinqt_a_OBJECTS) $(qt_bitcoin_qt_OBJECTS) : | $(QT_MOC)
|
$(qt_libbitcoinqt_a_OBJECTS) $(qt_lbrycrd_qt_OBJECTS) : | $(QT_MOC)
|
||||||
|
|
||||||
#Generating these with a half-written protobuf header leads to wacky results.
|
#Generating these with a half-written protobuf header leads to wacky results.
|
||||||
#This makes sure it's done.
|
#This makes sure it's done.
|
||||||
$(QT_MOC): $(PROTOBUF_H)
|
$(QT_MOC): $(PROTOBUF_H)
|
||||||
$(QT_MOC_CPP): $(PROTOBUF_H)
|
$(QT_MOC_CPP): $(PROTOBUF_H)
|
||||||
|
|
||||||
# bitcoin-qt binary #
|
# lbrycrd-qt binary #
|
||||||
qt_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
|
qt_lbrycrd_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
|
||||||
$(QT_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)
|
$(QT_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)
|
||||||
qt_bitcoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
|
qt_lbrycrd_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
|
||||||
|
|
||||||
qt_bitcoin_qt_SOURCES = qt/bitcoin.cpp
|
qt_lbrycrd_qt_SOURCES = qt/bitcoin.cpp
|
||||||
if TARGET_DARWIN
|
if TARGET_DARWIN
|
||||||
qt_bitcoin_qt_SOURCES += $(BITCOIN_MM)
|
qt_lbrycrd_qt_SOURCES += $(BITCOIN_MM)
|
||||||
endif
|
endif
|
||||||
if TARGET_WINDOWS
|
if TARGET_WINDOWS
|
||||||
qt_bitcoin_qt_SOURCES += $(BITCOIN_RC)
|
qt_lbrycrd_qt_SOURCES += $(BITCOIN_RC)
|
||||||
endif
|
endif
|
||||||
qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)
|
qt_lbrycrd_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)
|
||||||
if ENABLE_WALLET
|
if ENABLE_WALLET
|
||||||
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET)
|
qt_lbrycrd_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET)
|
||||||
endif
|
endif
|
||||||
if ENABLE_ZMQ
|
if ENABLE_ZMQ
|
||||||
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
|
qt_lbrycrd_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
|
||||||
endif
|
endif
|
||||||
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) \
|
qt_lbrycrd_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) \
|
||||||
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
|
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(ICU_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
|
||||||
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
|
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
|
||||||
qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
qt_lbrycrd_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||||
qt_bitcoin_qt_LIBTOOLFLAGS = $(AM_LIBTOOLFLAGS) --tag CXX
|
qt_lbrycrd_qt_LIBTOOLFLAGS = $(AM_LIBTOOLFLAGS) --tag CXX
|
||||||
|
|
||||||
#locale/foo.ts -> locale/foo.qm
|
#locale/foo.ts -> locale/foo.qm
|
||||||
QT_QM=$(QT_TS:.ts=.qm)
|
QT_QM=$(QT_TS:.ts=.qm)
|
||||||
|
@ -444,9 +444,9 @@ CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda
|
||||||
CLEANFILES += $(CLEAN_QT)
|
CLEANFILES += $(CLEAN_QT)
|
||||||
|
|
||||||
bitcoin_qt_clean: FORCE
|
bitcoin_qt_clean: FORCE
|
||||||
rm -f $(CLEAN_QT) $(qt_libbitcoinqt_a_OBJECTS) $(qt_bitcoin_qt_OBJECTS) qt/bitcoin-qt$(EXEEXT) $(LIBBITCOINQT)
|
rm -f $(CLEAN_QT) $(qt_libbitcoinqt_a_OBJECTS) $(qt_lbrycrd_qt_OBJECTS) qt/lbrycrd-qt$(EXEEXT) $(LIBBITCOINQT)
|
||||||
|
|
||||||
bitcoin_qt : qt/bitcoin-qt$(EXEEXT)
|
bitcoin_qt : qt/lbrycrd-qt$(EXEEXT)
|
||||||
|
|
||||||
ui_%.h: %.ui
|
ui_%.h: %.ui
|
||||||
@test -f $(UIC)
|
@test -f $(UIC)
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
bin_PROGRAMS += qt/test/test_bitcoin-qt
|
bin_PROGRAMS += qt/test/test_lbrycrd-qt
|
||||||
TESTS += qt/test/test_bitcoin-qt
|
TESTS += qt/test/test_lbrycrd-qt
|
||||||
|
|
||||||
TEST_QT_MOC_CPP = \
|
TEST_QT_MOC_CPP = \
|
||||||
qt/test/moc_compattests.cpp \
|
qt/test/moc_compattests.cpp \
|
||||||
|
@ -33,10 +33,10 @@ TEST_BITCOIN_CPP = \
|
||||||
TEST_BITCOIN_H = \
|
TEST_BITCOIN_H = \
|
||||||
test/test_bitcoin.h
|
test/test_bitcoin.h
|
||||||
|
|
||||||
qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
|
qt_test_test_lbrycrd_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
|
||||||
$(QT_INCLUDES) $(QT_TEST_INCLUDES) $(PROTOBUF_CFLAGS)
|
$(QT_INCLUDES) $(QT_TEST_INCLUDES) $(PROTOBUF_CFLAGS)
|
||||||
|
|
||||||
qt_test_test_bitcoin_qt_SOURCES = \
|
qt_test_test_lbrycrd_qt_SOURCES = \
|
||||||
qt/test/compattests.cpp \
|
qt/test/compattests.cpp \
|
||||||
qt/test/rpcnestedtests.cpp \
|
qt/test/rpcnestedtests.cpp \
|
||||||
qt/test/test_main.cpp \
|
qt/test/test_main.cpp \
|
||||||
|
@ -46,37 +46,37 @@ qt_test_test_bitcoin_qt_SOURCES = \
|
||||||
$(TEST_BITCOIN_CPP) \
|
$(TEST_BITCOIN_CPP) \
|
||||||
$(TEST_BITCOIN_H)
|
$(TEST_BITCOIN_H)
|
||||||
if ENABLE_WALLET
|
if ENABLE_WALLET
|
||||||
qt_test_test_bitcoin_qt_SOURCES += \
|
qt_test_test_lbrycrd_qt_SOURCES += \
|
||||||
qt/test/addressbooktests.cpp \
|
qt/test/addressbooktests.cpp \
|
||||||
qt/test/paymentservertests.cpp \
|
qt/test/paymentservertests.cpp \
|
||||||
qt/test/wallettests.cpp \
|
qt/test/wallettests.cpp \
|
||||||
wallet/test/wallet_test_fixture.cpp
|
wallet/test/wallet_test_fixture.cpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
nodist_qt_test_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP)
|
nodist_qt_test_test_lbrycrd_qt_SOURCES = $(TEST_QT_MOC_CPP)
|
||||||
|
|
||||||
qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER)
|
qt_test_test_lbrycrd_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER)
|
||||||
if ENABLE_WALLET
|
if ENABLE_WALLET
|
||||||
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET)
|
qt_test_test_lbrycrd_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET)
|
||||||
endif
|
endif
|
||||||
if ENABLE_ZMQ
|
if ENABLE_ZMQ
|
||||||
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
|
qt_test_test_lbrycrd_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
|
||||||
endif
|
endif
|
||||||
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \
|
qt_test_test_lbrycrd_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) \
|
$(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
|
||||||
$(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
|
$(QR_LIBS) $(PROTOBUF_LIBS) $(ICU_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
|
||||||
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
|
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
|
||||||
qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
qt_test_test_lbrycrd_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||||
qt_test_test_bitcoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
|
qt_test_test_lbrycrd_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
|
||||||
|
|
||||||
CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno
|
CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno
|
||||||
|
|
||||||
CLEANFILES += $(CLEAN_BITCOIN_QT_TEST)
|
CLEANFILES += $(CLEAN_BITCOIN_QT_TEST)
|
||||||
|
|
||||||
test_bitcoin_qt : qt/test/test_bitcoin-qt$(EXEEXT)
|
test_lbrycrd_qt : qt/test/test_bitcoin-qt$(EXEEXT)
|
||||||
|
|
||||||
test_bitcoin_qt_check : qt/test/test_bitcoin-qt$(EXEEXT) FORCE
|
test_lbrycrd_qt_check : qt/test/test_bitcoin-qt$(EXEEXT) FORCE
|
||||||
$(MAKE) check-TESTS TESTS=$^
|
$(MAKE) check-TESTS TESTS=$^
|
||||||
|
|
||||||
test_bitcoin_qt_clean: FORCE
|
test_lbrycrd_qt_clean: FORCE
|
||||||
rm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_bitcoin_qt_OBJECTS)
|
rm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_lbrycrd_qt_OBJECTS)
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
bin_PROGRAMS += test/test_bitcoin
|
bin_PROGRAMS += test/test_lbrycrd
|
||||||
noinst_PROGRAMS += test/test_bitcoin_fuzzy
|
noinst_PROGRAMS += test/test_lbrycrd_fuzzy
|
||||||
TEST_SRCDIR = test
|
TEST_SRCDIR = test
|
||||||
TEST_BINARY=test/test_bitcoin$(EXEEXT)
|
TEST_BINARY=test/test_lbrycrd$(EXEEXT)
|
||||||
|
|
||||||
JSON_TEST_FILES = \
|
JSON_TEST_FILES = \
|
||||||
test/data/base58_encode_decode.json \
|
test/data/base58_encode_decode.json \
|
||||||
|
test/data/base58_keys_valid.json \
|
||||||
test/data/key_io_valid.json \
|
test/data/key_io_valid.json \
|
||||||
test/data/key_io_invalid.json \
|
test/data/key_io_invalid.json \
|
||||||
test/data/script_tests.json \
|
test/data/script_tests.json \
|
||||||
|
@ -40,6 +41,7 @@ BITCOIN_TESTS =\
|
||||||
test/blockchain_tests.cpp \
|
test/blockchain_tests.cpp \
|
||||||
test/blockencodings_tests.cpp \
|
test/blockencodings_tests.cpp \
|
||||||
test/bloom_tests.cpp \
|
test/bloom_tests.cpp \
|
||||||
|
test/Checkpoints_tests.cpp \
|
||||||
test/bswap_tests.cpp \
|
test/bswap_tests.cpp \
|
||||||
test/checkqueue_tests.cpp \
|
test/checkqueue_tests.cpp \
|
||||||
test/coins_tests.cpp \
|
test/coins_tests.cpp \
|
||||||
|
@ -61,6 +63,9 @@ BITCOIN_TESTS =\
|
||||||
test/miner_tests.cpp \
|
test/miner_tests.cpp \
|
||||||
test/multisig_tests.cpp \
|
test/multisig_tests.cpp \
|
||||||
test/net_tests.cpp \
|
test/net_tests.cpp \
|
||||||
|
test/claimtriecache_tests.cpp \
|
||||||
|
test/claimtriebranching_tests.cpp \
|
||||||
|
test/nameclaim_tests.cpp \
|
||||||
test/netbase_tests.cpp \
|
test/netbase_tests.cpp \
|
||||||
test/pmt_tests.cpp \
|
test/pmt_tests.cpp \
|
||||||
test/policyestimator_tests.cpp \
|
test/policyestimator_tests.cpp \
|
||||||
|
@ -95,6 +100,7 @@ BITCOIN_TESTS =\
|
||||||
if ENABLE_WALLET
|
if ENABLE_WALLET
|
||||||
BITCOIN_TESTS += \
|
BITCOIN_TESTS += \
|
||||||
wallet/test/accounting_tests.cpp \
|
wallet/test/accounting_tests.cpp \
|
||||||
|
wallet/test/claim_rpc_tests.cpp \
|
||||||
wallet/test/db_tests.cpp \
|
wallet/test/db_tests.cpp \
|
||||||
wallet/test/psbt_wallet_tests.cpp \
|
wallet/test/psbt_wallet_tests.cpp \
|
||||||
wallet/test/wallet_tests.cpp \
|
wallet/test/wallet_tests.cpp \
|
||||||
|
@ -106,32 +112,32 @@ BITCOIN_TEST_SUITE += \
|
||||||
wallet/test/wallet_test_fixture.h
|
wallet/test/wallet_test_fixture.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test_test_bitcoin_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
|
test_test_lbrycrd_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
|
||||||
test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(EVENT_CFLAGS)
|
test_test_lbrycrd_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(EVENT_CFLAGS) $(ICU_CPPFLAGS)
|
||||||
test_test_bitcoin_LDADD =
|
test_test_lbrycrd_LDADD =
|
||||||
if ENABLE_WALLET
|
if ENABLE_WALLET
|
||||||
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
|
test_test_lbrycrd_LDADD += $(LIBBITCOIN_WALLET)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
|
test_test_lbrycrd_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
|
||||||
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
|
$(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_lbrycrd_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||||
|
|
||||||
test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
|
test_test_lbrycrd_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(CRYPTO_LIBS) $(ICU_LIBS) $(MINIUPNPC_LIBS)
|
||||||
test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
|
test_test_lbrycrd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
|
||||||
|
|
||||||
if ENABLE_ZMQ
|
if ENABLE_ZMQ
|
||||||
test_test_bitcoin_LDADD += $(ZMQ_LIBS)
|
test_test_lbrycrd_LDADD += $(ZMQ_LIBS)
|
||||||
endif
|
endif
|
||||||
#
|
#
|
||||||
|
|
||||||
# test_bitcoin_fuzzy binary #
|
# test_bitcoin_fuzzy binary #
|
||||||
test_test_bitcoin_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp
|
test_test_lbrycrd_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp
|
||||||
test_test_bitcoin_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
test_test_lbrycrd_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||||
test_test_bitcoin_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
test_test_lbrycrd_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||||
test_test_bitcoin_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
test_test_lbrycrd_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||||
|
|
||||||
test_test_bitcoin_fuzzy_LDADD = \
|
test_test_lbrycrd_fuzzy_LDADD = \
|
||||||
$(LIBUNIVALUE) \
|
$(LIBUNIVALUE) \
|
||||||
$(LIBBITCOIN_SERVER) \
|
$(LIBBITCOIN_SERVER) \
|
||||||
$(LIBBITCOIN_COMMON) \
|
$(LIBBITCOIN_COMMON) \
|
||||||
|
@ -143,10 +149,10 @@ test_test_bitcoin_fuzzy_LDADD = \
|
||||||
$(LIBBITCOIN_CRYPTO_SHANI) \
|
$(LIBBITCOIN_CRYPTO_SHANI) \
|
||||||
$(LIBSECP256K1)
|
$(LIBSECP256K1)
|
||||||
|
|
||||||
test_test_bitcoin_fuzzy_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
|
test_test_lbrycrd_fuzzy_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) $(ICU_LIBS)
|
||||||
#
|
#
|
||||||
|
|
||||||
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
|
nodist_test_test_lbrycrd_SOURCES = $(GENERATED_TEST_FILES)
|
||||||
|
|
||||||
$(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
|
$(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
|
||||||
|
|
||||||
|
@ -154,13 +160,13 @@ CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
|
||||||
|
|
||||||
CLEANFILES += $(CLEAN_BITCOIN_TEST)
|
CLEANFILES += $(CLEAN_BITCOIN_TEST)
|
||||||
|
|
||||||
bitcoin_test: $(TEST_BINARY)
|
lbrycrd_test: $(TEST_BINARY)
|
||||||
|
|
||||||
bitcoin_test_check: $(TEST_BINARY) FORCE
|
lbrycrd_test_check: $(TEST_BINARY) FORCE
|
||||||
$(MAKE) check-TESTS TESTS=$^
|
$(MAKE) check-TESTS TESTS=$^
|
||||||
|
|
||||||
bitcoin_test_clean : FORCE
|
lbrycrd_test_clean : FORCE
|
||||||
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
|
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_lbrycrd_OBJECTS) $(TEST_BINARY)
|
||||||
|
|
||||||
check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
|
check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
|
||||||
@echo "Running test/util/bitcoin-util-test.py..."
|
@echo "Running test/util/bitcoin-util-test.py..."
|
||||||
|
@ -185,3 +191,12 @@ endif
|
||||||
echo "};};"; \
|
echo "};};"; \
|
||||||
} > "$@.new" && mv -f "$@.new" "$@"
|
} > "$@.new" && mv -f "$@.new" "$@"
|
||||||
@echo "Generated $@"
|
@echo "Generated $@"
|
||||||
|
|
||||||
|
%.raw.h: %.raw
|
||||||
|
@$(MKDIR_P) $(@D)
|
||||||
|
@echo "namespace alert_tests{" > $@
|
||||||
|
@echo "static unsigned const char $(*F)[] = {" >> $@
|
||||||
|
@$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@
|
||||||
|
@echo "};};" >> $@
|
||||||
|
@echo "Generated $@"
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ static const CAmount CENT = 1000000;
|
||||||
* critical; in unusual circumstances like a(nother) overflow bug that allowed
|
* critical; in unusual circumstances like a(nother) overflow bug that allowed
|
||||||
* for the creation of coins out of thin air modification could lead to a fork.
|
* for the creation of coins out of thin air modification could lead to a fork.
|
||||||
* */
|
* */
|
||||||
static const CAmount MAX_MONEY = 21000000 * COIN;
|
static const CAmount MAX_MONEY = 21000000000 * COIN;
|
||||||
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
|
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
|
||||||
|
|
||||||
#endif // BITCOIN_AMOUNT_H
|
#endif // BITCOIN_AMOUNT_H
|
||||||
|
|
|
@ -41,7 +41,8 @@ static CTxIn MineBlock(const CScript& coinbase_scriptPubKey)
|
||||||
auto block = PrepareBlock(coinbase_scriptPubKey);
|
auto block = PrepareBlock(coinbase_scriptPubKey);
|
||||||
|
|
||||||
while (!CheckProofOfWork(block->GetHash(), block->nBits, Params().GetConsensus())) {
|
while (!CheckProofOfWork(block->GetHash(), block->nBits, Params().GetConsensus())) {
|
||||||
assert(++block->nNonce);
|
++block->nNonce;
|
||||||
|
assert(block->nNonce);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool processed{ProcessNewBlock(Params(), block, true, nullptr)};
|
bool processed{ProcessNewBlock(Params(), block, true, nullptr)};
|
||||||
|
|
|
@ -16,14 +16,14 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "040904E4" // U.S. English - multilingual (hex)
|
BLOCK "040904E4" // U.S. English - multilingual (hex)
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Bitcoin"
|
VALUE "CompanyName", "LBRY"
|
||||||
VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for " PACKAGE_NAME ")"
|
VALUE "FileDescription", "lbrycrd-cli (JSON-RPC client for " PACKAGE_NAME ")"
|
||||||
VALUE "FileVersion", VER_FILEVERSION_STR
|
VALUE "FileVersion", VER_FILEVERSION_STR
|
||||||
VALUE "InternalName", "bitcoin-cli"
|
VALUE "InternalName", "lbrycrd-cli"
|
||||||
VALUE "LegalCopyright", COPYRIGHT_STR
|
VALUE "LegalCopyright", COPYRIGHT_STR
|
||||||
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
|
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
|
||||||
VALUE "OriginalFilename", "bitcoin-cli.exe"
|
VALUE "OriginalFilename", "lbrycrd-cli.exe"
|
||||||
VALUE "ProductName", "bitcoin-cli"
|
VALUE "ProductName", "lbrycrd-cli"
|
||||||
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
|
@ -48,7 +48,7 @@ static void SetupCliArgs()
|
||||||
gArgs.AddArg("-rpcport=<port>", strprintf("Connect to JSON-RPC on <port> (default: %u or testnet: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort()), false, OptionsCategory::OPTIONS);
|
gArgs.AddArg("-rpcport=<port>", strprintf("Connect to JSON-RPC on <port> (default: %u or testnet: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort()), false, OptionsCategory::OPTIONS);
|
||||||
gArgs.AddArg("-rpcuser=<user>", "Username for JSON-RPC connections", false, OptionsCategory::OPTIONS);
|
gArgs.AddArg("-rpcuser=<user>", "Username for JSON-RPC connections", false, OptionsCategory::OPTIONS);
|
||||||
gArgs.AddArg("-rpcwait", "Wait for RPC server to start", false, OptionsCategory::OPTIONS);
|
gArgs.AddArg("-rpcwait", "Wait for RPC server to start", false, OptionsCategory::OPTIONS);
|
||||||
gArgs.AddArg("-rpcwallet=<walletname>", "Send RPC for non-default wallet on RPC server (needs to exactly match corresponding -wallet option passed to bitcoind)", false, OptionsCategory::OPTIONS);
|
gArgs.AddArg("-rpcwallet=<walletname>", "Send RPC for non-default wallet on RPC server (needs to exactly match corresponding -wallet option passed to lbrycrdd)", false, OptionsCategory::OPTIONS);
|
||||||
gArgs.AddArg("-stdin", "Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases). When combined with -stdinrpcpass, the first line from standard input is used for the RPC password.", false, OptionsCategory::OPTIONS);
|
gArgs.AddArg("-stdin", "Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases). When combined with -stdinrpcpass, the first line from standard input is used for the RPC password.", false, OptionsCategory::OPTIONS);
|
||||||
gArgs.AddArg("-stdinrpcpass", "Read RPC password from standard input as a single line. When combined with -stdin, the first line from standard input is used for the RPC password.", false, OptionsCategory::OPTIONS);
|
gArgs.AddArg("-stdinrpcpass", "Read RPC password from standard input as a single line. When combined with -stdin, the first line from standard input is used for the RPC password.", false, OptionsCategory::OPTIONS);
|
||||||
|
|
||||||
|
@ -107,10 +107,10 @@ static int AppInitRPC(int argc, char* argv[])
|
||||||
std::string strUsage = PACKAGE_NAME " RPC client version " + FormatFullVersion() + "\n";
|
std::string strUsage = PACKAGE_NAME " RPC client version " + FormatFullVersion() + "\n";
|
||||||
if (!gArgs.IsArgSet("-version")) {
|
if (!gArgs.IsArgSet("-version")) {
|
||||||
strUsage += "\n"
|
strUsage += "\n"
|
||||||
"Usage: bitcoin-cli [options] <command> [params] Send command to " PACKAGE_NAME "\n"
|
"Usage: lbrycrd-cli [options] <command> [params] Send command to " PACKAGE_NAME "\n"
|
||||||
"or: bitcoin-cli [options] -named <command> [name=value]... Send command to " PACKAGE_NAME " (with named arguments)\n"
|
"or: lbrycrd-cli [options] -named <command> [name=value]... Send command to " PACKAGE_NAME " (with named arguments)\n"
|
||||||
"or: bitcoin-cli [options] help List commands\n"
|
"or: lbrycrd-cli [options] help List commands\n"
|
||||||
"or: bitcoin-cli [options] help <command> Get help for a command\n";
|
"or: lbrycrd-cli [options] help <command> Get help for a command\n";
|
||||||
strUsage += "\n" + gArgs.GetHelpMessage();
|
strUsage += "\n" + gArgs.GetHelpMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ static UniValue CallRPC(BaseRequestHandler *rh, const std::string& strMethod, co
|
||||||
if (response.error != -1) {
|
if (response.error != -1) {
|
||||||
responseErrorMessage = strprintf(" (error code %d - \"%s\")", response.error, http_errorstring(response.error));
|
responseErrorMessage = strprintf(" (error code %d - \"%s\")", response.error, http_errorstring(response.error));
|
||||||
}
|
}
|
||||||
throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\nMake sure the bitcoind server is running and that you are connecting to the correct RPC port.", host, port, responseErrorMessage));
|
throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\nMake sure the lbrycrdd server is running and that you are connecting to the correct RPC port.", host, port, responseErrorMessage));
|
||||||
} else if (response.status == HTTP_UNAUTHORIZED) {
|
} else if (response.status == HTTP_UNAUTHORIZED) {
|
||||||
if (failedToGetAuthCookie) {
|
if (failedToGetAuthCookie) {
|
||||||
throw std::runtime_error(strprintf(
|
throw std::runtime_error(strprintf(
|
||||||
|
@ -470,7 +470,7 @@ static int CommandLineRPC(int argc, char *argv[])
|
||||||
strPrint += "error message:\n"+errMsg.get_str();
|
strPrint += "error message:\n"+errMsg.get_str();
|
||||||
|
|
||||||
if (errCode.isNum() && errCode.get_int() == RPC_WALLET_NOT_SPECIFIED) {
|
if (errCode.isNum() && errCode.get_int() == RPC_WALLET_NOT_SPECIFIED) {
|
||||||
strPrint += "\nTry adding \"-rpcwallet=<filename>\" option to bitcoin-cli command line.";
|
strPrint += "\nTry adding \"-rpcwallet=<filename>\" option to lbrycrd-cli command line.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -16,14 +16,14 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "040904E4" // U.S. English - multilingual (hex)
|
BLOCK "040904E4" // U.S. English - multilingual (hex)
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Bitcoin"
|
VALUE "CompanyName", "LBRY"
|
||||||
VALUE "FileDescription", "bitcoin-tx (CLI Bitcoin transaction editor utility)"
|
VALUE "FileDescription", "lbrycrd-tx (CLI LBRYcrd transaction editor utility)"
|
||||||
VALUE "FileVersion", VER_FILEVERSION_STR
|
VALUE "FileVersion", VER_FILEVERSION_STR
|
||||||
VALUE "InternalName", "bitcoin-tx"
|
VALUE "InternalName", "lbrycrd-tx"
|
||||||
VALUE "LegalCopyright", COPYRIGHT_STR
|
VALUE "LegalCopyright", COPYRIGHT_STR
|
||||||
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
|
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
|
||||||
VALUE "OriginalFilename", "bitcoin-tx.exe"
|
VALUE "OriginalFilename", "lbrycrd-tx.exe"
|
||||||
VALUE "ProductName", "bitcoin-tx"
|
VALUE "ProductName", "lbrycrd-tx"
|
||||||
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
|
@ -98,9 +98,9 @@ static int AppInitRawTx(int argc, char* argv[])
|
||||||
|
|
||||||
if (argc < 2 || HelpRequested(gArgs)) {
|
if (argc < 2 || HelpRequested(gArgs)) {
|
||||||
// First part of help message is specific to this utility
|
// First part of help message is specific to this utility
|
||||||
std::string strUsage = PACKAGE_NAME " bitcoin-tx utility version " + FormatFullVersion() + "\n\n" +
|
std::string strUsage = PACKAGE_NAME " lbrycrd-tx utility version " + FormatFullVersion() + "\n\n" +
|
||||||
"Usage: bitcoin-tx [options] <hex-tx> [commands] Update hex-encoded bitcoin transaction\n" +
|
"Usage: lbrycrd-tx [options] <hex-tx> [commands] Update hex-encoded lbrycrd transaction\n" +
|
||||||
"or: bitcoin-tx [options] -create [commands] Create hex-encoded bitcoin transaction\n" +
|
"or: lbrycrd-tx [options] -create [commands] Create hex-encoded lbrycrd transaction\n" +
|
||||||
"\n";
|
"\n";
|
||||||
strUsage += gArgs.GetHelpMessage();
|
strUsage += gArgs.GetHelpMessage();
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,14 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "040904E4" // U.S. English - multilingual (hex)
|
BLOCK "040904E4" // U.S. English - multilingual (hex)
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Bitcoin"
|
VALUE "CompanyName", "LBRY"
|
||||||
VALUE "FileDescription", "bitcoind (Bitcoin node with a JSON-RPC server)"
|
VALUE "FileDescription", "lbrycrdd (LBRYcrd node with a JSON-RPC server)"
|
||||||
VALUE "FileVersion", VER_FILEVERSION_STR
|
VALUE "FileVersion", VER_FILEVERSION_STR
|
||||||
VALUE "InternalName", "bitcoind"
|
VALUE "InternalName", "lbrycrdd"
|
||||||
VALUE "LegalCopyright", COPYRIGHT_STR
|
VALUE "LegalCopyright", COPYRIGHT_STR
|
||||||
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
|
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
|
||||||
VALUE "OriginalFilename", "bitcoind.exe"
|
VALUE "OriginalFilename", "lbrycrdd.exe"
|
||||||
VALUE "ProductName", "bitcoind"
|
VALUE "ProductName", "lbrycrdd"
|
||||||
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
|
@ -61,7 +61,7 @@ static bool AppInit(int argc, char* argv[])
|
||||||
//
|
//
|
||||||
// Parameters
|
// Parameters
|
||||||
//
|
//
|
||||||
// If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main()
|
// If Qt is used, parameters/lbrycrd.conf are parsed in qt/bitcoin.cpp's main()
|
||||||
SetupServerArgs();
|
SetupServerArgs();
|
||||||
std::string error;
|
std::string error;
|
||||||
if (!gArgs.ParseParameters(argc, argv, error)) {
|
if (!gArgs.ParseParameters(argc, argv, error)) {
|
||||||
|
@ -79,7 +79,7 @@ static bool AppInit(int argc, char* argv[])
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strUsage += "\nUsage: bitcoind [options] Start " PACKAGE_NAME " Daemon\n";
|
strUsage += "\nUsage: lbrycrdd [options] Start " PACKAGE_NAME " Daemon\n";
|
||||||
strUsage += "\n" + gArgs.GetHelpMessage();
|
strUsage += "\n" + gArgs.GetHelpMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,12 +109,12 @@ static bool AppInit(int argc, char* argv[])
|
||||||
// Error out when loose non-argument tokens are encountered on command line
|
// Error out when loose non-argument tokens are encountered on command line
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
if (!IsSwitchChar(argv[i][0])) {
|
if (!IsSwitchChar(argv[i][0])) {
|
||||||
fprintf(stderr, "Error: Command line contains unexpected token '%s', see bitcoind -h for a list of options.\n", argv[i]);
|
fprintf(stderr, "Error: Command line contains unexpected token '%s', see lbrycrdd -h for a list of options.\n", argv[i]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -server defaults to true for bitcoind but not for the GUI so do this here
|
// -server defaults to true for lbrycrdd but not for the GUI so do this here
|
||||||
gArgs.SoftSetBoolArg("-server", true);
|
gArgs.SoftSetBoolArg("-server", true);
|
||||||
// Set this early so that parameter interactions go to console
|
// Set this early so that parameter interactions go to console
|
||||||
InitLogging();
|
InitLogging();
|
||||||
|
@ -141,7 +141,7 @@ static bool AppInit(int argc, char* argv[])
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
#endif
|
#endif
|
||||||
fprintf(stdout, "Bitcoin server starting\n");
|
fprintf(stdout, "LBRYcrd server starting\n");
|
||||||
|
|
||||||
// Daemonize
|
// Daemonize
|
||||||
if (daemon(1, 0)) { // don't chdir (1), do close FDs (0)
|
if (daemon(1, 0)) { // don't chdir (1), do close FDs (0)
|
||||||
|
@ -185,7 +185,7 @@ int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
SetupEnvironment();
|
SetupEnvironment();
|
||||||
|
|
||||||
// Connect bitcoind signal handlers
|
// Connect lbrycrdd signal handlers
|
||||||
noui_connect();
|
noui_connect();
|
||||||
|
|
||||||
return (AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
|
return (AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||||
|
|
18
src/chain.h
18
src/chain.h
|
@ -209,6 +209,7 @@ public:
|
||||||
//! block header
|
//! block header
|
||||||
int32_t nVersion;
|
int32_t nVersion;
|
||||||
uint256 hashMerkleRoot;
|
uint256 hashMerkleRoot;
|
||||||
|
uint256 hashClaimTrie;
|
||||||
uint32_t nTime;
|
uint32_t nTime;
|
||||||
uint32_t nBits;
|
uint32_t nBits;
|
||||||
uint32_t nNonce;
|
uint32_t nNonce;
|
||||||
|
@ -237,6 +238,7 @@ public:
|
||||||
|
|
||||||
nVersion = 0;
|
nVersion = 0;
|
||||||
hashMerkleRoot = uint256();
|
hashMerkleRoot = uint256();
|
||||||
|
hashClaimTrie = uint256();
|
||||||
nTime = 0;
|
nTime = 0;
|
||||||
nBits = 0;
|
nBits = 0;
|
||||||
nNonce = 0;
|
nNonce = 0;
|
||||||
|
@ -253,6 +255,7 @@ public:
|
||||||
|
|
||||||
nVersion = block.nVersion;
|
nVersion = block.nVersion;
|
||||||
hashMerkleRoot = block.hashMerkleRoot;
|
hashMerkleRoot = block.hashMerkleRoot;
|
||||||
|
hashClaimTrie = block.hashClaimTrie;
|
||||||
nTime = block.nTime;
|
nTime = block.nTime;
|
||||||
nBits = block.nBits;
|
nBits = block.nBits;
|
||||||
nNonce = block.nNonce;
|
nNonce = block.nNonce;
|
||||||
|
@ -283,6 +286,7 @@ public:
|
||||||
if (pprev)
|
if (pprev)
|
||||||
block.hashPrevBlock = pprev->GetBlockHash();
|
block.hashPrevBlock = pprev->GetBlockHash();
|
||||||
block.hashMerkleRoot = hashMerkleRoot;
|
block.hashMerkleRoot = hashMerkleRoot;
|
||||||
|
block.hashClaimTrie = hashClaimTrie;
|
||||||
block.nTime = nTime;
|
block.nTime = nTime;
|
||||||
block.nBits = nBits;
|
block.nBits = nBits;
|
||||||
block.nNonce = nNonce;
|
block.nNonce = nNonce;
|
||||||
|
@ -294,6 +298,11 @@ public:
|
||||||
return *phashBlock;
|
return *phashBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint256 GetBlockPoWHash() const
|
||||||
|
{
|
||||||
|
return GetBlockHeader().GetPoWHash();
|
||||||
|
}
|
||||||
|
|
||||||
int64_t GetBlockTime() const
|
int64_t GetBlockTime() const
|
||||||
{
|
{
|
||||||
return (int64_t)nTime;
|
return (int64_t)nTime;
|
||||||
|
@ -322,9 +331,10 @@ public:
|
||||||
|
|
||||||
std::string ToString() const
|
std::string ToString() const
|
||||||
{
|
{
|
||||||
return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
|
return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, claimtrie=%s, hashBlock=%s)",
|
||||||
pprev, nHeight,
|
pprev, nHeight,
|
||||||
hashMerkleRoot.ToString(),
|
hashMerkleRoot.ToString(),
|
||||||
|
hashClaimTrie.ToString(),
|
||||||
GetBlockHash().ToString());
|
GetBlockHash().ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,6 +412,7 @@ public:
|
||||||
READWRITE(this->nVersion);
|
READWRITE(this->nVersion);
|
||||||
READWRITE(hashPrev);
|
READWRITE(hashPrev);
|
||||||
READWRITE(hashMerkleRoot);
|
READWRITE(hashMerkleRoot);
|
||||||
|
READWRITE(hashClaimTrie);
|
||||||
READWRITE(nTime);
|
READWRITE(nTime);
|
||||||
READWRITE(nBits);
|
READWRITE(nBits);
|
||||||
READWRITE(nNonce);
|
READWRITE(nNonce);
|
||||||
|
@ -413,19 +424,20 @@ public:
|
||||||
block.nVersion = nVersion;
|
block.nVersion = nVersion;
|
||||||
block.hashPrevBlock = hashPrev;
|
block.hashPrevBlock = hashPrev;
|
||||||
block.hashMerkleRoot = hashMerkleRoot;
|
block.hashMerkleRoot = hashMerkleRoot;
|
||||||
|
block.hashClaimTrie = hashClaimTrie;
|
||||||
block.nTime = nTime;
|
block.nTime = nTime;
|
||||||
block.nBits = nBits;
|
block.nBits = nBits;
|
||||||
block.nNonce = nNonce;
|
block.nNonce = nNonce;
|
||||||
return block.GetHash();
|
return block.GetHash();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string ToString() const
|
std::string ToString() const
|
||||||
{
|
{
|
||||||
std::string str = "CDiskBlockIndex(";
|
std::string str = "CDiskBlockIndex(";
|
||||||
str += CBlockIndex::ToString();
|
str += CBlockIndex::ToString();
|
||||||
str += strprintf("\n hashBlock=%s, hashPrev=%s)",
|
str += strprintf("\n hashBlock=%s, hashClaimTrie=%s, hashPrev=%s)",
|
||||||
GetBlockHash().ToString(),
|
GetBlockHash().ToString(),
|
||||||
|
hashClaimTrie.ToString(),
|
||||||
hashPrev.ToString());
|
hashPrev.ToString());
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,38 @@
|
||||||
|
|
||||||
#include <chainparamsseeds.h>
|
#include <chainparamsseeds.h>
|
||||||
|
|
||||||
|
//#define FIND_GENESIS
|
||||||
|
|
||||||
|
#define GENESIS_MERKLE_ROOT "b8211c82c3d15bcd78bba57005b86fed515149a53a425eb592c07af99fe559cc"
|
||||||
|
|
||||||
|
#define MAINNET_GENESIS_HASH "9c89283ba0f3227f6c03b70216b9f665f0118d5e0fa729cedf4fb34d6a34f463"
|
||||||
|
#define MAINNET_GENESIS_NONCE 1287
|
||||||
|
|
||||||
|
#define TESTNET_GENESIS_HASH "9c89283ba0f3227f6c03b70216b9f665f0118d5e0fa729cedf4fb34d6a34f463"
|
||||||
|
#define TESTNET_GENESIS_NONCE 1287
|
||||||
|
|
||||||
|
#define REGTEST_GENESIS_HASH "6e3fcf1299d4ec5d79c3a4c91d624a4acf9e2e173d95a1a0504f677669687556"
|
||||||
|
#define REGTEST_GENESIS_NONCE 1
|
||||||
|
|
||||||
|
bool CheckProofOfWork2(uint256 hash, unsigned int nBits, const Consensus::Params& params)
|
||||||
|
{
|
||||||
|
bool fNegative;
|
||||||
|
bool fOverflow;
|
||||||
|
arith_uint256 bnTarget;
|
||||||
|
|
||||||
|
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
|
||||||
|
|
||||||
|
// Check range
|
||||||
|
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
|
||||||
|
return error("CheckProofOfWork(): nBits below minimum work");
|
||||||
|
|
||||||
|
// Check proof of work matches claimed amount
|
||||||
|
if (UintToArith256(hash) > bnTarget)
|
||||||
|
return error("CheckProofOfWork(): hash doesn't match nBits");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
|
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
|
||||||
{
|
{
|
||||||
CMutableTransaction txNew;
|
CMutableTransaction txNew;
|
||||||
|
@ -22,6 +54,9 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesi
|
||||||
txNew.vout.resize(1);
|
txNew.vout.resize(1);
|
||||||
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
|
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
|
||||||
txNew.vout[0].nValue = genesisReward;
|
txNew.vout[0].nValue = genesisReward;
|
||||||
|
//txNew.vout[0].scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
|
||||||
|
//txNew.vout[0].scriptPubKey = CScript() << ParseHex("0425caecb9fbf6cf50979644e85c11e3ec9007fd477fab9683648c6539e59b59c3a4d9b9c0b552c37eee6476f3e0d8425ac0346fe69ad61628b8c340d42fbfa3fd") << OP_CHECKSIG;
|
||||||
|
//txNew.vout[0].scriptPubKey = CScript() << OP_DUP << OP_HASH160 << ParseHex("e5ff2d9e3a254622ae493573169c0fa94c82fe4f") << OP_EQUALVERIFY << OP_CHECKSIG;
|
||||||
txNew.vout[0].scriptPubKey = genesisOutputScript;
|
txNew.vout[0].scriptPubKey = genesisOutputScript;
|
||||||
|
|
||||||
CBlock genesis;
|
CBlock genesis;
|
||||||
|
@ -32,6 +67,21 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesi
|
||||||
genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
|
genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
|
||||||
genesis.hashPrevBlock.SetNull();
|
genesis.hashPrevBlock.SetNull();
|
||||||
genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
|
genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
|
||||||
|
genesis.hashClaimTrie = uint256S("0x0000000000000000000000000000000000000000000000000000000000000001");
|
||||||
|
|
||||||
|
#ifdef FIND_GENESIS
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
genesis.nNonce += 1;
|
||||||
|
if (CheckProofOfWork2(genesis.GetPoWHash(), nBits, consensus))
|
||||||
|
{
|
||||||
|
std::cout << "nonce: " << genesis.nNonce << std::endl;
|
||||||
|
std::cout << "hex: " << genesis.GetHash().GetHex() << std::endl;
|
||||||
|
std::cout << "pow hash: " << genesis.GetPoWHash().GetHex() << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return genesis;
|
return genesis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,8 +98,8 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesi
|
||||||
*/
|
*/
|
||||||
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
|
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
|
||||||
{
|
{
|
||||||
const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
|
const char* pszTimestamp = "insert timestamp string";//"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
|
||||||
const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
|
const CScript genesisOutputScript = CScript() << OP_DUP << OP_HASH160 << ParseHex("345991dbf57bfb014b87006acdfafbfc5fe8292f") << OP_EQUALVERIFY << OP_CHECKSIG;
|
||||||
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
|
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,16 +123,26 @@ void CChainParams::UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64
|
||||||
class CMainParams : public CChainParams {
|
class CMainParams : public CChainParams {
|
||||||
public:
|
public:
|
||||||
CMainParams() {
|
CMainParams() {
|
||||||
strNetworkID = "main";
|
strNetworkID = "lbrycrd";
|
||||||
consensus.nSubsidyHalvingInterval = 210000;
|
consensus.nSubsidyLevelInterval = 1<<5;
|
||||||
|
consensus.nMajorityEnforceBlockUpgrade = 750;
|
||||||
|
consensus.nMajorityRejectBlockOutdated = 950;
|
||||||
|
consensus.nMajorityWindow = 1000;
|
||||||
consensus.BIP16Exception = uint256S("0x00000000000002dc756eebf4f49723ed8d30cc28a5f108eb94b1ba88ac4f9c22");
|
consensus.BIP16Exception = uint256S("0x00000000000002dc756eebf4f49723ed8d30cc28a5f108eb94b1ba88ac4f9c22");
|
||||||
consensus.BIP34Height = 227931;
|
consensus.BIP34Height = 1;
|
||||||
consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8");
|
consensus.BIP34Hash = uint256S("0xdecb9e2cca03a419fd9cca0cb2b1d5ad11b088f22f8f38556d93ac4358b86c24");
|
||||||
consensus.BIP65Height = 388381; // 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0
|
// FIXME: adjust heights
|
||||||
consensus.BIP66Height = 363725; // 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931
|
consensus.BIP65Height = 600000;
|
||||||
consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
consensus.BIP66Height = 600000;
|
||||||
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
|
consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||||
consensus.nPowTargetSpacing = 10 * 60;
|
consensus.nPowTargetTimespan = 150; //retarget every block
|
||||||
|
consensus.nPowTargetSpacing = 150;
|
||||||
|
consensus.nOriginalClaimExpirationTime = 262974;
|
||||||
|
consensus.nExtendedClaimExpirationTime = 2102400;
|
||||||
|
consensus.nExtendedClaimExpirationForkHeight = 400155;
|
||||||
|
consensus.nAllowMinDiffMinHeight = -1;
|
||||||
|
consensus.nAllowMinDiffMaxHeight = -1;
|
||||||
|
consensus.nNormalizedNameForkHeight = 539940; // targeting 21 March 2019
|
||||||
consensus.fPowAllowMinDifficultyBlocks = false;
|
consensus.fPowAllowMinDifficultyBlocks = false;
|
||||||
consensus.fPowNoRetargeting = false;
|
consensus.fPowNoRetargeting = false;
|
||||||
consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
|
consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
|
||||||
|
@ -98,82 +158,73 @@ public:
|
||||||
|
|
||||||
// Deployment of SegWit (BIP141, BIP143, and BIP147)
|
// Deployment of SegWit (BIP141, BIP143, and BIP147)
|
||||||
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
|
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
|
||||||
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1479168000; // November 15th, 2016.
|
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1547942400; // Jan 20, 2019
|
||||||
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1510704000; // November 15th, 2017.
|
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1548288000; // Jan 24, 2019
|
||||||
|
|
||||||
// The best chain should have at least this much work.
|
// The best chain should have at least this much work.
|
||||||
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000028822fef1c230963535a90d");
|
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000607ca7e806c4c1e9"); //400000
|
||||||
|
|
||||||
// By default assume that the signatures in ancestors of this block are valid.
|
// By default assume that the signatures in ancestors of this block are valid.
|
||||||
consensus.defaultAssumeValid = uint256S("0x0000000000000000002e63058c023a9a1de233554f28c7b21380b6c9003f36a8"); //534292
|
//consensus.defaultAssumeValid = uint256S("0xf0e56e70782af63ccb49c76e852540688755869ba59ec68cac9c04a6b4d9f5ca"); //400000
|
||||||
|
consensus.defaultAssumeValid = uint256S("0xa6bbb48f5343eb9b0287c22f3ea8b29f36cf10794a37f8a925a894d6f4519913"); //4000
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The message start string is designed to be unlikely to occur in normal data.
|
* The message start string is designed to be unlikely to occur in normal data.
|
||||||
* The characters are rarely used upper ASCII, not valid as UTF-8, and produce
|
* The characters are rarely used upper ASCII, not valid as UTF-8, and produce
|
||||||
* a large 32-bit integer with any alignment.
|
* a large 32-bit integer with any alignment.
|
||||||
*/
|
*/
|
||||||
pchMessageStart[0] = 0xf9;
|
pchMessageStart[0] = 0xfa;
|
||||||
pchMessageStart[1] = 0xbe;
|
pchMessageStart[1] = 0xe4;
|
||||||
pchMessageStart[2] = 0xb4;
|
pchMessageStart[2] = 0xaa;
|
||||||
pchMessageStart[3] = 0xd9;
|
pchMessageStart[3] = 0xf1;
|
||||||
nDefaultPort = 8333;
|
nDefaultPort = 9246;
|
||||||
nPruneAfterHeight = 100000;
|
nPruneAfterHeight = 100000;
|
||||||
|
|
||||||
genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN);
|
genesis = CreateGenesisBlock(1446058291, MAINNET_GENESIS_NONCE, 0x1f00ffff, 1, 400000000 * COIN);
|
||||||
consensus.hashGenesisBlock = genesis.GetHash();
|
consensus.hashGenesisBlock = genesis.GetHash();
|
||||||
assert(consensus.hashGenesisBlock == uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"));
|
#ifdef FIND_GENESIS
|
||||||
assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
|
std::cout << "hex: " << consensus.hashGenesisBlock.GetHex() << std::endl;
|
||||||
|
std::cout << "merkle root: " << genesis.hashMerkleRoot.GetHex() << std::endl;
|
||||||
|
#else
|
||||||
|
assert(consensus.hashGenesisBlock == uint256S(MAINNET_GENESIS_HASH));
|
||||||
|
assert(genesis.hashMerkleRoot == uint256S(GENESIS_MERKLE_ROOT));
|
||||||
|
#endif
|
||||||
|
vSeeds.clear();
|
||||||
|
vFixedSeeds.clear();
|
||||||
|
|
||||||
// Note that of those which support the service bits prefix, most only support a subset of
|
vSeeds.emplace_back("dnsseed1.lbry.io"); // lbry.io
|
||||||
// possible options.
|
vSeeds.emplace_back("dnsseed2.lbry.io"); // lbry.io
|
||||||
// This is fine at runtime as we'll fall back to using them as a oneshot if they don't support the
|
vSeeds.emplace_back("dnsseed3.lbry.io"); // lbry.io
|
||||||
// service bits we want, but we should get them updated to support all service bits wanted by any
|
|
||||||
// release ASAP to avoid it where possible.
|
|
||||||
vSeeds.emplace_back("seed.bitcoin.sipa.be"); // Pieter Wuille, only supports x1, x5, x9, and xd
|
|
||||||
vSeeds.emplace_back("dnsseed.bluematt.me"); // Matt Corallo, only supports x9
|
|
||||||
vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org"); // Luke Dashjr
|
|
||||||
vSeeds.emplace_back("seed.bitcoinstats.com"); // Christian Decker, supports x1 - xf
|
|
||||||
vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch"); // Jonas Schnelli, only supports x1, x5, x9, and xd
|
|
||||||
vSeeds.emplace_back("seed.btc.petertodd.org"); // Peter Todd, only supports x1, x5, x9, and xd
|
|
||||||
vSeeds.emplace_back("seed.bitcoin.sprovoost.nl"); // Sjors Provoost
|
|
||||||
|
|
||||||
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,0);
|
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1, 0x55);
|
||||||
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
|
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1, 0x7a);
|
||||||
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,128);
|
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1, 0x1c);
|
||||||
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
|
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
|
||||||
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
|
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
|
||||||
|
|
||||||
|
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
|
||||||
|
|
||||||
bech32_hrp = "bc";
|
bech32_hrp = "bc";
|
||||||
|
|
||||||
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
|
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
|
||||||
|
|
||||||
|
fMiningRequiresPeers = true;
|
||||||
fDefaultConsistencyChecks = false;
|
fDefaultConsistencyChecks = false;
|
||||||
fRequireStandard = true;
|
fRequireStandard = true;
|
||||||
fMineBlocksOnDemand = false;
|
fMineBlocksOnDemand = false;
|
||||||
|
|
||||||
checkpointData = {
|
checkpointData = {
|
||||||
{
|
{
|
||||||
{ 11111, uint256S("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")},
|
{ 4000, uint256S("0xa6bbb48f5343eb9b0287c22f3ea8b29f36cf10794a37f8a925a894d6f4519913") },
|
||||||
{ 33333, uint256S("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")},
|
|
||||||
{ 74000, uint256S("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")},
|
|
||||||
{105000, uint256S("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")},
|
|
||||||
{134444, uint256S("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")},
|
|
||||||
{168000, uint256S("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763")},
|
|
||||||
{193000, uint256S("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")},
|
|
||||||
{210000, uint256S("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")},
|
|
||||||
{216116, uint256S("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")},
|
|
||||||
{225430, uint256S("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")},
|
|
||||||
{250000, uint256S("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")},
|
|
||||||
{279000, uint256S("0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")},
|
|
||||||
{295000, uint256S("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")},
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
chainTxData = ChainTxData{
|
chainTxData = ChainTxData{
|
||||||
// Data from rpc: getchaintxstats 4096 0000000000000000002e63058c023a9a1de233554f28c7b21380b6c9003f36a8
|
1467272478, 4146, 600.0
|
||||||
/* nTime */ 1532884444,
|
/* // Data from rpc: getchaintxstats 4096 0000000000000000002e63058c023a9a1de233554f28c7b21380b6c9003f36a8 */
|
||||||
/* nTxCount */ 331282217,
|
/* /\* nTime *\/ 1532884444, */
|
||||||
/* dTxRate */ 2.4
|
/* /\* nTxCount *\/ 331282217, */
|
||||||
|
/* /\* dTxRate *\/ 2.4 */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* disable fallback fee on mainnet */
|
/* disable fallback fee on mainnet */
|
||||||
|
@ -187,16 +238,26 @@ public:
|
||||||
class CTestNetParams : public CChainParams {
|
class CTestNetParams : public CChainParams {
|
||||||
public:
|
public:
|
||||||
CTestNetParams() {
|
CTestNetParams() {
|
||||||
strNetworkID = "test";
|
strNetworkID = "lbrycrdtest";
|
||||||
consensus.nSubsidyHalvingInterval = 210000;
|
consensus.nSubsidyLevelInterval = 1 << 5;
|
||||||
|
consensus.nMajorityEnforceBlockUpgrade = 51;
|
||||||
|
consensus.nMajorityRejectBlockOutdated = 75;
|
||||||
|
consensus.nMajorityWindow = 100;
|
||||||
consensus.BIP16Exception = uint256S("0x00000000dd30457c001f4095d208cc1296b0eed002427aa599874af7a432b105");
|
consensus.BIP16Exception = uint256S("0x00000000dd30457c001f4095d208cc1296b0eed002427aa599874af7a432b105");
|
||||||
consensus.BIP34Height = 21111;
|
consensus.BIP34Height = 21111;
|
||||||
consensus.BIP34Hash = uint256S("0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8");
|
consensus.BIP34Hash = uint256S("0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8");
|
||||||
consensus.BIP65Height = 581885; // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6
|
// FIXME: adjust heights
|
||||||
consensus.BIP66Height = 330776; // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182
|
consensus.BIP65Height = 1200000;
|
||||||
consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
consensus.BIP66Height = 1200000;
|
||||||
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
|
consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||||
consensus.nPowTargetSpacing = 10 * 60;
|
consensus.nPowTargetTimespan = 150;
|
||||||
|
consensus.nPowTargetSpacing = 150;
|
||||||
|
consensus.nOriginalClaimExpirationTime = 262974;
|
||||||
|
consensus.nExtendedClaimExpirationTime = 2102400;
|
||||||
|
consensus.nExtendedClaimExpirationForkHeight = 278160;
|
||||||
|
consensus.nAllowMinDiffMinHeight = 277299;
|
||||||
|
consensus.nAllowMinDiffMaxHeight = 1100000;
|
||||||
|
consensus.nNormalizedNameForkHeight = 993380; // targeting, 21 Feb 2019
|
||||||
consensus.fPowAllowMinDifficultyBlocks = true;
|
consensus.fPowAllowMinDifficultyBlocks = true;
|
||||||
consensus.fPowNoRetargeting = false;
|
consensus.fPowNoRetargeting = false;
|
||||||
consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
|
consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
|
||||||
|
@ -216,30 +277,32 @@ public:
|
||||||
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1493596800; // May 1st 2017
|
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1493596800; // May 1st 2017
|
||||||
|
|
||||||
// The best chain should have at least this much work.
|
// The best chain should have at least this much work.
|
||||||
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000007dbe94253893cbd463");
|
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000a0c3931735170");
|
||||||
|
|
||||||
// By default assume that the signatures in ancestors of this block are valid.
|
// By default assume that the signatures in ancestors of this block are valid.
|
||||||
consensus.defaultAssumeValid = uint256S("0x0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75"); //1354312
|
consensus.defaultAssumeValid = uint256S("9812b0bcb7e889e58d999c897e9eaddb2dab98122ff1cfb238ebeef5351bd48c"); // 1
|
||||||
|
|
||||||
pchMessageStart[0] = 0x0b;
|
pchMessageStart[0] = 0xfa;
|
||||||
pchMessageStart[1] = 0x11;
|
pchMessageStart[1] = 0xe4;
|
||||||
pchMessageStart[2] = 0x09;
|
pchMessageStart[2] = 0xaa;
|
||||||
pchMessageStart[3] = 0x07;
|
pchMessageStart[3] = 0xe1;
|
||||||
nDefaultPort = 18333;
|
nDefaultPort = 19246;
|
||||||
nPruneAfterHeight = 1000;
|
nPruneAfterHeight = 1000;
|
||||||
|
|
||||||
genesis = CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 50 * COIN);
|
genesis = CreateGenesisBlock(1446058291, TESTNET_GENESIS_NONCE, 0x1f00ffff, 1, 400000000 * COIN);
|
||||||
consensus.hashGenesisBlock = genesis.GetHash();
|
consensus.hashGenesisBlock = genesis.GetHash();
|
||||||
assert(consensus.hashGenesisBlock == uint256S("0x000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"));
|
#ifdef FIND_GENESIS
|
||||||
assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
|
std::cout << "testnet genesis hash: " << genesis.GetHash().GetHex() << std::endl;
|
||||||
|
std::cout << "testnet merkle hash: " << genesis.hashMerkleRoot.GetHex() << std::endl;
|
||||||
|
#else
|
||||||
|
assert(consensus.hashGenesisBlock == uint256S(TESTNET_GENESIS_HASH));
|
||||||
|
assert(genesis.hashMerkleRoot == uint256S(GENESIS_MERKLE_ROOT));
|
||||||
|
#endif
|
||||||
|
|
||||||
vFixedSeeds.clear();
|
vFixedSeeds.clear();
|
||||||
vSeeds.clear();
|
vSeeds.clear();
|
||||||
// nodes with support for servicebits filtering should be at the top
|
vSeeds.emplace_back("testdnsseed1.lbry.io");
|
||||||
vSeeds.emplace_back("testnet-seed.bitcoin.jonasschnelli.ch");
|
vSeeds.emplace_back("testdnsseed2.lbry.io");
|
||||||
vSeeds.emplace_back("seed.tbtc.petertodd.org");
|
|
||||||
vSeeds.emplace_back("seed.testnet.bitcoin.sprovoost.nl");
|
|
||||||
vSeeds.emplace_back("testnet-seed.bluematt.me"); // Just a static list of stable node(s), only supports x9
|
|
||||||
|
|
||||||
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
|
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
|
||||||
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
|
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
|
||||||
|
@ -251,14 +314,15 @@ public:
|
||||||
|
|
||||||
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
|
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
|
||||||
|
|
||||||
|
fMiningRequiresPeers = true;
|
||||||
fDefaultConsistencyChecks = false;
|
fDefaultConsistencyChecks = false;
|
||||||
fRequireStandard = false;
|
fRequireStandard = false;
|
||||||
fMineBlocksOnDemand = false;
|
fMineBlocksOnDemand = false;
|
||||||
|
fTestnetToBeDeprecatedFieldRPC = true;
|
||||||
|
|
||||||
checkpointData = {
|
checkpointData = {
|
||||||
{
|
{
|
||||||
{546, uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")},
|
{0, uint256S(TESTNET_GENESIS_HASH)},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -280,18 +344,25 @@ public:
|
||||||
class CRegTestParams : public CChainParams {
|
class CRegTestParams : public CChainParams {
|
||||||
public:
|
public:
|
||||||
CRegTestParams() {
|
CRegTestParams() {
|
||||||
strNetworkID = "regtest";
|
strNetworkID = "lbrycrdreg";
|
||||||
consensus.nSubsidyHalvingInterval = 150;
|
consensus.nSubsidyLevelInterval = 1 << 5;
|
||||||
consensus.BIP16Exception = uint256();
|
consensus.BIP16Exception = uint256();
|
||||||
consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests)
|
consensus.BIP34Height = 1000; // BIP34 is needed for validation_block_tests
|
||||||
consensus.BIP34Hash = uint256();
|
consensus.BIP34Hash = uint256();
|
||||||
|
// FIXME: update heights and add activation tests
|
||||||
consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)
|
consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)
|
||||||
consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)
|
consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)
|
||||||
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||||
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
|
consensus.nPowTargetTimespan = 1;//14 * 24 * 60 * 60; // two weeks
|
||||||
consensus.nPowTargetSpacing = 10 * 60;
|
consensus.nPowTargetSpacing = 1;
|
||||||
consensus.fPowAllowMinDifficultyBlocks = true;
|
consensus.nOriginalClaimExpirationTime = 500;
|
||||||
consensus.fPowNoRetargeting = true;
|
consensus.nExtendedClaimExpirationTime = 600;
|
||||||
|
consensus.nExtendedClaimExpirationForkHeight = 800;
|
||||||
|
consensus.nAllowMinDiffMinHeight = -1;
|
||||||
|
consensus.nAllowMinDiffMaxHeight = -1;
|
||||||
|
consensus.nNormalizedNameForkHeight = 250; // SDK depends upon this number
|
||||||
|
consensus.fPowAllowMinDifficultyBlocks = false;
|
||||||
|
consensus.fPowNoRetargeting = false;
|
||||||
consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
|
consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
|
||||||
consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
|
consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
|
||||||
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
|
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
|
||||||
|
@ -311,27 +382,34 @@ public:
|
||||||
consensus.defaultAssumeValid = uint256S("0x00");
|
consensus.defaultAssumeValid = uint256S("0x00");
|
||||||
|
|
||||||
pchMessageStart[0] = 0xfa;
|
pchMessageStart[0] = 0xfa;
|
||||||
pchMessageStart[1] = 0xbf;
|
pchMessageStart[1] = 0xe4;
|
||||||
pchMessageStart[2] = 0xb5;
|
pchMessageStart[2] = 0xaa;
|
||||||
pchMessageStart[3] = 0xda;
|
pchMessageStart[3] = 0xd1;
|
||||||
nDefaultPort = 18444;
|
nDefaultPort = 29246;
|
||||||
nPruneAfterHeight = 1000;
|
nPruneAfterHeight = 1000;
|
||||||
|
|
||||||
genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN);
|
genesis = CreateGenesisBlock(1446058291, REGTEST_GENESIS_NONCE, 0x207fffff, 1, 400000000 * COIN);
|
||||||
consensus.hashGenesisBlock = genesis.GetHash();
|
consensus.hashGenesisBlock = genesis.GetHash();
|
||||||
assert(consensus.hashGenesisBlock == uint256S("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"));
|
#ifdef FIND_GENESIS
|
||||||
assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
|
std::cout << "regtest genensis hash: " << genesis.GetHash().GetHex() << std::endl;
|
||||||
|
std::cout << "regtest hashmerkleroot: " << genesis.hashMerkleRoot.GetHex() << std::endl;
|
||||||
|
#else
|
||||||
|
assert(consensus.hashGenesisBlock == uint256S(REGTEST_GENESIS_HASH));
|
||||||
|
assert(genesis.hashMerkleRoot == uint256S(GENESIS_MERKLE_ROOT));
|
||||||
|
#endif
|
||||||
|
|
||||||
vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds.
|
vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds.
|
||||||
vSeeds.clear(); //!< Regtest mode doesn't have any DNS seeds.
|
vSeeds.clear(); //!< Regtest mode doesn't have any DNS seeds.
|
||||||
|
|
||||||
|
fMiningRequiresPeers = false;
|
||||||
fDefaultConsistencyChecks = true;
|
fDefaultConsistencyChecks = true;
|
||||||
fRequireStandard = false;
|
fRequireStandard = false;
|
||||||
fMineBlocksOnDemand = true;
|
fMineBlocksOnDemand = true;
|
||||||
|
fTestnetToBeDeprecatedFieldRPC = false;
|
||||||
|
|
||||||
checkpointData = {
|
checkpointData = {
|
||||||
{
|
{
|
||||||
{0, uint256S("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")},
|
{0, uint256S(REGTEST_GENESIS_HASH)},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#ifndef BITCOIN_CHAINPARAMS_H
|
#ifndef BITCOIN_CHAINPARAMS_H
|
||||||
#define BITCOIN_CHAINPARAMS_H
|
#define BITCOIN_CHAINPARAMS_H
|
||||||
|
|
||||||
|
#include <arith_uint256.h>
|
||||||
#include <chainparamsbase.h>
|
#include <chainparamsbase.h>
|
||||||
#include <consensus/params.h>
|
#include <consensus/params.h>
|
||||||
#include <primitives/block.h>
|
#include <primitives/block.h>
|
||||||
|
@ -94,9 +95,11 @@ protected:
|
||||||
std::string strNetworkID;
|
std::string strNetworkID;
|
||||||
CBlock genesis;
|
CBlock genesis;
|
||||||
std::vector<SeedSpec6> vFixedSeeds;
|
std::vector<SeedSpec6> vFixedSeeds;
|
||||||
|
bool fMiningRequiresPeers;
|
||||||
bool fDefaultConsistencyChecks;
|
bool fDefaultConsistencyChecks;
|
||||||
bool fRequireStandard;
|
bool fRequireStandard;
|
||||||
bool fMineBlocksOnDemand;
|
bool fMineBlocksOnDemand;
|
||||||
|
bool fTestnetToBeDeprecatedFieldRPC;
|
||||||
CCheckpointData checkpointData;
|
CCheckpointData checkpointData;
|
||||||
ChainTxData chainTxData;
|
ChainTxData chainTxData;
|
||||||
bool m_fallback_fee_enabled;
|
bool m_fallback_fee_enabled;
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
const std::string CBaseChainParams::MAIN = "main";
|
const std::string CBaseChainParams::MAIN = "lbrycrd";
|
||||||
const std::string CBaseChainParams::TESTNET = "test";
|
const std::string CBaseChainParams::TESTNET = "lbrycrdtest";
|
||||||
const std::string CBaseChainParams::REGTEST = "regtest";
|
const std::string CBaseChainParams::REGTEST = "regtest";
|
||||||
|
|
||||||
void SetupChainParamsBaseOptions()
|
void SetupChainParamsBaseOptions()
|
||||||
|
@ -33,11 +33,11 @@ const CBaseChainParams& BaseParams()
|
||||||
std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain)
|
std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain)
|
||||||
{
|
{
|
||||||
if (chain == CBaseChainParams::MAIN)
|
if (chain == CBaseChainParams::MAIN)
|
||||||
return MakeUnique<CBaseChainParams>("", 8332);
|
return MakeUnique<CBaseChainParams>("", 9245);
|
||||||
else if (chain == CBaseChainParams::TESTNET)
|
else if (chain == CBaseChainParams::TESTNET)
|
||||||
return MakeUnique<CBaseChainParams>("testnet3", 18332);
|
return MakeUnique<CBaseChainParams>("testnet3", 19245);
|
||||||
else if (chain == CBaseChainParams::REGTEST)
|
else if (chain == CBaseChainParams::REGTEST)
|
||||||
return MakeUnique<CBaseChainParams>("regtest", 18443);
|
return MakeUnique<CBaseChainParams>("regtest", 29245);
|
||||||
else
|
else
|
||||||
throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
|
throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,12 @@ std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain
|
||||||
*/
|
*/
|
||||||
void SetupChainParamsBaseOptions();
|
void SetupChainParamsBaseOptions();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Append the help messages for the chainparams options to the
|
||||||
|
* parameter string.
|
||||||
|
*/
|
||||||
|
void AppendParamsHelpMessages(std::string& strUsage, bool debugHelp=true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the currently selected parameters. This won't change after app
|
* Return the currently selected parameters. This won't change after app
|
||||||
* startup, except for unit tests.
|
* startup, except for unit tests.
|
||||||
|
@ -53,4 +59,16 @@ const CBaseChainParams& BaseParams();
|
||||||
/** Sets the params returned by Params() to those for the given network. */
|
/** Sets the params returned by Params() to those for the given network. */
|
||||||
void SelectBaseParams(const std::string& chain);
|
void SelectBaseParams(const std::string& chain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
|
||||||
|
* @return CBaseChainParams::MAX_NETWORK_TYPES if an invalid combination is given. CBaseChainParams::MAIN by default.
|
||||||
|
*/
|
||||||
|
std::string ChainNameFromCommandLine();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if SelectBaseParamsFromCommandLine() has been called to select
|
||||||
|
* a network.
|
||||||
|
*/
|
||||||
|
bool AreBaseParamsConfigured();
|
||||||
|
|
||||||
#endif // BITCOIN_CHAINPARAMSBASE_H
|
#endif // BITCOIN_CHAINPARAMSBASE_H
|
||||||
|
|
File diff suppressed because it is too large
Load diff
211
src/claimscriptop.cpp
Normal file
211
src/claimscriptop.cpp
Normal file
|
@ -0,0 +1,211 @@
|
||||||
|
// Copyright (c) 2018 The LBRY developers
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#include "claimscriptop.h"
|
||||||
|
#include "nameclaim.h"
|
||||||
|
|
||||||
|
CClaimScriptAddOp::CClaimScriptAddOp(const COutPoint& point, CAmount nValue, int nHeight)
|
||||||
|
: point(point), nValue(nValue), nHeight(nHeight)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptAddOp::claimName(CClaimTrieCache& trieCache, const std::string& name)
|
||||||
|
{
|
||||||
|
return addClaim(trieCache, name, ClaimIdHash(point.hash, point.n));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptAddOp::updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
return addClaim(trieCache, name, claimId);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptAddOp::addClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
return trieCache.addClaim(name, point, claimId, nValue, nHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptAddOp::supportClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
return trieCache.addSupport(name, point, nValue, claimId, nHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
CClaimScriptUndoAddOp::CClaimScriptUndoAddOp(const COutPoint& point, int nHeight) : point(point), nHeight(nHeight)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptUndoAddOp::claimName(CClaimTrieCache& trieCache, const std::string& name)
|
||||||
|
{
|
||||||
|
auto claimId = ClaimIdHash(point.hash, point.n);
|
||||||
|
LogPrintf("--- [%lu]: OP_CLAIM_NAME \"%s\" with claimId %s and tx prevout %s at index %d\n", nHeight, name, claimId.GetHex(), point.hash.ToString(), point.n);
|
||||||
|
return undoAddClaim(trieCache, name, claimId);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptUndoAddOp::updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
LogPrintf("--- [%lu]: OP_UPDATE_CLAIM \"%s\" with claimId %s and tx prevout %s at index %d\n", nHeight, name, claimId.GetHex(), point.hash.ToString(), point.n);
|
||||||
|
return undoAddClaim(trieCache, name, claimId);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptUndoAddOp::undoAddClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
LogPrintf("%s: (txid: %s, nOut: %d) Removing %s, claimId: %s, from the claim trie due to block disconnect\n", __func__, point.hash.ToString(), point.n, name, claimId.ToString());
|
||||||
|
bool res = trieCache.undoAddClaim(name, point, nHeight);
|
||||||
|
if (!res)
|
||||||
|
LogPrintf("%s: Removing fails\n", __func__);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptUndoAddOp::supportClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
LogPrintf("--- [%lu]: OP_SUPPORT_CLAIM \"%s\" with claimId %s and tx prevout %s at index %d\n", nHeight, name, claimId.GetHex(), point.hash.ToString(), point.n);
|
||||||
|
LogPrintf("%s: (txid: %s, nOut: %d) Removing support for %s, claimId: %s, from the claim trie due to block disconnect\n", __func__, point.hash.ToString(), point.n, name, claimId.ToString());
|
||||||
|
bool res = trieCache.undoAddSupport(name, point, nHeight);
|
||||||
|
if (!res)
|
||||||
|
LogPrintf("%s: Removing support fails\n", __func__);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
CClaimScriptSpendOp::CClaimScriptSpendOp(const COutPoint& point, int nHeight, int& nValidHeight)
|
||||||
|
: point(point), nHeight(nHeight), nValidHeight(nValidHeight)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptSpendOp::claimName(CClaimTrieCache& trieCache, const std::string& name)
|
||||||
|
{
|
||||||
|
auto claimId = ClaimIdHash(point.hash, point.n);
|
||||||
|
LogPrintf("+++ [%lu]: OP_CLAIM_NAME \"%s\" with claimId %s and tx prevout %s at index %d\n", nHeight, name, claimId.GetHex(), point.hash.ToString(), point.n);
|
||||||
|
return spendClaim(trieCache, name, claimId);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptSpendOp::updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
LogPrintf("+++ [%lu]: OP_UPDATE_CLAIM \"%s\" with claimId %s and tx prevout %s at index %d\n", nHeight, name, claimId.GetHex(), point.hash.ToString(), point.n);
|
||||||
|
return spendClaim(trieCache, name, claimId);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptSpendOp::spendClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
LogPrintf("%s: (txid: %s, nOut: %d) Removing %s, claimId: %s, from the claim trie\n", __func__, point.hash.ToString(), point.n, name, claimId.ToString());
|
||||||
|
bool res = trieCache.spendClaim(name, point, nHeight, nValidHeight);
|
||||||
|
if (!res)
|
||||||
|
LogPrintf("%s: Removing fails\n", __func__);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptSpendOp::supportClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
LogPrintf("+++ [%lu]: OP_SUPPORT_CLAIM \"%s\" with claimId %s and tx prevout %s at index %d\n", nHeight, name, claimId.GetHex(), point.hash.ToString(), point.n);
|
||||||
|
LogPrintf("%s: (txid: %s, nOut: %d) Restoring support for %s, claimId: %s, to the claim trie\n", __func__, point.hash.ToString(), point.n, name, claimId.ToString());
|
||||||
|
bool res = trieCache.spendSupport(name, point, nHeight, nValidHeight);
|
||||||
|
if (!res)
|
||||||
|
LogPrintf("%s: Removing support fails\n", __func__);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
CClaimScriptUndoSpendOp::CClaimScriptUndoSpendOp(const COutPoint& point, CAmount nValue, int nHeight, int nValidHeight)
|
||||||
|
: point(point), nValue(nValue), nHeight(nHeight), nValidHeight(nValidHeight)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptUndoSpendOp::claimName(CClaimTrieCache& trieCache, const std::string& name)
|
||||||
|
{
|
||||||
|
return undoSpendClaim(trieCache, name, ClaimIdHash(point.hash, point.n));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptUndoSpendOp::updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
return undoSpendClaim(trieCache, name, claimId);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptUndoSpendOp::undoSpendClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
LogPrintf("%s: (txid: %s, nOut: %d) Restoring %s, claimId: %s, to the claim trie due to block disconnect\n", __func__, point.hash.ToString(), point.n, name, claimId.ToString());
|
||||||
|
return trieCache.undoSpendClaim(name, point, claimId, nValue, nHeight, nValidHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimScriptUndoSpendOp::supportClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId)
|
||||||
|
{
|
||||||
|
LogPrintf("%s: (txid: %s, nOut: %d) Restoring support for %s, claimId: %s, to the claim trie due to block disconnect\n", __func__, point.hash.ToString(), point.n, name, claimId.ToString());
|
||||||
|
return trieCache.undoSpendSupport(name, point, claimId, nValue, nHeight, nValidHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string vchToString(const std::vector<unsigned char>& name)
|
||||||
|
{
|
||||||
|
return std::string(name.begin(), name.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ProcessClaim(CClaimScriptOp& claimOp, CClaimTrieCache& trieCache, const CScript& scriptPubKey)
|
||||||
|
{
|
||||||
|
int op;
|
||||||
|
std::vector<std::vector<unsigned char> > vvchParams;
|
||||||
|
if (!DecodeClaimScript(scriptPubKey, op, vvchParams))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
switch (op) {
|
||||||
|
case OP_CLAIM_NAME:
|
||||||
|
return claimOp.claimName(trieCache, vchToString(vvchParams[0]));
|
||||||
|
case OP_SUPPORT_CLAIM:
|
||||||
|
return claimOp.supportClaim(trieCache, vchToString(vvchParams[0]), uint160(vvchParams[1]));
|
||||||
|
case OP_UPDATE_CLAIM:
|
||||||
|
return claimOp.updateClaim(trieCache, vchToString(vvchParams[0]), uint160(vvchParams[1]));
|
||||||
|
}
|
||||||
|
throw std::runtime_error("Unimplemented OP handler.");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SpendClaim(CClaimTrieCache& trieCache, const CScript& scriptPubKey, const COutPoint& point, int nHeight, int& nValidHeight, spentClaimsType& spentClaims)
|
||||||
|
{
|
||||||
|
class CSpendClaimHistory : public CClaimScriptSpendOp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CSpendClaimHistory(spentClaimsType& spentClaims, const COutPoint& point, int nHeight, int& nValidHeight)
|
||||||
|
: CClaimScriptSpendOp(point, nHeight, nValidHeight), spentClaims(spentClaims)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool spendClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override
|
||||||
|
{
|
||||||
|
if (CClaimScriptSpendOp::spendClaim(trieCache, name, claimId)) {
|
||||||
|
spentClaims.emplace_back(name, claimId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
spentClaimsType& spentClaims;
|
||||||
|
};
|
||||||
|
|
||||||
|
CSpendClaimHistory spendClaim(spentClaims, point, nHeight, nValidHeight);
|
||||||
|
return ProcessClaim(spendClaim, trieCache, scriptPubKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AddSpendClaim(CClaimTrieCache& trieCache, const CScript& scriptPubKey, const COutPoint& point, CAmount nValue, int nHeight, spentClaimsType& spentClaims)
|
||||||
|
{
|
||||||
|
class CAddSpendClaim : public CClaimScriptAddOp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CAddSpendClaim(spentClaimsType& spentClaims, const COutPoint& point, CAmount nValue, int nHeight)
|
||||||
|
: CClaimScriptAddOp(point, nValue, nHeight), spentClaims(spentClaims)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override
|
||||||
|
{
|
||||||
|
spentClaimsType::iterator itSpent = spentClaims.begin();
|
||||||
|
for (; itSpent != spentClaims.end(); ++itSpent) {
|
||||||
|
if (itSpent->second == claimId && trieCache.normalizeClaimName(name) == trieCache.normalizeClaimName(itSpent->first)) {
|
||||||
|
spentClaims.erase(itSpent);
|
||||||
|
return CClaimScriptAddOp::updateClaim(trieCache, name, claimId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
spentClaimsType& spentClaims;
|
||||||
|
};
|
||||||
|
|
||||||
|
CAddSpendClaim addClaim(spentClaims, point, nValue, nHeight);
|
||||||
|
return ProcessClaim(addClaim, trieCache, scriptPubKey);
|
||||||
|
}
|
250
src/claimscriptop.h
Normal file
250
src/claimscriptop.h
Normal file
|
@ -0,0 +1,250 @@
|
||||||
|
// Copyright (c) 2018 The LBRY developers
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#ifndef CLAIMSCRIPTOP_H
|
||||||
|
#define CLAIMSCRIPTOP_H
|
||||||
|
|
||||||
|
#include "amount.h"
|
||||||
|
#include "claimtrie.h"
|
||||||
|
#include "hash.h"
|
||||||
|
#include "primitives/transaction.h"
|
||||||
|
#include "script/script.h"
|
||||||
|
#include "uint256.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Claim script operation base class
|
||||||
|
*/
|
||||||
|
class CClaimScriptOp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~CClaimScriptOp() {}
|
||||||
|
/**
|
||||||
|
* Pure virtual, OP_CLAIM_NAME handler
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] name name of the claim
|
||||||
|
*/
|
||||||
|
virtual bool claimName(CClaimTrieCache& trieCache, const std::string& name) = 0;
|
||||||
|
/**
|
||||||
|
* Pure virtual, OP_UPDATE_CLAIM handler
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] name name of the claim
|
||||||
|
* @param[in] claimId id of the claim
|
||||||
|
*/
|
||||||
|
virtual bool updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) = 0;
|
||||||
|
/**
|
||||||
|
* Pure virtual, OP_SUPPORT_CLAIM handler
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] name name of the claim
|
||||||
|
* @param[in] claimId id of the claim
|
||||||
|
*/
|
||||||
|
virtual bool supportClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to add claim in trie
|
||||||
|
*/
|
||||||
|
class CClaimScriptAddOp : public CClaimScriptOp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param[in] point pair of transaction hash and its index
|
||||||
|
* @param[in] nValue value of the claim
|
||||||
|
* @param[in] nHeight entry height of the claim
|
||||||
|
*/
|
||||||
|
CClaimScriptAddOp(const COutPoint& point, CAmount nValue, int nHeight);
|
||||||
|
/**
|
||||||
|
* Implamention of OP_CLAIM_NAME handler
|
||||||
|
* @see CClaimScriptOp::claimName
|
||||||
|
*/
|
||||||
|
bool claimName(CClaimTrieCache& trieCache, const std::string& name) override;
|
||||||
|
/**
|
||||||
|
* Implamention of OP_UPDATE_CLAIM handler
|
||||||
|
* @see CClaimScriptOp::updateClaim
|
||||||
|
*/
|
||||||
|
bool updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override;
|
||||||
|
/**
|
||||||
|
* Implamention of OP_SUPPORT_CLAIM handler
|
||||||
|
* @see CClaimScriptOp::supportClaim
|
||||||
|
*/
|
||||||
|
bool supportClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Reimplement to handle OP_CLAIM_NAME and OP_UPDATE_CLAIM at once
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] name name of the claim
|
||||||
|
* @param[in] claimId id of the claim
|
||||||
|
*/
|
||||||
|
virtual bool addClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId);
|
||||||
|
const COutPoint point;
|
||||||
|
const CAmount nValue;
|
||||||
|
const int nHeight;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to undo added claim in trie
|
||||||
|
*/
|
||||||
|
class CClaimScriptUndoAddOp : public CClaimScriptOp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param[in] point pair of transaction hash and its index
|
||||||
|
* @param[in] nHeight entry height of the claim
|
||||||
|
*/
|
||||||
|
CClaimScriptUndoAddOp(const COutPoint& point, int nHeight);
|
||||||
|
/**
|
||||||
|
* Implamention of OP_CLAIM_NAME handler
|
||||||
|
* @see CClaimScriptOp::claimName
|
||||||
|
*/
|
||||||
|
bool claimName(CClaimTrieCache& trieCache, const std::string& name) override;
|
||||||
|
/**
|
||||||
|
* Implamention of OP_UPDATE_CLAIM handler
|
||||||
|
* @see CClaimScriptOp::updateClaim
|
||||||
|
*/
|
||||||
|
bool updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override;
|
||||||
|
/**
|
||||||
|
* Implamention of OP_SUPPORT_CLAIM handler
|
||||||
|
* @see CClaimScriptOp::supportClaim
|
||||||
|
*/
|
||||||
|
bool supportClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Reimplement to handle OP_CLAIM_NAME and OP_UPDATE_CLAIM at once
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] name name of the claim
|
||||||
|
* @param[in] claimId id of the claim
|
||||||
|
*/
|
||||||
|
virtual bool undoAddClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId);
|
||||||
|
const COutPoint point;
|
||||||
|
const int nHeight;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to spend claim from trie
|
||||||
|
*/
|
||||||
|
class CClaimScriptSpendOp : public CClaimScriptOp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param[in] point pair of transaction hash and its index
|
||||||
|
* @param[in] nHeight entry height of the claim
|
||||||
|
* @param[out] nValidHeight valid height of the claim
|
||||||
|
*/
|
||||||
|
CClaimScriptSpendOp(const COutPoint& point, int nHeight, int& nValidHeight);
|
||||||
|
/**
|
||||||
|
* Implamention of OP_CLAIM_NAME handler
|
||||||
|
* @see CClaimScriptOp::claimName
|
||||||
|
*/
|
||||||
|
bool claimName(CClaimTrieCache& trieCache, const std::string& name) override;
|
||||||
|
/**
|
||||||
|
* Implamention of OP_UPDATE_CLAIM handler
|
||||||
|
* @see CClaimScriptOp::updateClaim
|
||||||
|
*/
|
||||||
|
bool updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override;
|
||||||
|
/**
|
||||||
|
* Implamention of OP_SUPPORT_CLAIM handler
|
||||||
|
* @see CClaimScriptOp::supportClaim
|
||||||
|
*/
|
||||||
|
bool supportClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Reimplement to handle OP_CLAIM_NAME and OP_UPDATE_CLAIM at once
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] name name of the claim
|
||||||
|
* @param[in] claimId id of the claim
|
||||||
|
*/
|
||||||
|
virtual bool spendClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId);
|
||||||
|
const COutPoint point;
|
||||||
|
const int nHeight;
|
||||||
|
int& nValidHeight;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to undo spent claim from trie
|
||||||
|
*/
|
||||||
|
class CClaimScriptUndoSpendOp : public CClaimScriptOp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param[in] point pair of transaction hash and its index
|
||||||
|
* @param[in] nValue value of the claim
|
||||||
|
* @param[in] nHeight entry height of the claim
|
||||||
|
* @param[in] nValidHeight valid height of the claim
|
||||||
|
*/
|
||||||
|
CClaimScriptUndoSpendOp(const COutPoint& point, CAmount nValue, int nHeight, int nValidHeight);
|
||||||
|
/**
|
||||||
|
* Implamention of OP_CLAIM_NAME handler
|
||||||
|
* @see CClaimScriptOp::claimName
|
||||||
|
*/
|
||||||
|
bool claimName(CClaimTrieCache& trieCache, const std::string& name) override;
|
||||||
|
/**
|
||||||
|
* Implamention of OP_UPDATE_CLAIM handler
|
||||||
|
* @see CClaimScriptOp::updateClaim
|
||||||
|
*/
|
||||||
|
bool updateClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override;
|
||||||
|
/**
|
||||||
|
* Implamention of OP_SUPPORT_CLAIM handler
|
||||||
|
* @see CClaimScriptOp::supportClaim
|
||||||
|
*/
|
||||||
|
bool supportClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Reimplement to handle OP_CLAIM_NAME and OP_UPDATE_CLAIM at once
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] name name of the claim
|
||||||
|
* @param[in] claimId id of the claim
|
||||||
|
*/
|
||||||
|
virtual bool undoSpendClaim(CClaimTrieCache& trieCache, const std::string& name, const uint160& claimId);
|
||||||
|
const COutPoint point;
|
||||||
|
const CAmount nValue;
|
||||||
|
const int nHeight;
|
||||||
|
const int nValidHeight;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to process operation on claim
|
||||||
|
* @param[in] claimOp operation to be performed
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] scriptPubKey claim script to be decoded
|
||||||
|
*/
|
||||||
|
bool ProcessClaim(CClaimScriptOp& claimOp, CClaimTrieCache& trieCache, const CScript& scriptPubKey);
|
||||||
|
|
||||||
|
typedef std::pair<std::string, uint160> spentClaimType;
|
||||||
|
|
||||||
|
typedef std::vector<spentClaimType> spentClaimsType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to spend claim from tie, keeping the successful list on
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] scriptPubKey claim script to be decoded
|
||||||
|
* @param[in] point pair of transaction hash and its index
|
||||||
|
* @param[in] nHeight entry height of the claim
|
||||||
|
* @param[out] nValidHeight valid height of the claim
|
||||||
|
* @param[out] spentClaims inserts successfully spent claim
|
||||||
|
*/
|
||||||
|
bool SpendClaim(CClaimTrieCache& trieCache, const CScript& scriptPubKey, const COutPoint& point, int nHeight, int& nValidHeight, spentClaimsType& spentClaims);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to add / update (that present in spent list) claim in trie
|
||||||
|
* @param[in] trieCache trie to operate on
|
||||||
|
* @param[in] scriptPubKey claim script to be decoded
|
||||||
|
* @param[in] point pair of transaction hash and its index
|
||||||
|
* @param[in] nValue ` value of the claim
|
||||||
|
* @param[in] nHeight entry height of the claim
|
||||||
|
* @param[out] spentClaims erases successfully added claim
|
||||||
|
*/
|
||||||
|
bool AddSpendClaim(CClaimTrieCache& trieCache, const CScript& scriptPubKey, const COutPoint& point, CAmount nValue, int nHeight, spentClaimsType& spentClaims);
|
||||||
|
|
||||||
|
#endif // CLAIMSCRIPTOP_H
|
2532
src/claimtrie.cpp
Normal file
2532
src/claimtrie.cpp
Normal file
File diff suppressed because it is too large
Load diff
826
src/claimtrie.h
Normal file
826
src/claimtrie.h
Normal file
|
@ -0,0 +1,826 @@
|
||||||
|
#ifndef BITCOIN_CLAIMTRIE_H
|
||||||
|
#define BITCOIN_CLAIMTRIE_H
|
||||||
|
|
||||||
|
#include <amount.h>
|
||||||
|
#include <serialize.h>
|
||||||
|
#include <uint256.h>
|
||||||
|
#include <util.h>
|
||||||
|
#include <dbwrapper.h>
|
||||||
|
#include <chainparams.h>
|
||||||
|
#include <primitives/transaction.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
// leveldb keys
|
||||||
|
#define HASH_BLOCK 'h'
|
||||||
|
#define CURRENT_HEIGHT 't'
|
||||||
|
#define TRIE_NODE 'n'
|
||||||
|
#define CLAIM_BY_ID 'i'
|
||||||
|
#define CLAIM_QUEUE_ROW 'r'
|
||||||
|
#define CLAIM_QUEUE_NAME_ROW 'm'
|
||||||
|
#define EXP_QUEUE_ROW 'e'
|
||||||
|
#define SUPPORT 's'
|
||||||
|
#define SUPPORT_QUEUE_ROW 'u'
|
||||||
|
#define SUPPORT_QUEUE_NAME_ROW 'p'
|
||||||
|
#define SUPPORT_EXP_QUEUE_ROW 'x'
|
||||||
|
|
||||||
|
uint256 getValueHash(COutPoint outPoint, int nHeightOfLastTakeover);
|
||||||
|
|
||||||
|
class CClaimValue
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
COutPoint outPoint;
|
||||||
|
uint160 claimId;
|
||||||
|
CAmount nAmount;
|
||||||
|
CAmount nEffectiveAmount;
|
||||||
|
int nHeight;
|
||||||
|
int nValidAtHeight;
|
||||||
|
|
||||||
|
CClaimValue() {};
|
||||||
|
|
||||||
|
CClaimValue(COutPoint outPoint, uint160 claimId, CAmount nAmount, int nHeight,
|
||||||
|
int nValidAtHeight)
|
||||||
|
: outPoint(outPoint), claimId(claimId)
|
||||||
|
, nAmount(nAmount), nEffectiveAmount(nAmount)
|
||||||
|
, nHeight(nHeight), nValidAtHeight(nValidAtHeight)
|
||||||
|
{}
|
||||||
|
|
||||||
|
CClaimValue(CClaimValue&&) = default;
|
||||||
|
CClaimValue(const CClaimValue&) = default;
|
||||||
|
CClaimValue& operator=(CClaimValue&&) = default;
|
||||||
|
CClaimValue& operator=(const CClaimValue&) = default;
|
||||||
|
|
||||||
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
template <typename Stream, typename Operation>
|
||||||
|
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||||
|
READWRITE(outPoint);
|
||||||
|
READWRITE(claimId);
|
||||||
|
READWRITE(nAmount);
|
||||||
|
READWRITE(nHeight);
|
||||||
|
READWRITE(nValidAtHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator<(const CClaimValue& other) const
|
||||||
|
{
|
||||||
|
if (nEffectiveAmount < other.nEffectiveAmount)
|
||||||
|
return true;
|
||||||
|
else if (nEffectiveAmount == other.nEffectiveAmount)
|
||||||
|
{
|
||||||
|
if (nHeight > other.nHeight)
|
||||||
|
return true;
|
||||||
|
else if (nHeight == other.nHeight)
|
||||||
|
{
|
||||||
|
if (outPoint != other.outPoint && !(outPoint < other.outPoint))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const CClaimValue& other) const
|
||||||
|
{
|
||||||
|
return outPoint == other.outPoint && claimId == other.claimId && nAmount == other.nAmount && nHeight == other.nHeight && nValidAtHeight == other.nValidAtHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(const CClaimValue& other) const
|
||||||
|
{
|
||||||
|
return !(*this == other);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class CSupportValue
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
COutPoint outPoint;
|
||||||
|
uint160 supportedClaimId;
|
||||||
|
CAmount nAmount;
|
||||||
|
int nHeight;
|
||||||
|
int nValidAtHeight;
|
||||||
|
|
||||||
|
CSupportValue() {};
|
||||||
|
CSupportValue(COutPoint outPoint, uint160 supportedClaimId,
|
||||||
|
CAmount nAmount, int nHeight, int nValidAtHeight)
|
||||||
|
: outPoint(outPoint), supportedClaimId(supportedClaimId)
|
||||||
|
, nAmount(nAmount), nHeight(nHeight)
|
||||||
|
, nValidAtHeight(nValidAtHeight)
|
||||||
|
{}
|
||||||
|
|
||||||
|
CSupportValue(CSupportValue&&) = default;
|
||||||
|
CSupportValue(const CSupportValue&) = default;
|
||||||
|
CSupportValue& operator=(CSupportValue&&) = default;
|
||||||
|
CSupportValue& operator=(const CSupportValue&) = default;
|
||||||
|
|
||||||
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
template <typename Stream, typename Operation>
|
||||||
|
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||||
|
READWRITE(outPoint);
|
||||||
|
READWRITE(supportedClaimId);
|
||||||
|
READWRITE(nAmount);
|
||||||
|
READWRITE(nHeight);
|
||||||
|
READWRITE(nValidAtHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const CSupportValue& other) const
|
||||||
|
{
|
||||||
|
return outPoint == other.outPoint && supportedClaimId == other.supportedClaimId && nAmount == other.nAmount && nHeight == other.nHeight && nValidAtHeight == other.nValidAtHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(const CSupportValue& other) const
|
||||||
|
{
|
||||||
|
return !(*this == other);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class CClaimTrieNode;
|
||||||
|
class CClaimTrie;
|
||||||
|
|
||||||
|
typedef std::vector<CSupportValue> supportMapEntryType;
|
||||||
|
typedef std::map<unsigned char, CClaimTrieNode*> nodeMapType;
|
||||||
|
|
||||||
|
class CClaimTrieNode
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CClaimTrieNode() : nHeightOfLastTakeover(0) {}
|
||||||
|
CClaimTrieNode(uint256 hash) : hash(hash), nHeightOfLastTakeover(0) {}
|
||||||
|
CClaimTrieNode(const CClaimTrieNode&) = default;
|
||||||
|
CClaimTrieNode(CClaimTrieNode&& other)
|
||||||
|
{
|
||||||
|
hash = std::move(other.hash);
|
||||||
|
claims = std::move(other.claims);
|
||||||
|
children = std::move(other.children);
|
||||||
|
nHeightOfLastTakeover = other.nHeightOfLastTakeover;
|
||||||
|
}
|
||||||
|
|
||||||
|
CClaimTrieNode& operator=(const CClaimTrieNode&) = default;
|
||||||
|
CClaimTrieNode& operator=(CClaimTrieNode&& other)
|
||||||
|
{
|
||||||
|
if (this != &other)
|
||||||
|
{
|
||||||
|
hash = std::move(other.hash);
|
||||||
|
claims = std::move(other.claims);
|
||||||
|
children = std::move(other.children);
|
||||||
|
nHeightOfLastTakeover = other.nHeightOfLastTakeover;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint256 hash;
|
||||||
|
nodeMapType children;
|
||||||
|
int nHeightOfLastTakeover;
|
||||||
|
std::vector<CClaimValue> claims;
|
||||||
|
|
||||||
|
bool insertClaim(CClaimValue claim);
|
||||||
|
bool removeClaim(const COutPoint& outPoint, CClaimValue& claim);
|
||||||
|
bool getBestClaim(CClaimValue& claim) const;
|
||||||
|
bool empty() const {return children.empty() && claims.empty();}
|
||||||
|
bool haveClaim(const COutPoint& outPoint) const;
|
||||||
|
void reorderClaims(supportMapEntryType& supports);
|
||||||
|
|
||||||
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
template <typename Stream, typename Operation>
|
||||||
|
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||||
|
READWRITE(hash);
|
||||||
|
READWRITE(claims);
|
||||||
|
READWRITE(nHeightOfLastTakeover);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const CClaimTrieNode& other) const
|
||||||
|
{
|
||||||
|
return hash == other.hash && claims == other.claims;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(const CClaimTrieNode& other) const
|
||||||
|
{
|
||||||
|
return !(*this == other);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct nodenamecompare
|
||||||
|
{
|
||||||
|
bool operator() (const std::string& i, const std::string& j) const
|
||||||
|
{
|
||||||
|
if (i.size() == j.size())
|
||||||
|
return i < j;
|
||||||
|
return i.size() < j.size();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct outPointHeightType
|
||||||
|
{
|
||||||
|
COutPoint outPoint;
|
||||||
|
int nHeight;
|
||||||
|
|
||||||
|
outPointHeightType() {}
|
||||||
|
|
||||||
|
outPointHeightType(COutPoint outPoint, int nHeight)
|
||||||
|
: outPoint(outPoint), nHeight(nHeight) {}
|
||||||
|
|
||||||
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
template <typename Stream, typename Operation>
|
||||||
|
inline void SerializationOp(Stream& s, Operation ser_action)
|
||||||
|
{
|
||||||
|
READWRITE(outPoint);
|
||||||
|
READWRITE(nHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
struct nameOutPointHeightType
|
||||||
|
{
|
||||||
|
std::string name;
|
||||||
|
COutPoint outPoint;
|
||||||
|
int nHeight;
|
||||||
|
|
||||||
|
nameOutPointHeightType() {}
|
||||||
|
|
||||||
|
nameOutPointHeightType(std::string name, COutPoint outPoint, int nHeight)
|
||||||
|
: name(std::move(name)), outPoint(outPoint), nHeight(nHeight) {}
|
||||||
|
|
||||||
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
template <typename Stream, typename Operation>
|
||||||
|
inline void SerializationOp(Stream& s, Operation ser_action)
|
||||||
|
{
|
||||||
|
READWRITE(name);
|
||||||
|
READWRITE(outPoint);
|
||||||
|
READWRITE(nHeight);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct nameOutPointType
|
||||||
|
{
|
||||||
|
std::string name;
|
||||||
|
COutPoint outPoint;
|
||||||
|
|
||||||
|
nameOutPointType() {}
|
||||||
|
|
||||||
|
nameOutPointType(std::string name, COutPoint outPoint)
|
||||||
|
: name(std::move(name)), outPoint(outPoint) {}
|
||||||
|
|
||||||
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
template <typename Stream, typename Operation>
|
||||||
|
inline void SerializationOp(Stream& s, Operation ser_action)
|
||||||
|
{
|
||||||
|
READWRITE(name);
|
||||||
|
READWRITE(outPoint);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class CClaimIndexElement
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
template <typename Stream, typename Operation>
|
||||||
|
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||||
|
READWRITE(name);
|
||||||
|
READWRITE(claim);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string name;
|
||||||
|
CClaimValue claim;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::pair<std::string, CClaimValue> claimQueueEntryType;
|
||||||
|
|
||||||
|
typedef std::pair<std::string, CSupportValue> supportQueueEntryType;
|
||||||
|
|
||||||
|
typedef std::map<std::string, supportMapEntryType> supportMapType;
|
||||||
|
|
||||||
|
typedef std::vector<outPointHeightType> queueNameRowType;
|
||||||
|
typedef std::map<std::string, queueNameRowType> queueNameType;
|
||||||
|
|
||||||
|
typedef std::vector<nameOutPointHeightType> insertUndoType;
|
||||||
|
|
||||||
|
typedef std::vector<nameOutPointType> expirationQueueRowType;
|
||||||
|
typedef std::map<int, expirationQueueRowType> expirationQueueType;
|
||||||
|
|
||||||
|
typedef std::vector<claimQueueEntryType> claimQueueRowType;
|
||||||
|
typedef std::map<int, claimQueueRowType> claimQueueType;
|
||||||
|
|
||||||
|
typedef std::vector<supportQueueEntryType> supportQueueRowType;
|
||||||
|
typedef std::map<int, supportQueueRowType> supportQueueType;
|
||||||
|
|
||||||
|
typedef std::map<std::string, CClaimTrieNode*, nodenamecompare> nodeCacheType;
|
||||||
|
|
||||||
|
typedef std::map<std::string, uint256> hashMapType;
|
||||||
|
|
||||||
|
typedef std::set<CClaimValue> claimIndexClaimListType;
|
||||||
|
typedef std::vector<CClaimIndexElement> claimIndexElementListType;
|
||||||
|
|
||||||
|
struct claimsForNameType
|
||||||
|
{
|
||||||
|
std::vector<CClaimValue> claims;
|
||||||
|
std::vector<CSupportValue> supports;
|
||||||
|
int nLastTakeoverHeight;
|
||||||
|
std::string name;
|
||||||
|
|
||||||
|
claimsForNameType(std::vector<CClaimValue> claims, std::vector<CSupportValue> supports,
|
||||||
|
int nLastTakeoverHeight, const std::string& name)
|
||||||
|
: claims(std::move(claims)), supports(std::move(supports)),
|
||||||
|
nLastTakeoverHeight(nLastTakeoverHeight), name(name) {}
|
||||||
|
|
||||||
|
claimsForNameType(const claimsForNameType&) = default;
|
||||||
|
claimsForNameType(claimsForNameType&& other)
|
||||||
|
{
|
||||||
|
claims = std::move(other.claims);
|
||||||
|
supports = std::move(other.supports);
|
||||||
|
name = std::move(other.name);
|
||||||
|
nLastTakeoverHeight = other.nLastTakeoverHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
claimsForNameType& operator=(const claimsForNameType&) = default;
|
||||||
|
claimsForNameType& operator=(claimsForNameType&& other)
|
||||||
|
{
|
||||||
|
if (this != &other)
|
||||||
|
{
|
||||||
|
claims = std::move(other.claims);
|
||||||
|
supports = std::move(other.supports);
|
||||||
|
name = std::move(other.name);
|
||||||
|
nLastTakeoverHeight = other.nLastTakeoverHeight;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~claimsForNameType() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class CClaimTrieCacheBase;
|
||||||
|
class CClaimTrieCacheExpirationFork;
|
||||||
|
|
||||||
|
class CClaimTrie
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CClaimTrie(bool fMemory = false, bool fWipe = false, int nProportionalDelayFactor = 32)
|
||||||
|
: db(GetDataDir() / "claimtrie", 20 * 1024 * 1024, fMemory, fWipe, false)
|
||||||
|
, nCurrentHeight(0), nExpirationTime(Params().GetConsensus().nOriginalClaimExpirationTime)
|
||||||
|
, nProportionalDelayFactor(nProportionalDelayFactor)
|
||||||
|
, root(uint256S("0000000000000000000000000000000000000000000000000000000000000001"))
|
||||||
|
{}
|
||||||
|
|
||||||
|
uint256 getMerkleHash();
|
||||||
|
|
||||||
|
bool empty() const;
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
bool checkConsistency() const;
|
||||||
|
|
||||||
|
bool WriteToDisk();
|
||||||
|
bool ReadFromDisk(bool check = false);
|
||||||
|
|
||||||
|
bool getInfoForName(const std::string& name, CClaimValue& claim) const;
|
||||||
|
bool getLastTakeoverForName(const std::string& name, int& lastTakeoverHeight) const;
|
||||||
|
|
||||||
|
std::vector<CClaimValue> getClaimsForName(const std::string& name) const;
|
||||||
|
|
||||||
|
bool queueEmpty() const;
|
||||||
|
bool supportEmpty() const;
|
||||||
|
bool supportQueueEmpty() const;
|
||||||
|
bool expirationQueueEmpty() const;
|
||||||
|
|
||||||
|
void setExpirationTime(int t);
|
||||||
|
|
||||||
|
void addToClaimIndex(const std::string& name, const CClaimValue& claim);
|
||||||
|
void removeFromClaimIndex(const CClaimValue& claim);
|
||||||
|
|
||||||
|
bool getClaimById(const uint160 claimId, std::string& name, CClaimValue& claim) const;
|
||||||
|
|
||||||
|
bool haveClaim(const std::string& name, const COutPoint& outPoint) const;
|
||||||
|
bool haveClaimInQueue(const std::string& name, const COutPoint& outPoint,
|
||||||
|
int& nValidAtHeight) const;
|
||||||
|
|
||||||
|
bool haveSupport(const std::string& name, const COutPoint& outPoint) const;
|
||||||
|
bool haveSupportInQueue(const std::string& name, const COutPoint& outPoint,
|
||||||
|
int& nValidAtHeight) const;
|
||||||
|
|
||||||
|
unsigned int getTotalNamesInTrie() const;
|
||||||
|
unsigned int getTotalClaimsInTrie() const;
|
||||||
|
CAmount getTotalValueOfClaimsInTrie(bool fControllingOnly) const;
|
||||||
|
|
||||||
|
friend class CClaimTrieCacheBase;
|
||||||
|
friend class CClaimTrieCacheExpirationFork;
|
||||||
|
|
||||||
|
CDBWrapper db;
|
||||||
|
int nCurrentHeight;
|
||||||
|
int nExpirationTime;
|
||||||
|
int nProportionalDelayFactor;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void clear(CClaimTrieNode* current);
|
||||||
|
|
||||||
|
const CClaimTrieNode* getNodeForName(const std::string& name) const;
|
||||||
|
|
||||||
|
bool update(nodeCacheType& cache, hashMapType& hashes,
|
||||||
|
std::map<std::string, int>& takeoverHeights,
|
||||||
|
const uint256& hashBlock, claimQueueType& queueCache,
|
||||||
|
queueNameType& queueNameCache,
|
||||||
|
expirationQueueType& expirationQueueCache, int nNewHeight,
|
||||||
|
supportMapType& supportCache,
|
||||||
|
supportQueueType& supportQueueCache,
|
||||||
|
queueNameType& supportQueueNameCache,
|
||||||
|
expirationQueueType& supportExpirationQueueCache);
|
||||||
|
bool updateName(const std::string& name, CClaimTrieNode* updatedNode);
|
||||||
|
bool updateHash(const std::string& name, uint256& hash);
|
||||||
|
bool updateTakeoverHeight(const std::string& name, int nTakeoverHeight);
|
||||||
|
bool recursiveNullify(CClaimTrieNode* node, const std::string& name);
|
||||||
|
|
||||||
|
bool recursiveCheckConsistency(const CClaimTrieNode* node) const;
|
||||||
|
|
||||||
|
bool InsertFromDisk(const std::string& name, CClaimTrieNode* node);
|
||||||
|
|
||||||
|
unsigned int getTotalNamesRecursive(const CClaimTrieNode* current) const;
|
||||||
|
unsigned int getTotalClaimsRecursive(const CClaimTrieNode* current) const;
|
||||||
|
CAmount getTotalValueOfClaimsRecursive(const CClaimTrieNode* current,
|
||||||
|
bool fControllingOnly) const;
|
||||||
|
|
||||||
|
bool getQueueRow(int nHeight, claimQueueRowType& row) const;
|
||||||
|
bool getQueueNameRow(const std::string& name, queueNameRowType& row) const;
|
||||||
|
bool getExpirationQueueRow(int nHeight, expirationQueueRowType& row) const;
|
||||||
|
bool getSupportNode(std::string name, supportMapEntryType& node) const;
|
||||||
|
bool getSupportQueueRow(int nHeight, supportQueueRowType& row) const;
|
||||||
|
bool getSupportQueueNameRow(const std::string& name, queueNameRowType& row) const;
|
||||||
|
bool getSupportExpirationQueueRow(int nHeight, expirationQueueRowType& row) const;
|
||||||
|
|
||||||
|
void markNodeDirty(const std::string& name, CClaimTrieNode* node);
|
||||||
|
void updateQueueRow(int nHeight, claimQueueRowType& row);
|
||||||
|
void updateQueueNameRow(const std::string& name,
|
||||||
|
queueNameRowType& row);
|
||||||
|
void updateExpirationRow(int nHeight, expirationQueueRowType& row);
|
||||||
|
void updateSupportMap(const std::string& name, supportMapEntryType& node);
|
||||||
|
void updateSupportQueue(int nHeight, supportQueueRowType& row);
|
||||||
|
void updateSupportNameQueue(const std::string& name,
|
||||||
|
queueNameRowType& row);
|
||||||
|
void updateSupportExpirationQueue(int nHeight, expirationQueueRowType& row);
|
||||||
|
|
||||||
|
void BatchWriteNode(CDBBatch& batch, const std::string& name,
|
||||||
|
const CClaimTrieNode* pNode) const;
|
||||||
|
void BatchWriteQueueRows(CDBBatch& batch);
|
||||||
|
void BatchWriteQueueNameRows(CDBBatch& batch);
|
||||||
|
void BatchWriteExpirationQueueRows(CDBBatch& batch);
|
||||||
|
void BatchWriteSupportNodes(CDBBatch& batch);
|
||||||
|
void BatchWriteSupportQueueRows(CDBBatch& batch);
|
||||||
|
void BatchWriteSupportQueueNameRows(CDBBatch& batch);
|
||||||
|
void BatchWriteSupportExpirationQueueRows(CDBBatch& batch);
|
||||||
|
template<typename K> bool keyTypeEmpty(char key, K& dummy) const;
|
||||||
|
|
||||||
|
CClaimTrieNode root;
|
||||||
|
uint256 hashBlock;
|
||||||
|
|
||||||
|
claimQueueType dirtyQueueRows;
|
||||||
|
queueNameType dirtyQueueNameRows;
|
||||||
|
expirationQueueType dirtyExpirationQueueRows;
|
||||||
|
|
||||||
|
supportQueueType dirtySupportQueueRows;
|
||||||
|
queueNameType dirtySupportQueueNameRows;
|
||||||
|
expirationQueueType dirtySupportExpirationQueueRows;
|
||||||
|
|
||||||
|
nodeCacheType dirtyNodes;
|
||||||
|
supportMapType dirtySupportNodes;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CClaimTrieProofNode
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CClaimTrieProofNode() {};
|
||||||
|
CClaimTrieProofNode(std::vector<std::pair<unsigned char, uint256> > children,
|
||||||
|
bool hasValue, uint256 valHash)
|
||||||
|
: children(std::move(children)), hasValue(hasValue), valHash(std::move(valHash))
|
||||||
|
{};
|
||||||
|
CClaimTrieProofNode(const CClaimTrieProofNode&) = default;
|
||||||
|
CClaimTrieProofNode(CClaimTrieProofNode&& other)
|
||||||
|
{
|
||||||
|
hasValue = other.hasValue;
|
||||||
|
valHash = std::move(other.valHash);
|
||||||
|
children = std::move(other.children);
|
||||||
|
}
|
||||||
|
CClaimTrieProofNode& operator=(const CClaimTrieProofNode&) = default;
|
||||||
|
CClaimTrieProofNode& operator=(CClaimTrieProofNode&& other)
|
||||||
|
{
|
||||||
|
if (this != &other)
|
||||||
|
{
|
||||||
|
hasValue = other.hasValue;
|
||||||
|
valHash = std::move(other.valHash);
|
||||||
|
children = std::move(other.children);
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::pair<unsigned char, uint256> > children;
|
||||||
|
bool hasValue;
|
||||||
|
uint256 valHash;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CClaimTrieProof
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CClaimTrieProof() {};
|
||||||
|
CClaimTrieProof(std::vector<CClaimTrieProofNode> nodes, bool hasValue, COutPoint outPoint, int nHeightOfLastTakeover) : nodes(std::move(nodes)), hasValue(hasValue), outPoint(outPoint), nHeightOfLastTakeover(nHeightOfLastTakeover) {}
|
||||||
|
CClaimTrieProof(const CClaimTrieProof&) = default;
|
||||||
|
CClaimTrieProof(CClaimTrieProof&& other)
|
||||||
|
{
|
||||||
|
hasValue = other.hasValue;
|
||||||
|
outPoint = std::move(other.outPoint);
|
||||||
|
nodes = std::move(other.nodes);
|
||||||
|
nHeightOfLastTakeover = other.nHeightOfLastTakeover;
|
||||||
|
}
|
||||||
|
|
||||||
|
CClaimTrieProof& operator=(const CClaimTrieProof&) = default;
|
||||||
|
CClaimTrieProof& operator=(CClaimTrieProof&& other)
|
||||||
|
{
|
||||||
|
if (this != &other)
|
||||||
|
{
|
||||||
|
hasValue = other.hasValue;
|
||||||
|
outPoint = std::move(other.outPoint);
|
||||||
|
nodes = std::move(other.nodes);
|
||||||
|
nHeightOfLastTakeover = other.nHeightOfLastTakeover;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<CClaimTrieProofNode> nodes;
|
||||||
|
bool hasValue;
|
||||||
|
COutPoint outPoint;
|
||||||
|
int nHeightOfLastTakeover;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CNodeCallback {
|
||||||
|
struct CRecursionInterruptionException : public std::exception {
|
||||||
|
const bool success;
|
||||||
|
explicit CRecursionInterruptionException(bool success) : success(success) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual ~CNodeCallback()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback to be called on every trie node
|
||||||
|
* @param[in] name full name of the node
|
||||||
|
* @param[in] node pointer to node itself
|
||||||
|
*
|
||||||
|
* To breakout early throw an exception.
|
||||||
|
* Throwing CRecursionInterruptionException will allow you to set the return value of iterateTrie.
|
||||||
|
*/
|
||||||
|
virtual void visit(const std::string& name, const CClaimTrieNode* node) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CClaimTrieCacheBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CClaimTrieCacheBase(CClaimTrie* base, bool fRequireTakeoverHeights = true)
|
||||||
|
: base(base), fRequireTakeoverHeights(fRequireTakeoverHeights)
|
||||||
|
{
|
||||||
|
assert(base);
|
||||||
|
nCurrentHeight = base->nCurrentHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint256 getMerkleHash(bool forceCompute = false) const;
|
||||||
|
|
||||||
|
bool empty() const;
|
||||||
|
bool flush();
|
||||||
|
bool dirty() const { return !dirtyHashes.empty(); }
|
||||||
|
|
||||||
|
CClaimTrieNode* getRoot() const
|
||||||
|
{
|
||||||
|
const auto iter = cache.find("");
|
||||||
|
return iter == cache.end() ? &(base->root) : iter->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool addClaim(const std::string& name, const COutPoint& outPoint,
|
||||||
|
uint160 claimId, CAmount nAmount, int nHeight) const;
|
||||||
|
bool undoAddClaim(const std::string& name, const COutPoint& outPoint, int nHeight) const;
|
||||||
|
bool spendClaim(const std::string& name, const COutPoint& outPoint, int nHeight, int& nValidAtHeight) const;
|
||||||
|
bool undoSpendClaim(const std::string& name, const COutPoint& outPoint,
|
||||||
|
uint160 claimId, CAmount nAmount, int nHeight,
|
||||||
|
int nValidAtHeight) const;
|
||||||
|
|
||||||
|
bool addSupport(const std::string& name, const COutPoint& outPoint,
|
||||||
|
CAmount nAmount, uint160 supportedClaimId,
|
||||||
|
int nHeight) const;
|
||||||
|
bool undoAddSupport(const std::string& name, const COutPoint& outPoint,
|
||||||
|
int nHeight) const;
|
||||||
|
bool spendSupport(const std::string& name, const COutPoint& outPoint,
|
||||||
|
int nHeight, int& nValidAtHeight) const;
|
||||||
|
bool undoSpendSupport(const std::string& name, const COutPoint& outPoint,
|
||||||
|
uint160 supportedClaimId, CAmount nAmount,
|
||||||
|
int nHeight, int nValidAtHeight) const;
|
||||||
|
|
||||||
|
uint256 getBestBlock();
|
||||||
|
void setBestBlock(const uint256& hashBlock);
|
||||||
|
|
||||||
|
virtual bool incrementBlock(insertUndoType& insertUndo,
|
||||||
|
claimQueueRowType& expireUndo,
|
||||||
|
insertUndoType& insertSupportUndo,
|
||||||
|
supportQueueRowType& expireSupportUndo,
|
||||||
|
std::vector<std::pair<std::string, int> >& takeoverHeightUndo);
|
||||||
|
virtual bool decrementBlock(insertUndoType& insertUndo,
|
||||||
|
claimQueueRowType& expireUndo,
|
||||||
|
insertUndoType& insertSupportUndo,
|
||||||
|
supportQueueRowType& expireSupportUndo,
|
||||||
|
std::vector<std::pair<std::string, int> >& takeoverHeightUndo);
|
||||||
|
|
||||||
|
virtual ~CClaimTrieCacheBase() { clear(); }
|
||||||
|
|
||||||
|
virtual bool getProofForName(const std::string& name, CClaimTrieProof& proof) const;
|
||||||
|
virtual bool getInfoForName(const std::string& name, CClaimValue& claim) const;
|
||||||
|
|
||||||
|
bool finalizeDecrement() const;
|
||||||
|
|
||||||
|
bool iterateTrie(CNodeCallback& callback) const;
|
||||||
|
|
||||||
|
virtual claimsForNameType getClaimsForName(const std::string& name) const;
|
||||||
|
|
||||||
|
CAmount getEffectiveAmountForClaim(const std::string& name, const uint160& claimId,
|
||||||
|
std::vector<CSupportValue>* supports = nullptr) const;
|
||||||
|
CAmount getEffectiveAmountForClaim(const claimsForNameType& claims, const uint160& claimId,
|
||||||
|
std::vector<CSupportValue>* supports = nullptr) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Should be private: Do not use unless you know what you're doing.
|
||||||
|
CClaimTrieNode* addNodeToCache(const std::string& position, CClaimTrieNode* original) const;
|
||||||
|
bool recursiveComputeMerkleHash(CClaimTrieNode* tnCurrent,
|
||||||
|
const std::string& sPos,
|
||||||
|
bool forceCompute = false) const;
|
||||||
|
bool recursivePruneName(CClaimTrieNode* tnCurrent, unsigned int nPos, const std::string& sName, bool* pfNullified = nullptr) const;
|
||||||
|
void checkNamesForTakeover(insertUndoType& insertUndo, insertUndoType& insertSupportUndo,
|
||||||
|
std::vector<std::pair<std::string, int> >& takeoverHeightUndo) const;
|
||||||
|
|
||||||
|
virtual bool insertClaimIntoTrie(const std::string& name, CClaimValue claim,
|
||||||
|
bool fCheckTakeover = false) const;
|
||||||
|
virtual bool removeClaimFromTrie(const std::string& name, const COutPoint& outPoint,
|
||||||
|
CClaimValue& claim,
|
||||||
|
bool fCheckTakeover = false) const;
|
||||||
|
|
||||||
|
virtual bool insertSupportIntoMap(const std::string& name,
|
||||||
|
CSupportValue support,
|
||||||
|
bool fCheckTakeover) const;
|
||||||
|
virtual bool removeSupportFromMap(const std::string& name, const COutPoint& outPoint,
|
||||||
|
CSupportValue& support,
|
||||||
|
bool fCheckTakeover) const;
|
||||||
|
|
||||||
|
virtual void addClaimToQueues(const std::string& name, CClaimValue& claim) const;
|
||||||
|
virtual bool addSupportToQueues(const std::string& name, CSupportValue& support) const;
|
||||||
|
virtual std::string adjustNameForValidHeight(const std::string& name, int validHeight) const;
|
||||||
|
|
||||||
|
void addToExpirationQueue(int nExpirationHeight, nameOutPointType& entry) const;
|
||||||
|
void removeFromExpirationQueue(const std::string& name, const COutPoint& outPoint,
|
||||||
|
int nHeight) const;
|
||||||
|
|
||||||
|
void addSupportToExpirationQueue(int nExpirationHeight,
|
||||||
|
nameOutPointType& entry) const;
|
||||||
|
void removeSupportFromExpirationQueue(const std::string& name,
|
||||||
|
const COutPoint& outPoint,
|
||||||
|
int nHeight) const;
|
||||||
|
|
||||||
|
bool getSupportsForName(const std::string& name,
|
||||||
|
supportMapEntryType& supports) const;
|
||||||
|
|
||||||
|
virtual int getDelayForName(const std::string& name, const uint160& claimId) const;
|
||||||
|
|
||||||
|
mutable nodeCacheType cache;
|
||||||
|
CClaimTrie* base;
|
||||||
|
mutable int nCurrentHeight; // Height of the block that is being worked on, which is
|
||||||
|
// one greater than the height of the chain's tip
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
bool fRequireTakeoverHeights;
|
||||||
|
|
||||||
|
mutable nodeCacheType block_originals;
|
||||||
|
mutable std::set<std::string> dirtyHashes;
|
||||||
|
mutable hashMapType cacheHashes;
|
||||||
|
mutable claimQueueType claimQueueCache;
|
||||||
|
mutable queueNameType claimQueueNameCache;
|
||||||
|
mutable expirationQueueType expirationQueueCache;
|
||||||
|
mutable supportMapType supportCache;
|
||||||
|
mutable supportQueueType supportQueueCache;
|
||||||
|
mutable queueNameType supportQueueNameCache;
|
||||||
|
mutable expirationQueueType supportExpirationQueueCache;
|
||||||
|
mutable std::set<std::string> namesToCheckForTakeover;
|
||||||
|
mutable std::map<std::string, int> cacheTakeoverHeights;
|
||||||
|
mutable claimIndexElementListType claimsToAdd;
|
||||||
|
mutable claimIndexClaimListType claimsToDelete;
|
||||||
|
|
||||||
|
uint256 hashBlock;
|
||||||
|
|
||||||
|
bool reorderTrieNode(const std::string& name, bool fCheckTakeover) const;
|
||||||
|
|
||||||
|
bool clear() const;
|
||||||
|
|
||||||
|
// generally the opposite of addClaimToQueues, but they aren't perfectly symmetrical:
|
||||||
|
bool removeClaim(const std::string& name, const COutPoint& outPoint, int nHeight, int& nValidAtHeight, bool fCheckTakeover) const;
|
||||||
|
bool removeClaimFromQueue(const std::string& name, const COutPoint& outPoint,
|
||||||
|
CClaimValue& claim) const;
|
||||||
|
|
||||||
|
claimQueueType::iterator getQueueCacheRow(int nHeight,
|
||||||
|
bool createIfNotExists) const;
|
||||||
|
queueNameType::iterator getQueueCacheNameRow(const std::string& name,
|
||||||
|
bool createIfNotExists) const;
|
||||||
|
expirationQueueType::iterator getExpirationQueueCacheRow(int nHeight,
|
||||||
|
bool createIfNotExists) const;
|
||||||
|
|
||||||
|
bool removeSupport(const std::string& name, const COutPoint& outPoint,
|
||||||
|
int nHeight, int& nValidAtHeight,
|
||||||
|
bool fCheckTakeover) const;
|
||||||
|
|
||||||
|
supportQueueType::iterator getSupportQueueCacheRow(int nHeight,
|
||||||
|
bool createIfNotExists) const;
|
||||||
|
queueNameType::iterator getSupportQueueCacheNameRow(const std::string& name,
|
||||||
|
bool createIfNotExists) const;
|
||||||
|
expirationQueueType::iterator getSupportExpirationQueueCacheRow(int nHeight,
|
||||||
|
bool createIfNotExists) const;
|
||||||
|
|
||||||
|
bool removeSupportFromQueue(const std::string& name, const COutPoint& outPoint,
|
||||||
|
CSupportValue& support) const;
|
||||||
|
|
||||||
|
bool getLastTakeoverForName(const std::string& name, int& lastTakeoverHeight) const;
|
||||||
|
|
||||||
|
int getDelayForName(const std::string& name) const;
|
||||||
|
|
||||||
|
uint256 getLeafHashForProof(const std::string& currentPosition, const CClaimTrieNode* currentNode) const;
|
||||||
|
|
||||||
|
bool getOriginalInfoForName(const std::string& name, CClaimValue& claim) const;
|
||||||
|
|
||||||
|
int getNumBlocksOfContinuousOwnership(const std::string& name) const;
|
||||||
|
|
||||||
|
void recursiveIterateTrie(std::string& name, const CClaimTrieNode* current, CNodeCallback& callback) const;
|
||||||
|
|
||||||
|
const CClaimTrieNode* getNodeForName(const std::string& name) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CClaimTrieCacheExpirationFork: public CClaimTrieCacheBase {
|
||||||
|
public:
|
||||||
|
CClaimTrieCacheExpirationFork(CClaimTrie* base, bool fRequireTakeoverHeights = true)
|
||||||
|
: CClaimTrieCacheBase(base, fRequireTakeoverHeights) {}
|
||||||
|
|
||||||
|
virtual ~CClaimTrieCacheExpirationFork() {}
|
||||||
|
|
||||||
|
bool forkForExpirationChange(bool increment) const;
|
||||||
|
|
||||||
|
// TODO: move the expiration fork code from main.cpp to overrides of increment/decrement block
|
||||||
|
|
||||||
|
private:
|
||||||
|
void removeAndAddSupportToExpirationQueue(expirationQueueRowType &row, int height, bool increment) const;
|
||||||
|
void removeAndAddToExpirationQueue(expirationQueueRowType &row, int height, bool increment) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CClaimTrieCacheNormalizationFork: public CClaimTrieCacheExpirationFork {
|
||||||
|
public:
|
||||||
|
CClaimTrieCacheNormalizationFork(CClaimTrie* base, bool fRequireTakeoverHeights = true)
|
||||||
|
: CClaimTrieCacheExpirationFork(base, fRequireTakeoverHeights),
|
||||||
|
overrideInsertNormalization(false), overrideRemoveNormalization(false) {}
|
||||||
|
|
||||||
|
virtual ~CClaimTrieCacheNormalizationFork() {}
|
||||||
|
|
||||||
|
bool shouldNormalize() const;
|
||||||
|
|
||||||
|
// lower-case and normalize any input string name
|
||||||
|
// see: https://unicode.org/reports/tr15/#Norm_Forms
|
||||||
|
std::string normalizeClaimName(const std::string& name, bool force = false) const; // public only for validating name field on update op
|
||||||
|
|
||||||
|
virtual bool incrementBlock(insertUndoType& insertUndo,
|
||||||
|
claimQueueRowType& expireUndo,
|
||||||
|
insertUndoType& insertSupportUndo,
|
||||||
|
supportQueueRowType& expireSupportUndo,
|
||||||
|
std::vector<std::pair<std::string, int> >& takeoverHeightUndo);
|
||||||
|
virtual bool decrementBlock(insertUndoType& insertUndo,
|
||||||
|
claimQueueRowType& expireUndo,
|
||||||
|
insertUndoType& insertSupportUndo,
|
||||||
|
supportQueueRowType& expireSupportUndo,
|
||||||
|
std::vector<std::pair<std::string, int> >& takeoverHeightUndo);
|
||||||
|
|
||||||
|
virtual bool getProofForName(const std::string& name, CClaimTrieProof& proof) const;
|
||||||
|
virtual bool getInfoForName(const std::string& name, CClaimValue& claim) const;
|
||||||
|
virtual claimsForNameType getClaimsForName(const std::string& name) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual bool insertClaimIntoTrie(const std::string& name, CClaimValue claim, bool fCheckTakeover = false) const;
|
||||||
|
virtual bool removeClaimFromTrie(const std::string& name, const COutPoint& outPoint,
|
||||||
|
CClaimValue& claim, bool fCheckTakeover = false) const;
|
||||||
|
|
||||||
|
virtual bool insertSupportIntoMap(const std::string& name, CSupportValue support, bool fCheckTakeover) const;
|
||||||
|
virtual bool removeSupportFromMap(const std::string& name, const COutPoint& outPoint,
|
||||||
|
CSupportValue& support, bool fCheckTakeover) const;
|
||||||
|
virtual int getDelayForName(const std::string& name, const uint160& claimId) const;
|
||||||
|
|
||||||
|
virtual void addClaimToQueues(const std::string& name, CClaimValue& claim) const;
|
||||||
|
virtual bool addSupportToQueues(const std::string& name, CSupportValue& support) const;
|
||||||
|
virtual std::string adjustNameForValidHeight(const std::string& name, int validHeight) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool overrideInsertNormalization, overrideRemoveNormalization;
|
||||||
|
bool normalizeAllNamesInTrieIfNecessary(insertUndoType& insertUndo, claimQueueRowType& removeUndo,
|
||||||
|
insertUndoType& insertSupportUndo, supportQueueRowType& expireSupportUndo,
|
||||||
|
std::vector<std::pair<std::string, int> >& takeoverHeightUndo) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef CClaimTrieCacheNormalizationFork CClaimTrieCache;
|
||||||
|
|
||||||
|
#endif // BITCOIN_CLAIMTRIE_H
|
300
src/claimtrieforks.cpp
Normal file
300
src/claimtrieforks.cpp
Normal file
|
@ -0,0 +1,300 @@
|
||||||
|
#include "claimtrie.h"
|
||||||
|
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
#include <boost/locale/conversion.hpp>
|
||||||
|
#include <boost/locale/localization_backend.hpp>
|
||||||
|
#include <boost/locale.hpp>
|
||||||
|
#include <boost/scope_exit.hpp>
|
||||||
|
|
||||||
|
void CClaimTrieCacheExpirationFork::removeAndAddToExpirationQueue(expirationQueueRowType &row, int height, bool increment) const
|
||||||
|
{
|
||||||
|
for (expirationQueueRowType::iterator e = row.begin(); e != row.end(); ++e)
|
||||||
|
{
|
||||||
|
// remove and insert with new expiration time
|
||||||
|
removeFromExpirationQueue(e->name, e->outPoint, height);
|
||||||
|
int extend_expiration = Params().GetConsensus().nExtendedClaimExpirationTime - Params().GetConsensus().nOriginalClaimExpirationTime;
|
||||||
|
int new_expiration_height = increment ? height + extend_expiration : height - extend_expiration;
|
||||||
|
nameOutPointType entry(e->name, e->outPoint);
|
||||||
|
addToExpirationQueue(new_expiration_height, entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CClaimTrieCacheExpirationFork::removeAndAddSupportToExpirationQueue(expirationQueueRowType &row, int height, bool increment) const
|
||||||
|
{
|
||||||
|
for (expirationQueueRowType::iterator e = row.begin(); e != row.end(); ++e)
|
||||||
|
{
|
||||||
|
// remove and insert with new expiration time
|
||||||
|
removeSupportFromExpirationQueue(e->name, e->outPoint, height);
|
||||||
|
int extend_expiration = Params().GetConsensus().nExtendedClaimExpirationTime - Params().GetConsensus().nOriginalClaimExpirationTime;
|
||||||
|
int new_expiration_height = increment ? height + extend_expiration : height - extend_expiration;
|
||||||
|
nameOutPointType entry(e->name, e->outPoint);
|
||||||
|
addSupportToExpirationQueue(new_expiration_height, entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimTrieCacheExpirationFork::forkForExpirationChange(bool increment) const
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
If increment is True, we have forked to extend the expiration time, thus items in the expiration queue
|
||||||
|
will have their expiration extended by "new expiration time - original expiration time"
|
||||||
|
|
||||||
|
If increment is False, we are decremented a block to reverse the fork. Thus items in the expiration queue
|
||||||
|
will have their expiration extension removed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// look through dirty expiration queues
|
||||||
|
std::set<int> dirtyHeights;
|
||||||
|
for (expirationQueueType::const_iterator i = base->dirtyExpirationQueueRows.begin(); i != base->dirtyExpirationQueueRows.end(); ++i)
|
||||||
|
{
|
||||||
|
int height = i->first;
|
||||||
|
dirtyHeights.insert(height);
|
||||||
|
expirationQueueRowType row = i->second;
|
||||||
|
removeAndAddToExpirationQueue(row, height, increment);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::set<int> dirtySupportHeights;
|
||||||
|
for (expirationQueueType::const_iterator i = base->dirtySupportExpirationQueueRows.begin(); i != base->dirtySupportExpirationQueueRows.end(); ++i)
|
||||||
|
{
|
||||||
|
int height = i->first;
|
||||||
|
dirtySupportHeights.insert(height);
|
||||||
|
expirationQueueRowType row = i->second;
|
||||||
|
removeAndAddSupportToExpirationQueue(row, height, increment);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//look through db for expiration queues, if we haven't already found it in dirty expiration queue
|
||||||
|
boost::scoped_ptr<CDBIterator> pcursor(const_cast<CDBWrapper*>(&base->db)->NewIterator());
|
||||||
|
pcursor->SeekToFirst();
|
||||||
|
while (pcursor->Valid())
|
||||||
|
{
|
||||||
|
std::pair<char, int> key;
|
||||||
|
if (pcursor->GetKey(key))
|
||||||
|
{
|
||||||
|
int height = key.second;
|
||||||
|
// if we've looked through this in dirtyExprirationQueueRows, don't use it
|
||||||
|
// because its stale
|
||||||
|
if ((key.first == EXP_QUEUE_ROW) & (dirtyHeights.count(height) == 0))
|
||||||
|
{
|
||||||
|
expirationQueueRowType row;
|
||||||
|
if (pcursor->GetValue(row))
|
||||||
|
{
|
||||||
|
removeAndAddToExpirationQueue(row, height, increment);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return error("%s(): error reading expiration queue rows from disk", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((key.first == SUPPORT_EXP_QUEUE_ROW) & (dirtySupportHeights.count(height) == 0))
|
||||||
|
{
|
||||||
|
expirationQueueRowType row;
|
||||||
|
if (pcursor->GetValue(row))
|
||||||
|
{
|
||||||
|
removeAndAddSupportToExpirationQueue(row, height, increment);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return error("%s(): error reading support expiration queue rows from disk", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
pcursor->Next();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::shouldNormalize() const {
|
||||||
|
return nCurrentHeight > Params().GetConsensus().nNormalizedNameForkHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string CClaimTrieCacheNormalizationFork::normalizeClaimName(const std::string& name, bool force) const {
|
||||||
|
if (!force && !shouldNormalize())
|
||||||
|
return name;
|
||||||
|
|
||||||
|
static std::locale utf8;
|
||||||
|
static bool initialized = false;
|
||||||
|
if (!initialized) {
|
||||||
|
static boost::locale::localization_backend_manager manager =
|
||||||
|
boost::locale::localization_backend_manager::global();
|
||||||
|
manager.select("icu");
|
||||||
|
|
||||||
|
static boost::locale::generator curLocale(manager);
|
||||||
|
utf8 = curLocale("en_US.UTF8");
|
||||||
|
initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string normalized;
|
||||||
|
try {
|
||||||
|
|
||||||
|
// Check if it is a valid utf-8 string. If not, it will throw a
|
||||||
|
// boost::locale::conv::conversion_error exception which we catch later
|
||||||
|
normalized = boost::locale::conv::to_utf<char>(name, "UTF-8", boost::locale::conv::stop);
|
||||||
|
if (normalized.empty())
|
||||||
|
return name;
|
||||||
|
|
||||||
|
// these methods supposedly only use the "UTF8" portion of the locale object:
|
||||||
|
normalized = boost::locale::normalize(normalized, boost::locale::norm_nfd, utf8);
|
||||||
|
normalized = boost::locale::fold_case(normalized, utf8);
|
||||||
|
}
|
||||||
|
catch (const boost::locale::conv::conversion_error& e){
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
catch (const std::bad_cast& e) {
|
||||||
|
LogPrintf("%s() is invalid or dependencies are missing: %s\n", __func__, e.what());
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e) { // TODO: change to use ... with current_exception() in c++11
|
||||||
|
LogPrintf("%s() had an unexpected exception: %s\n", __func__, e.what());
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return normalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::insertClaimIntoTrie(const std::string& name, CClaimValue claim,
|
||||||
|
bool fCheckTakeover) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::insertClaimIntoTrie(normalizeClaimName(name, overrideInsertNormalization), claim, fCheckTakeover);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::removeClaimFromTrie(const std::string& name, const COutPoint& outPoint,
|
||||||
|
CClaimValue& claim, bool fCheckTakeover) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::removeClaimFromTrie(normalizeClaimName(name, overrideRemoveNormalization), outPoint, claim, fCheckTakeover);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::insertSupportIntoMap(const std::string& name, CSupportValue support,
|
||||||
|
bool fCheckTakeover) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::insertSupportIntoMap(normalizeClaimName(name, overrideInsertNormalization), support, fCheckTakeover);
|
||||||
|
}
|
||||||
|
bool CClaimTrieCacheNormalizationFork::removeSupportFromMap(const std::string& name, const COutPoint& outPoint,
|
||||||
|
CSupportValue& support, bool fCheckTakeover) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::removeSupportFromMap(normalizeClaimName(name, overrideRemoveNormalization), outPoint, support, fCheckTakeover);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct claimsForNormalization: public claimsForNameType {
|
||||||
|
std::string normalized;
|
||||||
|
claimsForNormalization(const std::vector<CClaimValue>& claims, const std::vector<CSupportValue>& supports,
|
||||||
|
int nLastTakeoverHeight, const std::string& name, const std::string& normalized)
|
||||||
|
: claimsForNameType(claims, supports, nLastTakeoverHeight, name), normalized(normalized) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::normalizeAllNamesInTrieIfNecessary(insertUndoType& insertUndo, claimQueueRowType& removeUndo,
|
||||||
|
insertUndoType& insertSupportUndo, supportQueueRowType& expireSupportUndo,
|
||||||
|
std::vector<std::pair<std::string, int> >& takeoverHeightUndo) const {
|
||||||
|
|
||||||
|
struct CNameChangeDetector: public CNodeCallback {
|
||||||
|
std::vector<claimsForNormalization> hits;
|
||||||
|
const CClaimTrieCacheNormalizationFork* owner;
|
||||||
|
CNameChangeDetector(const CClaimTrieCacheNormalizationFork* owner): owner(owner) {}
|
||||||
|
void visit(const std::string& name, const CClaimTrieNode* node) {
|
||||||
|
if (node->claims.empty()) return;
|
||||||
|
const std::string normalized = owner->normalizeClaimName(name, true);
|
||||||
|
if (normalized == name) return;
|
||||||
|
|
||||||
|
supportMapEntryType supports;
|
||||||
|
owner->getSupportsForName(name, supports);
|
||||||
|
const claimsForNormalization cfn(node->claims, supports, node->nHeightOfLastTakeover, name, normalized);
|
||||||
|
hits.push_back(cfn);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (nCurrentHeight == Params().GetConsensus().nNormalizedNameForkHeight) {
|
||||||
|
|
||||||
|
// run the one-time upgrade of all names that need to change
|
||||||
|
// it modifies the (cache) trie as it goes, so we need to grab
|
||||||
|
// everything to be modified first
|
||||||
|
CNameChangeDetector detector(this);
|
||||||
|
iterateTrie(detector);
|
||||||
|
|
||||||
|
for (std::vector<claimsForNormalization>::iterator it = detector.hits.begin(); it != detector.hits.end(); ++it) {
|
||||||
|
BOOST_FOREACH(CSupportValue support, it->supports) {
|
||||||
|
// if it's already going to expire just skip it
|
||||||
|
if (support.nHeight + base->nExpirationTime <= nCurrentHeight)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
bool success = removeSupportFromMap(it->name, support.outPoint, support, false);
|
||||||
|
assert(success);
|
||||||
|
expireSupportUndo.push_back(std::make_pair(it->name, support));
|
||||||
|
success = insertSupportIntoMap(it->normalized, support, false);
|
||||||
|
assert(success);
|
||||||
|
insertSupportUndo.push_back(nameOutPointHeightType(it->name, support.outPoint, -1));
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_FOREACH(CClaimValue claim, it->claims) {
|
||||||
|
if (claim.nHeight + base->nExpirationTime <= nCurrentHeight)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
bool success = removeClaimFromTrie(it->name, claim.outPoint, claim, false);
|
||||||
|
assert(success);
|
||||||
|
removeUndo.push_back(std::make_pair(it->name, claim));
|
||||||
|
|
||||||
|
success = insertClaimIntoTrie(it->normalized, claim, true);
|
||||||
|
assert(success);
|
||||||
|
insertUndo.push_back(nameOutPointHeightType(it->name, claim.outPoint, -1));
|
||||||
|
}
|
||||||
|
|
||||||
|
takeoverHeightUndo.push_back(std::make_pair(it->name, it->nLastTakeoverHeight));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::incrementBlock(insertUndoType& insertUndo,
|
||||||
|
claimQueueRowType& expireUndo,
|
||||||
|
insertUndoType& insertSupportUndo,
|
||||||
|
supportQueueRowType& expireSupportUndo,
|
||||||
|
std::vector<std::pair<std::string, int> >& takeoverHeightUndo) {
|
||||||
|
overrideInsertNormalization = normalizeAllNamesInTrieIfNecessary(insertUndo, expireUndo, insertSupportUndo,
|
||||||
|
expireSupportUndo, takeoverHeightUndo);
|
||||||
|
BOOST_SCOPE_EXIT(&overrideInsertNormalization) { overrideInsertNormalization = false; } BOOST_SCOPE_EXIT_END
|
||||||
|
return CClaimTrieCacheExpirationFork::incrementBlock(insertUndo, expireUndo, insertSupportUndo,
|
||||||
|
expireSupportUndo, takeoverHeightUndo);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::decrementBlock(insertUndoType& insertUndo,
|
||||||
|
claimQueueRowType& expireUndo,
|
||||||
|
insertUndoType& insertSupportUndo,
|
||||||
|
supportQueueRowType& expireSupportUndo,
|
||||||
|
std::vector<std::pair<std::string, int> >& takeoverHeightUndo) {
|
||||||
|
|
||||||
|
overrideRemoveNormalization = shouldNormalize();
|
||||||
|
BOOST_SCOPE_EXIT(&overrideRemoveNormalization) { overrideRemoveNormalization = false; } BOOST_SCOPE_EXIT_END
|
||||||
|
return CClaimTrieCacheExpirationFork::decrementBlock(insertUndo, expireUndo, insertSupportUndo,
|
||||||
|
expireSupportUndo, takeoverHeightUndo);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::getProofForName(const std::string& name, CClaimTrieProof& proof) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::getProofForName(normalizeClaimName(name), proof);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::getInfoForName(const std::string& name, CClaimValue& claim) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::getInfoForName(normalizeClaimName(name), claim);
|
||||||
|
}
|
||||||
|
|
||||||
|
claimsForNameType CClaimTrieCacheNormalizationFork::getClaimsForName(const std::string& name) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::getClaimsForName(normalizeClaimName(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
int CClaimTrieCacheNormalizationFork::getDelayForName(const std::string& name, const uint160& claimId) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::getDelayForName(normalizeClaimName(name), claimId);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CClaimTrieCacheNormalizationFork::addClaimToQueues(const std::string& name, CClaimValue& claim) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::addClaimToQueues(normalizeClaimName(name,
|
||||||
|
claim.nValidAtHeight > Params().GetConsensus().nNormalizedNameForkHeight), claim);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CClaimTrieCacheNormalizationFork::addSupportToQueues(const std::string& name, CSupportValue& support) const {
|
||||||
|
return CClaimTrieCacheExpirationFork::addSupportToQueues(normalizeClaimName(name,
|
||||||
|
support.nValidAtHeight > Params().GetConsensus().nNormalizedNameForkHeight), support);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string CClaimTrieCacheNormalizationFork::adjustNameForValidHeight(const std::string& name, int validHeight) const {
|
||||||
|
return normalizeClaimName(name, validHeight > Params().GetConsensus().nNormalizedNameForkHeight);
|
||||||
|
}
|
|
@ -12,7 +12,7 @@
|
||||||
* for both bitcoind and bitcoin-qt, to make it harder for attackers to
|
* for both bitcoind and bitcoin-qt, to make it harder for attackers to
|
||||||
* target servers or GUI users specifically.
|
* target servers or GUI users specifically.
|
||||||
*/
|
*/
|
||||||
const std::string CLIENT_NAME("Satoshi");
|
const std::string CLIENT_NAME("LBRY");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client version number
|
* Client version number
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
|
|
||||||
//! construct a Coin from a CTxOut and height/coinbase information.
|
//! construct a Coin from a CTxOut and height/coinbase information.
|
||||||
Coin(CTxOut&& outIn, int nHeightIn, bool fCoinBaseIn) : out(std::move(outIn)), fCoinBase(fCoinBaseIn), nHeight(nHeightIn) {}
|
Coin(CTxOut&& outIn, int nHeightIn, bool fCoinBaseIn) : out(std::move(outIn)), fCoinBase(fCoinBaseIn), nHeight(nHeightIn) {}
|
||||||
Coin(const CTxOut& outIn, int nHeightIn, bool fCoinBaseIn) : out(outIn), fCoinBase(fCoinBaseIn),nHeight(nHeightIn) {}
|
Coin(const CTxOut& outIn, int nHeightIn, bool fCoinBaseIn) : out(outIn), fCoinBase(fCoinBaseIn), nHeight(nHeightIn) {}
|
||||||
|
|
||||||
void Clear() {
|
void Clear() {
|
||||||
out.SetNull();
|
out.SetNull();
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/** The maximum allowed size for a serialized block, in bytes (only for buffer size limits) */
|
/** The maximum allowed size for a serialized block, in bytes (only for buffer size limits) */
|
||||||
static const unsigned int MAX_BLOCK_SERIALIZED_SIZE = 4000000;
|
static const unsigned int MAX_BLOCK_SERIALIZED_SIZE = 8000000;
|
||||||
/** The maximum allowed weight for a block, see BIP 141 (network rule) */
|
/** The maximum allowed weight for a block, see BIP 141 (network rule) */
|
||||||
static const unsigned int MAX_BLOCK_WEIGHT = 4000000;
|
static const unsigned int MAX_BLOCK_WEIGHT = 8000000;
|
||||||
/** The maximum allowed number of signature check operations in a block (network rule) */
|
/** The maximum allowed number of signature check operations in a block (network rule) */
|
||||||
static const int64_t MAX_BLOCK_SIGOPS_COST = 80000;
|
static const int64_t MAX_BLOCK_SIGOPS_COST = 80000;
|
||||||
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
|
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
|
||||||
|
|
|
@ -48,7 +48,11 @@ struct BIP9Deployment {
|
||||||
*/
|
*/
|
||||||
struct Params {
|
struct Params {
|
||||||
uint256 hashGenesisBlock;
|
uint256 hashGenesisBlock;
|
||||||
int nSubsidyHalvingInterval;
|
int nSubsidyLevelInterval;
|
||||||
|
/** Used to check majorities for block version upgrade */
|
||||||
|
int nMajorityEnforceBlockUpgrade;
|
||||||
|
int nMajorityRejectBlockOutdated;
|
||||||
|
int nMajorityWindow;
|
||||||
/* Block hash that is excepted from BIP16 enforcement */
|
/* Block hash that is excepted from BIP16 enforcement */
|
||||||
uint256 BIP16Exception;
|
uint256 BIP16Exception;
|
||||||
/** Block height and hash at which BIP34 becomes active */
|
/** Block height and hash at which BIP34 becomes active */
|
||||||
|
@ -70,8 +74,22 @@ struct Params {
|
||||||
uint256 powLimit;
|
uint256 powLimit;
|
||||||
bool fPowAllowMinDifficultyBlocks;
|
bool fPowAllowMinDifficultyBlocks;
|
||||||
bool fPowNoRetargeting;
|
bool fPowNoRetargeting;
|
||||||
|
int nAllowMinDiffMinHeight;
|
||||||
|
int nAllowMinDiffMaxHeight;
|
||||||
|
int nNormalizedNameForkHeight;
|
||||||
int64_t nPowTargetSpacing;
|
int64_t nPowTargetSpacing;
|
||||||
int64_t nPowTargetTimespan;
|
int64_t nPowTargetTimespan;
|
||||||
|
/** how long it took claims to expire before the hard fork */
|
||||||
|
int64_t nOriginalClaimExpirationTime;
|
||||||
|
/** how long it takes claims to expire after the hard fork */
|
||||||
|
int64_t nExtendedClaimExpirationTime;
|
||||||
|
/** blocks before the hard fork that changed the expiration time */
|
||||||
|
int64_t nExtendedClaimExpirationForkHeight;
|
||||||
|
int64_t GetExpirationTime(int64_t nHeight) const {
|
||||||
|
return nHeight < nExtendedClaimExpirationForkHeight ?
|
||||||
|
nOriginalClaimExpirationTime :
|
||||||
|
nExtendedClaimExpirationTime;
|
||||||
|
}
|
||||||
int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; }
|
int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; }
|
||||||
uint256 nMinimumChainWork;
|
uint256 nMinimumChainWork;
|
||||||
uint256 defaultAssumeValid;
|
uint256 defaultAssumeValid;
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#include <script/interpreter.h>
|
#include <script/interpreter.h>
|
||||||
#include <consensus/validation.h>
|
#include <consensus/validation.h>
|
||||||
|
|
||||||
|
#include <nameclaim.h>
|
||||||
|
|
||||||
// TODO remove the following dependencies
|
// TODO remove the following dependencies
|
||||||
#include <chain.h>
|
#include <chain.h>
|
||||||
#include <coins.h>
|
#include <coins.h>
|
||||||
|
@ -129,8 +131,9 @@ unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& in
|
||||||
const Coin& coin = inputs.AccessCoin(tx.vin[i].prevout);
|
const Coin& coin = inputs.AccessCoin(tx.vin[i].prevout);
|
||||||
assert(!coin.IsSpent());
|
assert(!coin.IsSpent());
|
||||||
const CTxOut &prevout = coin.out;
|
const CTxOut &prevout = coin.out;
|
||||||
if (prevout.scriptPubKey.IsPayToScriptHash())
|
const CScript& scriptPubKey = StripClaimScriptPrefix(prevout.scriptPubKey);
|
||||||
nSigOps += prevout.scriptPubKey.GetSigOpCount(tx.vin[i].scriptSig);
|
if (scriptPubKey.IsPayToScriptHash())
|
||||||
|
nSigOps += scriptPubKey.GetSigOpCount(tx.vin[i].scriptSig);
|
||||||
}
|
}
|
||||||
return nSigOps;
|
return nSigOps;
|
||||||
}
|
}
|
||||||
|
@ -178,6 +181,12 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe
|
||||||
nValueOut += txout.nValue;
|
nValueOut += txout.nValue;
|
||||||
if (!MoneyRange(nValueOut))
|
if (!MoneyRange(nValueOut))
|
||||||
return state.DoS(100, false, REJECT_INVALID, "bad-txns-txouttotal-toolarge");
|
return state.DoS(100, false, REJECT_INVALID, "bad-txns-txouttotal-toolarge");
|
||||||
|
|
||||||
|
// check claimtrie transactions
|
||||||
|
if (ClaimScriptSize(txout.scriptPubKey) > MAX_CLAIM_SCRIPT_SIZE)
|
||||||
|
return state.DoS(100, false, REJECT_INVALID, "bad-txns-claimscriptsize-toolarge");
|
||||||
|
if (ClaimNameSize(txout.scriptPubKey) > MAX_CLAIM_NAME_SIZE)
|
||||||
|
return state.DoS(100, false, REJECT_INVALID, "bad-txns-claimscriptname-toolarge");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for duplicate inputs - note that this check is slow so we skip it in CheckBlock
|
// Check for duplicate inputs - note that this check is slow so we skip it in CheckBlock
|
||||||
|
|
|
@ -18,7 +18,7 @@ static const unsigned char REJECT_INVALID = 0x10;
|
||||||
static const unsigned char REJECT_OBSOLETE = 0x11;
|
static const unsigned char REJECT_OBSOLETE = 0x11;
|
||||||
static const unsigned char REJECT_DUPLICATE = 0x12;
|
static const unsigned char REJECT_DUPLICATE = 0x12;
|
||||||
static const unsigned char REJECT_NONSTANDARD = 0x40;
|
static const unsigned char REJECT_NONSTANDARD = 0x40;
|
||||||
// static const unsigned char REJECT_DUST = 0x41; // part of BIP 61
|
static const unsigned char REJECT_DUST = 0x41; // part of BIP 61
|
||||||
static const unsigned char REJECT_INSUFFICIENTFEE = 0x42;
|
static const unsigned char REJECT_INSUFFICIENTFEE = 0x42;
|
||||||
static const unsigned char REJECT_CHECKPOINT = 0x43;
|
static const unsigned char REJECT_CHECKPOINT = 0x43;
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue