diff --git a/.gitignore b/.gitignore index d083c63ea..3aac53fa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,14 @@ *.tar.gz *.exe -src/bitcoin -src/bitcoind -src/bitcoin-cli -src/bitcoin-tx -src/test/test_bitcoin -src/test/test_bitcoin_fuzzy -src/qt/test/test_bitcoin-qt +src/lbrycrd +src/lbrycrdd +src/lbrycrd-cli +src/lbrycrd-tx +src/test/test_lbrycrd +src/test/test_lbrycrd_fuzzy +src/qt/lbrycrd-qt +src/qt/test/test_lbrycrd-qt # autoreconf Makefile.in @@ -61,7 +62,6 @@ src/qt/bitcoin-qt.includes *.pyc *.o *.o-* -*.patch *.a *.pb.cc *.pb.h @@ -116,3 +116,6 @@ test/cache/* libbitcoinconsensus.pc contrib/devtools/split-debug.sh + +.idea +cmake-build-*/ diff --git a/.travis.yml b/.travis.yml index 91b5af0f3..cb85f094d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,164 +1,70 @@ -dist: trusty -os: linux -language: minimal +matrix: + include: + - 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: + apt: true ccache: true directories: + - build - depends/built - - depends/sdk-sources - - $HOME/.ccache -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" +git: + depth: false before_install: - - export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g") - - BEGIN_FOLD () { echo ""; CURRENT_FOLD_NAME=$1; echo "travis_fold:start:${CURRENT_FOLD_NAME}"; } - - END_FOLD () { RET=$?; echo "travis_fold:end:${CURRENT_FOLD_NAME}"; return $RET; } -install: - - travis_retry docker pull $DOCKER_NAME_TAG - - env | grep -E '^(CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL)' | tee /tmp/env - - 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 +- date +%s > "${TRAVIS_BUILD_DIR}/start_time" +- ls -lh build +- du -h -d 2 build +- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install ccache; fi +- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi +install: true script: - - export TRAVIS_COMMIT_LOG=`git log --format=fuller -1` - - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST - - BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" - - if [ -z "$NO_DEPENDS" ]; then DOCKER_EXEC ccache --max-size=$CCACHE_SIZE; fi - - BEGIN_FOLD autogen; test -n "$CONFIG_SHELL" && DOCKER_EXEC "$CONFIG_SHELL" -c "./autogen.sh" || DOCKER_EXEC ./autogen.sh; END_FOLD - - mkdir build && cd build - - BEGIN_FOLD configure; DOCKER_EXEC ../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false); END_FOLD - - BEGIN_FOLD distdir; DOCKER_EXEC make distdir VERSION=$HOST; END_FOLD - - cd bitcoin-$HOST - - BEGIN_FOLD configure; DOCKER_EXEC ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false); END_FOLD - - BEGIN_FOLD build; DOCKER_EXEC make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make $GOAL V=1 ; false ); END_FOLD - - 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 - - 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 - - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then extended="--extended --exclude feature_pruning,feature_dbcrash"; fi - - 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 -after_script: - - echo $TRAVIS_COMMIT_RANGE - - echo $TRAVIS_COMMIT_LOG -jobs: - include: -# ARM - - stage: test - env: >- - HOST=arm-linux-gnueabihf - PACKAGES="g++-arm-linux-gnueabihf" - DEP_OPTS="NO_QT=1" - GOAL="install" - BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" -# Win32 - - stage: test - env: >- - HOST=i686-w64-mingw32 - DPKG_ADD_ARCH="i386" - DEP_OPTS="NO_QT=1" - PACKAGES="python3 nsis g++-mingw-w64-i686 wine-binfmt wine32" - RUN_TESTS=true - GOAL="install" - BITCOIN_CONFIG="--enable-reduce-exports" -# 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 +- mkdir -p "dist/${TRAVIS_BRANCH}" +- if [[ "${TARGET}" == "osx" ]]; then ./reproducible_build.sh -t -o -c -r; fi +- if [[ "${TARGET}" == "linux" ]]; then ./reproducible_build.sh -t -o -c -r; fi +- if [[ "${TARGET}" == "windows" ]]; then ./packaging/build_windows.sh; fi +- if [[ "${TARGET}" == "osx" ]]; then zip -j "dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip" src/lbrycrdd src/lbrycrd-cli src/lbrycrd-tx; fi +- if [[ "${TARGET}" == "linux" ]]; then zip -j "dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip" src/lbrycrdd src/lbrycrd-cli src/lbrycrd-tx; fi +- if [[ "${TARGET}" == "windows" ]]; then zip -j "dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip" src/lbrycrdd.exe src/lbrycrd-cli.exe src/lbrycrd-tx.exe; fi +- if [[ "${TARGET}" == "osx" ]]; then shasum -a 256 dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip > dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}-sha256.txt; fi +- if [[ "${TARGET}" == "linux" ]]; then sha256sum -b dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip > dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}-sha256.txt; fi +- if [[ "${TARGET}" == "windows" ]]; then sha256sum -b dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip > dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}-sha256.txt; fi +- cat dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}-sha256.txt +before_cache: +- ls -lh build +- du -h -d 2 build +deploy: +- provider: releases + draft: true + file: "dist/${TRAVIS_BRANCH}/lbrycrd-${TARGET}.zip" + name: "${TRAVIS_BRANCH}" + skip_cleanup: true + target_commitish: $TRAVIS_COMMIT + tag_name: $TRAVIS_TAG + on: + tags: true + api_key: + 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=" +- provider: s3 + access_key_id: AKIAICKFHNTR5RITASAQ + secret_access_key: + 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= + bucket: build.lbry.io + upload-dir: lbrycrd + acl: public_read + local_dir: dist + skip_cleanup: true + on: + repo: lbryio/lbrycrd + all_branches: true diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..90d03e7ea --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,57 @@ +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 program_options 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/rpc/*.h src/rpc/*.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 + ) +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) +foreach(test ${tests}) + get_filename_component(filename ${test} NAME_WE) + add_executable(${filename} ${test} ${sources}) + target_include_directories(${filename} PRIVATE src/test) +endforeach(test) diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..dc60f89cd --- /dev/null +++ b/LICENSE @@ -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. diff --git a/Makefile.am b/Makefile.am index 8972c47f4..23bac4daa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,7 +25,7 @@ BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EX empty := space := $(empty) $(empty) -OSX_APP=Bitcoin-Qt.app +OSX_APP=LBRYcrd-Qt.app OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME)) OSX_DMG = $(OSX_VOLNAME).dmg OSX_BACKGROUND_SVG=background.svg diff --git a/README.md b/README.md index 55b85da97..1a38dbf17 100644 --- a/README.md +++ b/README.md @@ -1,76 +1,94 @@ -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 -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. +Latest binaries are available from https://github.com/lbryio/lbrycrd/releases. There is no installation procedure, the binaries will be run as-is. -For more information, as well as an immediately useable, binary version of -the Bitcoin Core software, see https://bitcoincore.org/en/download/, or read the -[original whitepaper](https://bitcoincore.org/bitcoin.pdf). +## Usage -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 -information or see https://opensource.org/licenses/MIT. +### Example Usage -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) + +The codebase is in C++03. C++11 is currently not supported but we will be migrating to it in the near future. Recommended GCC version is 4.8 or greater. +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 -completely stable. [Tags](https://github.com/bitcoin/bitcoin/tags) are created -regularly to indicate new official, stable release versions of Bitcoin Core. - -The contribution workflow is described in [CONTRIBUTING.md](CONTRIBUTING.md). - -Testing -------- +completely stable. [Releases](https://github.com/lbryio/lbrycrd/releases) are created +regularly to indicate new official, stable release versions. 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 other people's pull requests, and remember this is a security-critical project where any mistake might cost people -lots of money. - -### Automated Testing - -Developers are strongly encouraged to write [unit tests](src/test/README.md) for new code, and to +lots of money. Developers are strongly encouraged to write [unit tests](/doc/unit-tests.md) for new code, and to 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 -and extending unit tests can be found in [/src/test/README.md](/src/test/README.md). +(assuming they weren't disabled in configure) with: `make check` -There are also [regression and integration tests](/test), written -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, and that unit and sanity tests are automatically run. -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 -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. +## License -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 -[Bitcoin Core's Transifex page](https://www.transifex.com/projects/p/bitcoin/). +## Security -Translations are periodically pulled from Transifex and merged into the git repository. See the -[translation process](doc/translation_process.md) for details on how this works. +We take security seriously. Please contact security@lbry.io regarding any security issues. +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). diff --git a/build-aux/m4/ax_boost_locale.m4 b/build-aux/m4/ax_boost_locale.m4 new file mode 100644 index 000000000..4f9883b72 --- /dev/null +++ b/build-aux/m4/ax_boost_locale.m4 @@ -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 +# . +# +# This macro calls: +# +# AC_SUBST(BOOST_LOCALE_LIB) +# +# And sets: +# +# HAVE_BOOST_LOCALE +# +# LICENSE +# +# Copyright (c) 2012 Xiyue Deng +# +# 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::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 +]) + diff --git a/configure.ac b/configure.ac index 844961708..f5ca7f920 100644 --- a/configure.ac +++ b/configure.ac @@ -5,19 +5,19 @@ define(_CLIENT_VERSION_MINOR, 17) define(_CLIENT_VERSION_REVISION, 1) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) -define(_COPYRIGHT_YEAR, 2018) +define(_COPYRIGHT_YEAR, 2019) define(_COPYRIGHT_HOLDERS,[The %s developers]) -define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Bitcoin Core]]) -AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://bitcoincore.org/]) +define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[LBRYcrd Core]]) +AC_INIT([LBRYcrd Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://bitcoincore.org/]) AC_CONFIG_SRCDIR([src/validation.cpp]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([build-aux/m4]) -BITCOIN_DAEMON_NAME=bitcoind -BITCOIN_GUI_NAME=bitcoin-qt -BITCOIN_CLI_NAME=bitcoin-cli -BITCOIN_TX_NAME=bitcoin-tx +BITCOIN_DAEMON_NAME=lbrycrdd +BITCOIN_GUI_NAME=lbrycrd-qt +BITCOIN_CLI_NAME=lbrycrd-cli +BITCOIN_TX_NAME=lbrycrd-tx dnl Unless the user specified ARFLAGS, force it to be cr AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to if not set]) @@ -146,6 +146,12 @@ AC_ARG_WITH([qrencode], [use_qr=$withval], [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], [AS_HELP_STRING([--disable-hardening], [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], [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=yes]) @@ -640,6 +646,7 @@ if test x$ac_cv_sys_large_files != x && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files" fi +AX_CHECK_LINK_FLAG([[-static-libstdc++]], [LDFLAGS="$LDFLAGS -static-libstdc++"]) AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"]) AX_GCC_FUNC_ATTRIBUTE([visibility]) @@ -783,7 +790,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ ) TEMP_LDFLAGS="$LDFLAGS" -LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS" +LDFLAGS="$TEMP_LDFLAGS $PTHREAD_LIBS" AC_MSG_CHECKING([for thread_local support]) AC_LINK_IFELSE([AC_LANG_SOURCE([ #include @@ -899,6 +906,7 @@ AX_BOOST_SYSTEM AX_BOOST_FILESYSTEM AX_BOOST_THREAD AX_BOOST_CHRONO +AX_BOOST_LOCALE 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. @@ -965,7 +973,7 @@ fi 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 @@ -1056,6 +1064,20 @@ 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 : dnl m4_ifdef( @@ -1085,7 +1107,19 @@ if test x$use_pkgconfig = xyes; then 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_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing)) @@ -1191,7 +1225,7 @@ AC_MSG_CHECKING([whether to build bitcoind]) AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes]) 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]) AC_MSG_RESULT($build_bitcoin_utils) @@ -1292,7 +1326,7 @@ if test x$bitcoin_enable_qt != xno; then AC_MSG_WARN("xgettext is required to update qt translations") 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 AC_MSG_RESULT([yes]) BUILD_TEST_QT="yes" @@ -1389,11 +1423,14 @@ AC_SUBST(LIBTOOL_APP_LDFLAGS) AC_SUBST(USE_UPNP) AC_SUBST(USE_QRCODE) AC_SUBST(BOOST_LIBS) +AC_SUBST(ICU_CPPFLAGS) +AC_SUBST(ICU_LIBS) AC_SUBST(TESTDEFS) AC_SUBST(LEVELDB_TARGET_FLAGS) AC_SUBST(MINIUPNPC_CPPFLAGS) AC_SUBST(MINIUPNPC_LIBS) AC_SUBST(CRYPTO_LIBS) +AC_SUBST(SSL_CFLAGS) AC_SUBST(SSL_LIBS) AC_SUBST(EVENT_LIBS) AC_SUBST(EVENT_PTHREADS_LIBS) @@ -1435,7 +1472,7 @@ if test x$need_bundled_univalue = xyes; then AC_CONFIG_SUBDIRS([src/univalue]) fi -ac_configure_args="${ac_configure_args} --disable-shared --with-pic --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_OUTPUT diff --git a/contrib/devtools/generate_json_api_jrgen.py b/contrib/devtools/generate_json_api_jrgen.py new file mode 100755 index 000000000..5f19a4d26 --- /dev/null +++ b/contrib/devtools/generate_json_api_jrgen.py @@ -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^.*?$)(?P.*?)(^Argument.*?$(?P.*?))?(^Result[^\n,]*?:\s*$(?P.*?))?(^Exampl.*?$(?P.*))?', re.DOTALL | re.MULTILINE) +re_argline = re.compile(r'^("?)(?P\w.*?)\1(\s*:.+?,?\s*)?\s+\((?P.*?)\)\s*(?P.*?)\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\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: ", 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() \ No newline at end of file diff --git a/contrib/devtools/generate_json_api_v1.py b/contrib/devtools/generate_json_api_v1.py new file mode 100755 index 000000000..014b4fdbe --- /dev/null +++ b/contrib/devtools/generate_json_api_v1.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python3 + +import re +import subprocess as sp +import sys +import json + +re_full = re.compile(r'(?P^.*?$)(?P.*?)(^Argument.*?$(?P.*?))?(^Result[^\n]*?:\s*$(?P.*?))?(^Exampl.*?$(?P.*))?', re.DOTALL | re.MULTILINE) +re_argline = re.compile(r'^("?)(?P.*?)\1\s+\((?P.*?)\)\s*(?P.*)$', 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: ", 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() diff --git a/contrib/devtools/generated/api_jrgen.json b/contrib/devtools/generated/api_jrgen.json new file mode 100644 index 000000000..d350a4edd --- /dev/null +++ b/contrib/devtools/generated/api_jrgen.json @@ -0,0 +1,5118 @@ +{ + "$schema": "https://rawgit.com/mzernetsch/jrgen/master/jrgen-spec.schema.json", + "jrgen": "1.1", + "jsonrpc": "1.0", + "info": { + "title": "lbrycrd RPC API", + "version": "LBRYcrd Core RPC client version v0.12.2.0-6fa9ee58-dirty", + "description": [] + }, + "definitions": {}, + "methods": { + "abandonclaim": { + "summary": "Create a transaction which spends a txout which assigned a value to a name, effectively abandoning that claim.", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction containing the unspent txout which should be spent." + }, + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address to send to." + }, + "amount": { + "type": "number", + "description": "The amount to send to the lbrycrd address. eg 0.1" + } + }, + "required": [ + "txid", + "lbrycrdaddress", + "amount" + ] + }, + "result": { + "type": "string", + "description": "The new transaction id." + } + }, + "abandonsupport": { + "summary": "Create a transaction which spends a txout which supported a name claim, effectively abandoning that support.", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction containing the unspent txout which should be spent." + }, + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address to send to." + }, + "amount": { + "type": "number", + "description": "The amount to send to the lbrycrd address. eg 0.1" + } + }, + "required": [ + "txid", + "lbrycrdaddress", + "amount" + ] + }, + "result": { + "type": "string", + "description": "The new transaction id." + } + }, + "claimname": { + "summary": "Create a transaction which issues a claim assigning a value to a name. The claim will be authoritative if the transaction amount is greater than the transaction amount of all other unspent transactions which issue a claim over the same name, and it will remain authoritative as long as it remains unspent and there are no other greater unspent transactions issuing a claim over the same name. The amount is a real and is rounded to the nearest 0.00000001", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name to be assigned the value." + }, + "value": { + "type": "string", + "description": "The value to assign to the name encoded in hexadecimal." + }, + "amount": { + "type": "number", + "description": "The amount in LBRYcrd to send. eg 0.1" + } + }, + "required": [ + "name", + "value", + "amount" + ] + }, + "result": { + "type": "string", + "description": "The transaction id." + } + }, + "getclaimbyid": { + "summary": "Get a claim by claim id", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "claimId": { + "type": "string", + "description": "the claimId of this claim" + } + }, + "required": [ + "claimId" + ] + }, + "result": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "the name of the claim" + }, + "value": { + "type": "string", + "description": "claim metadata" + }, + "claimId": { + "type": "string", + "description": "the claimId of this claim" + }, + "txid": { + "type": "string", + "description": "the hash of the transaction which has successfully claimed this name" + }, + "n": { + "type": "number", + "description": "vout value" + }, + "amount": { + "type": "number", + "description": "txout value" + }, + "effective amount": { + "type": "number", + "description": "txout amount plus amount from all supports associated with the claim" + }, + "height": { + "type": "number", + "description": "the height of the block in which this claim transaction is located" + }, + "valid at height": { + "type": "number", + "description": "the height at which the claim is valid" + }, + "supports": { + "type": "array", + "items": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "the txid of the support" + }, + "n": { + "type": "number", + "description": "the index of the support in the transaction's list of outputs" + }, + "height": { + "type": "number", + "description": "the height at which the support was included in the blockchain" + }, + "valid at height": { + "type": "number", + "description": "the height at which the support is valid" + }, + "amount": { + "type": "number", + "description": "the amount of the support" + } + } + } + } + } + } + }, + "getclaimsforname": { + "summary": "Return all claims and supports for a name", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "the name for which to get claims and supports" + } + }, + "required": [ + "name" + ] + }, + "result": { + "type": "object", + "properties": { + "nLastTakeoverheight": { + "type": "number", + "description": "the last height at which ownership of the name changed" + }, + "claims": { + "type": "array", + "items": { + "type": "object", + "properties": { + "claimId": { + "type": "string", + "description": "the claimId of this claim" + }, + "txid": { + "type": "string", + "description": "the txid of this claim" + }, + "n": { + "type": "number", + "description": "the index of the claim in the transaction's list of outputs" + }, + "nHeight": { + "type": "number", + "description": "the height at which the claim was included in the blockchain" + }, + "nValidAtHeight": { + "type": "number", + "description": "the height at which the claim became/becomes valid" + }, + "nAmount": { + "type": "number", + "description": "the amount of the claim" + }, + "nEffectiveAmount": { + "type": "number", + "description": "the total effective amount of the claim, taking into effect whether the claim or support has reached its nValidAtHeight" + }, + "supports": { + "type": "array", + "items": { + "type": "array", + "properties": { + "txid": { + "type": "string", + "description": "the txid of the support" + }, + "n": { + "type": "number", + "description": "the index of the support in the transaction's list of outputs" + }, + "nHeight": { + "type": "number", + "description": "the height at which the support was included in the blockchain" + }, + "nValidAtHeight": { + "type": "number", + "description": "the height at which the support became/becomes valid" + }, + "nAmount": { + "type": "number", + "description": "the amount of the support" + } + } + } + } + } + } + }, + "unmatched supports": { + "type": "array", + "items": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "the txid of the support" + }, + "n": { + "type": "number", + "description": "the index of the support in the transaction's list of outputs" + }, + "nHeight": { + "type": "number", + "description": "the height at which the support was included in the blockchain" + }, + "nValidAtHeight": { + "type": "number", + "description": "the height at which the support became/becomes valid" + }, + "nAmount": { + "type": "number", + "description": "the amount of the support" + } + } + } + } + } + } + }, + "getclaimsfortx": { + "summary": "Return any claims or supports found in a transaction", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "the txid of the transaction to check for unspent claims" + } + }, + "required": [ + "txid" + ] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "nOut": { + "type": "number", + "description": "the index of the claim or support in the transaction's list out outputs" + }, + "claim type": { + "type": "string", + "description": "'claim' or 'support'" + }, + "name": { + "type": "string", + "description": "the name claimed or supported" + }, + "value": { + "type": "string", + "description": "if a name claim, the value of the claim" + }, + "supported txid": { + "type": "string", + "description": "if a support, the txid of the supported claim" + }, + "supported nout": { + "type": "number", + "description": "if a support, the index of the supported claim in its transaction" + }, + "depth": { + "type": "number", + "description": "the depth of the transaction in the main chain" + }, + "in claim trie": { + "type": "boolean", + "description": "if a name claim, whether the claim is active, i.e. has made it into the trie" + }, + "is controlling": { + "type": "boolean", + "description": "if a name claim, whether the claim is the current controlling claim for the name" + }, + "in support map": { + "type": "boolean", + "description": "if a support, whether the support is active, i.e. has made it into the support map" + }, + "in queue": { + "type": "boolean", + "description": "whether the claim is in a queue waiting to be inserted into the trie or support map" + }, + "blocks to valid": { + "type": "number", + "description": "if in a queue, the number of blocks until it's inserted into the trie or support map" + } + } + } + } + }, + "getclaimsintrie": { + "summary": "Return all claims in the name trie.", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "minconf": { + "type": "number", + "description": "the number of required confirmations", + "default": 1 + } + }, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "the name claimed" + }, + "claims": { + "type": "array", + "items": { + "type": "object", + "properties": { + "claimId": { + "type": "string", + "description": "the claimId of the claim" + }, + "txid": { + "type": "string", + "description": "the txid of the claim" + }, + "n": { + "type": "number", + "description": "the vout value of the claim" + }, + "amount": { + "type": "number", + "description": "txout amount" + }, + "height": { + "type": "number", + "description": "the height of the block in which this transaction is located" + }, + "value": { + "type": "string", + "description": "the value of this claim" + } + } + } + } + } + } + } + }, + "getclaimtrie": { + "summary": "Return the entire name trie.", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "minconf": { + "type": "number", + "description": "the number of required confirmations", + "default": 1 + } + }, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "the name of the node" + }, + "hash": { + "type": "string", + "description": "the hash of the node" + }, + "txid": { + "type": "string", + "description": "(if value exists) the hash of the transaction which has successfully claimed this name" + }, + "n": { + "type": "number", + "description": "(if value exists) vout value" + }, + "value": { + "type": "number", + "description": "(if value exists) txout value" + }, + "height": { + "type": "number", + "description": "(if value exists) the height of the block in which this transaction is located" + } + } + } + }, + "getnameproof": { + "summary": "Return the cryptographic proof that a name maps to a value or doesn't.", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "the name to get a proof for" + }, + "blockhash": { + "type": "string", + "description": "the hash of the block which is the basis of the proof. If none is given, the latest block will be used." + } + }, + "required": [ + "name" + ] + }, + "result": { + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "type": "array", + "properties": { + "valueHash": { + "type": "string", + "description": "the hash of this node's value, if it has one. If this is the requested name this will not exist whether the node has a value or not" + } + } + } + }, + "txhash": { + "type": "string", + "description": "the txid of the claim which controls this name, if there is one." + }, + "nOut": { + "type": "number", + "description": "the nOut of the claim which controls this name, if there is one." + }, + "last takeover height": { + "type": "number", + "description": "the most recent height at which the value of a name changed other than through an update to the winning bid" + } + } + } + }, + "gettotalclaimednames": { + "summary": "Return the total number of names that have been successfully claimed, and therefore exist in the trie", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "number", + "description": "the total number of names in the trie" + } + }, + "gettotalclaims": { + "summary": "Return the total number of active claims in the trie", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "number", + "description": "the total number of active claims" + } + }, + "gettotalvalueofclaims": { + "summary": "Return the total value of the claims in the trie", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "controlling_only": { + "type": "boolean", + "description": "only include the value of controlling claims" + } + }, + "required": [ + "controlling_only" + ] + }, + "result": { + "type": "number", + "description": "the total value of the claims in the trie" + } + }, + "getvalueforname": { + "summary": "Return the value associated with a name, if one exists", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "the name to look up" + }, + "minconf": { + "type": "number", + "description": "the number of required confirmations", + "default": 1 + } + }, + "required": [ + "name" + ] + }, + "result": { + "type": "string", + "description": "the value of the name, if it exists \"claimId\" (string) the claimId for this name claim \"txid\" (string) the hash of the transaction which successfully claimed the name \"n\" (numeric) vout value \"amount\" (numeric) txout amount \"effective amount\" (numeric) txout amount plus amount from all supports associated with the claim \"height\" (numeric) the height of the block in which this transaction is located" + } + }, + "listnameclaims": { + "summary": "Return a list of all transactions claiming names.", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "includesupports": { + "type": "boolean", + "description": "Whether to also include claim supports. Default is true." + }, + "activeonly": { + "type": "boolean", + "description": "Whether to only include transactions which are still active, i.e. have not been spent. Default is false." + }, + "minconf": { + "type": "number", + "description": "Only include transactions confirmed at least this many time.", + "default": 1 + } + }, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name that is claimed." + }, + "claimtype": { + "type": "string", + "description": "CLAIM or SUPPORT." + }, + "claimId": { + "type": "string", + "description": "The claimId of the claim." + }, + "value": { + "type": "string", + "description": "The value assigned to the name, if claimtype is CLAIM." + }, + "account": { + "type": "string", + "description": "The account name associated with the transaction. It will be \"\" for the default account." + }, + "address": { + "type": "string", + "description": "The lbrycrd address of the transaction." + }, + "category": { + "type": "string", + "description": "Always name" + }, + "amount": { + "type": "number", + "description": "The amount in LBC." + }, + "vout": { + "type": "number", + "description": "The vout value" + }, + "fee": { + "type": "number", + "description": "The amount of the fee in LBC." + }, + "height": { + "type": "number", + "description": "The height of the block in which this transaction was included." + }, + "confirmations": { + "type": "number", + "description": "The number of confirmations for the transaction" + }, + "blockhash": { + "type": "string", + "description": "The block hash containing the transaction." + }, + "blockindex": { + "type": "number", + "description": "The block index containing the transaction." + }, + "txid": { + "type": "string", + "description": "The transaction id." + }, + "time": { + "type": "number", + "description": "The transaction time in seconds since epoch (midnight Jan 1 1970 GMT)." + }, + "timereceived": { + "type": "number", + "description": "The time received in seconds since epoch (midnight Jan 1 1970 GMT)." + }, + "comment": { + "type": "string", + "description": "If a comment is associated with the transaction." + } + } + } + } + }, + "supportclaim": { + "summary": "Increase the value of a claim. Whichever claim has the greatest value, including all support values, will be the authoritative claim, according to the rest of the rules. The name is the name which is claimed by the claim that will be supported, the txid is the txid of the claim that will be supported, nout is the transaction output which contains the claim to be supported, and amount is the amount which will be added to the value of the claim. If the claim is currently the authoritative claim, this support will go into effect immediately. Otherwise, it will go into effect after 100 blocks. The support will be in effect until it is spent, and will lose its effect when the claim is spent or expires. The amount is a real and is rounded to the nearest .00000001", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name claimed by the claim to support." + }, + "claimid": { + "type": "string", + "description": "The claimid of the claim to support. This can be obtained by TODO PUT IN PLACE THAT SHOWS THIS." + }, + "amount": { + "type": "number", + "description": "The amount in LBC to use to support the claim." + } + }, + "required": [ + "name", + "claimid", + "amount" + ] + }, + "result": { + "type": "string", + "description": "The transaction id of the support." + } + }, + "updateclaim": { + "summary": "Create a transaction which issues a claim assigning a value to a name, spending the previous txout which issued a claim over the same name and therefore superseding that claim. The claim will be authoritative if the transaction amount is greater than the transaction amount of all other unspent transactions which issue a claim over the same name, and it will remain authoritative as long as it remains unspent and there are no greater unspent transactions issuing a claim over the same name.", + "description": [], + "tags": [ + "Claimtrie" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction containing the unspent txout which should be spent." + }, + "value": { + "type": "string", + "description": "The value to assign to the name encoded in hexadecimal." + }, + "amount": { + "type": "number", + "description": "The amount in LBRYcrd to use to bid for the name. eg 0.1" + } + }, + "required": [ + "txid", + "value", + "amount" + ] + }, + "result": { + "type": "string", + "description": "The new transaction id." + } + }, + "getbestblockhash": { + "summary": "Returns the hash of the best (tip) block in the longest block chain. Result \"hex\" (string) the block hash hex encoded", + "description": [ + "", + "> lbrycrd-cli getbestblockhash ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getbestblockhash\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + } + }, + "getblock": { + "summary": "If verbose is false, returns a string that is serialized, hex-encoded data for block 'hash'. If verbose is true, returns an Object with information about block .", + "description": [ + "", + "> lbrycrd-cli getblock \"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblock\", \"params\": [\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "description": "The block hash" + }, + "verbose": { + "type": "boolean", + "description": "true for a json object, false for the hex encoded data", + "default": true + } + }, + "required": [ + "hash" + ] + }, + "result": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "description": "the block hash (same as provided)" + }, + "confirmations": { + "type": "number", + "description": "The number of confirmations, or -1 if the block is not on the main chain" + }, + "size": { + "type": "number", + "description": "The block size" + }, + "height": { + "type": "number", + "description": "The block height or index" + }, + "version": { + "type": "number", + "description": "The block version" + }, + "versionHex": { + "type": "string", + "description": "The block version formatted in hexadecimal" + }, + "merkleroot": { + "type": "string", + "description": "The merkle root" + }, + "nameclaimroot": { + "type": "string", + "description": "The hash of the root of the name claim trie" + }, + "tx": { + "type": "array", + "items": { + "type": "array", + "properties": { + "transactionid": { + "type": "string", + "description": "The transaction id" + } + } + } + }, + "time": { + "type": "number", + "description": "The block time in seconds since epoch (Jan 1 1970 GMT)" + }, + "mediantime": { + "type": "number", + "description": "The median block time in seconds since epoch (Jan 1 1970 GMT)" + }, + "nonce": { + "type": "number", + "description": "The nonce" + }, + "bits": { + "type": "string", + "description": "The bits" + }, + "difficulty": { + "type": "number", + "description": "The difficulty" + }, + "chainwork": { + "type": "string", + "description": "Expected number of hashes required to produce the chain up to this block (in hex)" + }, + "previousblockhash": { + "type": "string", + "description": "The hash of the previous block" + }, + "nextblockhash": { + "type": "string", + "description": "The hash of the next block" + } + } + } + }, + "getblockchaininfo": { + "summary": "Returns an object containing various state info regarding block chain processing.", + "description": [ + "", + "> lbrycrd-cli getblockchaininfo ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockchaininfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "chain": { + "type": "string", + "description": "current network name as defined in BIP70 (main, test, regtest)" + }, + "blocks": { + "type": "number", + "description": "the current number of blocks processed in the server" + }, + "headers": { + "type": "number", + "description": "the current number of headers we have validated" + }, + "bestblockhash": { + "type": "string", + "description": "the hash of the currently best block" + }, + "difficulty": { + "type": "number", + "description": "the current difficulty" + }, + "mediantime": { + "type": "number", + "description": "median time for the current best block" + }, + "verificationprogress": { + "type": "number", + "description": "estimate of verification progress [0..1]" + }, + "chainwork": { + "type": "string", + "description": "total amount of work in active chain, in hexadecimal" + }, + "pruned": { + "type": "boolean", + "description": "if the blocks are subject to pruning" + }, + "pruneheight": { + "type": "number", + "description": "heighest block available" + }, + "softforks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "name of softfork" + }, + "version": { + "type": "number", + "description": "block version" + }, + "enforce": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "true if threshold reached" + }, + "found": { + "type": "number", + "description": "number of blocks with the new version found" + }, + "required": { + "type": "number", + "description": "number of blocks required to trigger" + }, + "window": { + "type": "number", + "description": "maximum size of examined window of recent blocks" + } + } + } + } + } + }, + "bip9_softforks": { + "type": "object", + "properties": { + "xxxx": { + "type": "string", + "description": "name of the softfork" + }, + "bip9_softforks": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "one of \"defined\", \"started\", \"lockedin\", \"active\", \"failed\"" + }, + "bit": { + "type": "number", + "description": "the bit, 0-28, in the block version field used to signal this soft fork" + }, + "startTime": { + "type": "number", + "description": "the minimum median time past of a block at which the bit gains its meaning" + }, + "timeout": { + "type": "number", + "description": "the median time past of a block at which the deployment is considered failed if not yet locked in" + } + } + } + } + } + } + } + }, + "getblockcount": { + "summary": "Returns the number of blocks in the longest block chain.", + "description": [ + "", + "> lbrycrd-cli getblockcount ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockcount\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "number", + "description": "The current block count" + } + }, + "getblockhash": { + "summary": "Returns hash of block in best-block-chain at index provided.", + "description": [ + "", + "> lbrycrd-cli getblockhash 1000", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockhash\", \"params\": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": { + "index": { + "type": "number", + "description": "The block index" + } + }, + "required": [ + "index" + ] + }, + "result": { + "type": "string", + "description": "The block hash" + } + }, + "getblockheader": { + "summary": "If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader .", + "description": [ + "", + "> lbrycrd-cli getblockheader \"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockheader\", \"params\": [\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "description": "The block hash" + }, + "verbose": { + "type": "boolean", + "description": "true for a json object, false for the hex encoded data", + "default": true + } + }, + "required": [ + "hash" + ] + }, + "result": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "description": "the block hash (same as provided)" + }, + "confirmations": { + "type": "number", + "description": "The number of confirmations, or -1 if the block is not on the main chain" + }, + "height": { + "type": "number", + "description": "The block height or index" + }, + "version": { + "type": "number", + "description": "The block version" + }, + "versionHex": { + "type": "string", + "description": "The block version formatted in hexadecimal" + }, + "merkleroot": { + "type": "string", + "description": "The merkle root" + }, + "time": { + "type": "number", + "description": "The block time in seconds since epoch (Jan 1 1970 GMT)" + }, + "mediantime": { + "type": "number", + "description": "The median block time in seconds since epoch (Jan 1 1970 GMT)" + }, + "nonce": { + "type": "number", + "description": "The nonce" + }, + "bits": { + "type": "string", + "description": "The bits" + }, + "difficulty": { + "type": "number", + "description": "The difficulty" + }, + "previousblockhash": { + "type": "string", + "description": "The hash of the previous block" + }, + "nextblockhash": { + "type": "string", + "description": "The hash of the next block" + }, + "chainwork": { + "type": "string", + "description": "Expected number of hashes required to produce the current chain (in hex)" + } + } + } + }, + "getchaintips": { + "summary": "Return information about all known tips in the block tree, including the main chain as well as orphaned branches.", + "description": [ + "", + "> lbrycrd-cli getchaintips ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getchaintips\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "branchlen": { + "type": "number", + "description": "length of branch connecting the tip to the main chain" + }, + "status": { + "type": "string", + "description": "status of the chain (active, valid-fork, valid-headers, headers-only, invalid)" + } + } + } + } + }, + "getdifficulty": { + "summary": "Returns the proof-of-work difficulty as a multiple of the minimum difficulty.", + "description": [ + "", + "> lbrycrd-cli getdifficulty ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getdifficulty\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "number", + "description": "the proof-of-work difficulty as a multiple of the minimum difficulty." + } + }, + "getmempoolinfo": { + "summary": "Returns details on the active state of the TX memory pool.", + "description": [ + "", + "> lbrycrd-cli getmempoolinfo ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmempoolinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "size": { + "type": "number", + "description": "Current tx count" + }, + "bytes": { + "type": "number", + "description": "Sum of all tx sizes" + }, + "usage": { + "type": "number", + "description": "Total memory usage for the mempool" + }, + "maxmempool": { + "type": "number", + "description": "Maximum memory usage for the mempool" + }, + "mempoolminfee": { + "type": "number", + "description": "Minimum fee for tx to be accepted" + } + } + } + }, + "getrawmempool": { + "summary": "Returns all transaction ids in memory pool as a json array of string transaction ids.", + "description": [ + "", + "> lbrycrd-cli getrawmempool true", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getrawmempool\", \"params\": [true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": { + "verbose": { + "type": "boolean", + "description": "true for a json object, false for array of transaction ids", + "default": false + } + }, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "transactionid": { + "type": "string", + "description": "The transaction id" + } + } + } + } + }, + "gettxout": { + "summary": "Returns details about an unspent transaction output.", + "description": [ + "", + "", + "Get unspent transactions", + "> lbrycrd-cli listunspent ", + "", + "View the details", + "> lbrycrd-cli gettxout \"txid\" 1", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gettxout\", \"params\": [\"txid\", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction id" + }, + "n": { + "type": "number", + "description": "vout number" + }, + "includemempool": { + "type": "boolean", + "description": "Whether to include the mem pool" + } + }, + "required": [ + "txid", + "n" + ] + }, + "result": { + "type": "object", + "properties": { + "bestblock": { + "type": "string", + "description": "the block hash" + }, + "confirmations": { + "type": "number", + "description": "The number of confirmations" + }, + "value": { + "type": "number", + "description": "The transaction value in LBC" + }, + "scriptPubKey": { + "type": "object", + "properties": { + "asm": { + "type": "string", + "description": "" + }, + "hex": { + "type": "string", + "description": "" + }, + "reqSigs": { + "type": "number", + "description": "Number of required signatures" + }, + "type": { + "type": "string", + "description": "The type, eg pubkeyhash" + }, + "addresses": { + "type": "array", + "items": { + "type": "array", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "lbrycrd address" + } + } + } + } + } + }, + "version": { + "type": "number", + "description": "The version" + }, + "coinbase": { + "type": "boolean", + "description": "Coinbase or not" + } + } + } + }, + "gettxoutproof": { + "summary": "Returns a hex-encoded proof that \"txid\" was included in a block. NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included in manually (by blockhash). Return the raw transaction data.", + "description": [], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": { + "txids": { + "type": "string", + "description": "A json array of txids to filter [ \"txid\" (string) A transaction hash ,... ]" + }, + "block hash": { + "type": "string", + "description": "If specified, looks for txid in the block with this hash" + } + }, + "required": [ + "txids" + ] + }, + "result": { + "type": "string", + "description": "A string that is a serialized, hex-encoded data for the proof." + } + }, + "gettxoutsetinfo": { + "summary": "Returns statistics about the unspent transaction output set. Note this call may take some time.", + "description": [ + "", + "> lbrycrd-cli gettxoutsetinfo ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gettxoutsetinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "height": { + "type": "number", + "description": "The current block height (index)" + }, + "bestblock": { + "type": "string", + "description": "the best block hash hex" + }, + "transactions": { + "type": "number", + "description": "The number of transactions" + }, + "txouts": { + "type": "number", + "description": "The number of output transactions" + }, + "bytes_serialized": { + "type": "number", + "description": "The serialized size" + }, + "hash_serialized": { + "type": "string", + "description": "The serialized hash" + }, + "total_amount": { + "type": "number", + "description": "The total amount" + } + } + } + }, + "verifychain": { + "summary": "Verifies blockchain database.", + "description": [ + "", + "> lbrycrd-cli verifychain ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"verifychain\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": { + "checklevel": { + "type": "number", + "description": "How thorough the block verification is.", + "default": 3 + }, + "numblocks": { + "type": "number", + "description": "The number of blocks to check.", + "default": 288 + } + }, + "required": [] + }, + "result": { + "type": "boolean", + "description": "Verified or not" + } + }, + "verifytxoutproof": { + "summary": "Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain", + "description": [], + "tags": [ + "Blockchain" + ], + "params": { + "type": "object", + "properties": { + "proof": { + "type": "string", + "description": "The hex-encoded proof generated by gettxoutproof" + } + }, + "required": [ + "proof" + ] + } + }, + "getinfo": { + "summary": "Returns an object containing various state info.", + "description": [ + "", + "> lbrycrd-cli getinfo ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Control" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "version": { + "type": "number", + "description": "the server version" + }, + "protocolversion": { + "type": "number", + "description": "the protocol version" + }, + "walletversion": { + "type": "number", + "description": "the wallet version" + }, + "balance": { + "type": "number", + "description": "the total lbrycrd balance of the wallet" + }, + "blocks": { + "type": "number", + "description": "the current number of blocks processed in the server" + }, + "timeoffset": { + "type": "number", + "description": "the time offset" + }, + "connections": { + "type": "number", + "description": "the number of connections" + }, + "proxy": { + "type": "string", + "description": "the proxy used by the server" + }, + "difficulty": { + "type": "number", + "description": "the current difficulty" + }, + "testnet": { + "type": "boolean", + "description": "if the server is using testnet or not" + }, + "keypoololdest": { + "type": "number", + "description": "the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool" + }, + "keypoolsize": { + "type": "number", + "description": "how many new keys are pre-generated" + }, + "unlocked_until": { + "type": "number", + "description": "the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked" + }, + "paytxfee": { + "type": "number", + "description": "the transaction fee set in LBC/kB" + }, + "relayfee": { + "type": "number", + "description": "minimum relay fee for non-free transactions in LBC/kB" + }, + "errors": { + "type": "string", + "description": "any error messages" + } + } + } + }, + "help": { + "summary": "List all commands, or get help for a specified command.", + "description": [], + "tags": [ + "Control" + ], + "params": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "The command to get help on" + } + }, + "required": [] + }, + "result": { + "type": "string", + "description": "The help text" + } + }, + "stop": { + "summary": "Stop LBRYcrd server.", + "description": [], + "tags": [ + "Control" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + } + }, + "generate": { + "summary": "Mine up to numblocks blocks immediately (before the RPC call returns)", + "description": [ + "", + "", + "Generate 11 blocks", + "> lbrycrd-cli generate 11", + "" + ], + "tags": [ + "Generating" + ], + "params": { + "type": "object", + "properties": { + "numblocks": { + "type": "number", + "description": "How many blocks are generated immediately." + }, + "maxtries": { + "type": "number", + "description": "How many iterations to try (default = 1000000). Result [ blockhashes ] (array) hashes of blocks generated" + } + }, + "required": [ + "numblocks" + ] + } + }, + "generatetoaddress": { + "summary": "Mine blocks immediately to a specified address (before the RPC call returns)", + "description": [ + "", + "", + "Generate 11 blocks to myaddress", + "> lbrycrd-cli generatetoaddress 11 \"myaddress\"", + "" + ], + "tags": [ + "Generating" + ], + "params": { + "type": "object", + "properties": { + "numblocks": { + "type": "number", + "description": "How many blocks are generated immediately." + }, + "address": { + "type": "string", + "description": "The address to send the newly generated bitcoin to." + }, + "maxtries": { + "type": "number", + "description": "How many iterations to try (default = 1000000). Result [ blockhashes ] (array) hashes of blocks generated" + } + }, + "required": [ + "numblocks", + "address" + ] + } + }, + "getblocktemplate": { + "summary": "If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'. It returns data needed to construct a block to work on. See https://en.bitcoin.it/wiki/BIP_0022 for full specification.", + "description": [ + "", + "> lbrycrd-cli getblocktemplate ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblocktemplate\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Mining" + ], + "params": { + "type": "object", + "properties": { + "jsonrequestobject": { + "type": "string", + "description": "A json object in the following spec { \"mode\":\"template\" (string, optional) This must be set to \"template\" or omitted \"capabilities\":[ (array, optional) A list of strings \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid' ,... ] }" + } + }, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "version": { + "type": "number", + "description": "The block version" + }, + "previousblockhash": { + "type": "string", + "description": "The hash of current highest block" + }, + "transactions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "data": { + "type": "string", + "description": "transaction data encoded in hexadecimal (byte-for-byte)" + }, + "hash": { + "type": "string", + "description": "hash/id encoded in little-endian hexadecimal" + }, + "depends": { + "type": "array", + "items": { + "type": "array", + "properties": { + "n": { + "type": "number", + "description": "transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is" + } + } + } + }, + "fee": { + "type": "number", + "description": "difference in value between transaction inputs and outputs (in Satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one" + }, + "sigops": { + "type": "number", + "description": "total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any" + }, + "required": { + "type": "boolean", + "description": "if provided and true, this transaction must be in the final block" + } + } + } + }, + "coinbaseaux": { + "type": "object", + "properties": { + "flags": { + "type": "string", + "description": "" + } + } + }, + "coinbasevalue": { + "type": "number", + "description": "maximum allowable input to coinbase transaction, including the generation award and transaction fees (in Satoshis)" + }, + "target": { + "type": "string", + "description": "The hash target" + }, + "mintime": { + "type": "number", + "description": "The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)" + }, + "mutable": { + "type": "array", + "items": { + "type": "array", + "properties": { + "value": { + "type": "string", + "description": "A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'" + } + } + } + }, + "noncerange": { + "type": "string", + "description": "A range of valid nonces" + }, + "sigoplimit": { + "type": "number", + "description": "limit of sigops in blocks" + }, + "sizelimit": { + "type": "number", + "description": "limit of block size" + }, + "curtime": { + "type": "number", + "description": "current timestamp in seconds since epoch (Jan 1 1970 GMT)" + }, + "bits": { + "type": "string", + "description": "compressed target of next block" + }, + "height": { + "type": "number", + "description": "The height of the next block" + } + } + } + }, + "getgenerate": { + "summary": "Return if the server is set to generate coins or not. The default is false. It is set with the command line argument -gen (or lbrycrd.conf setting gen) It can also be set with the setgenerate call. Result true|false (boolean) If the server is set to generate coins or not", + "description": [ + "", + "> lbrycrd-cli getgenerate ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getgenerate\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Mining" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + } + }, + "gethashespersec": { + "summary": "Returns a recent hashes per second performance measurement while generating. See the getgenerate and setgenerate calls to turn generation on and off.", + "description": [ + "", + "> lbrycrd-cli gethashespersec ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gethashespersec\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Mining" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "number", + "description": "The recent hashes per second when generation is on (will return 0 if generation is off)" + } + }, + "getmininginfo": { + "summary": "Returns a json object containing mining-related information.", + "description": [ + "", + "> lbrycrd-cli getmininginfo ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmininginfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Mining" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "blocks": { + "type": "number", + "description": "The current block" + }, + "currentblocksize": { + "type": "number", + "description": "The last block size" + }, + "currentblocktx": { + "type": "number", + "description": "The last block transaction" + }, + "difficulty": { + "type": "number", + "description": "The current difficulty" + }, + "errors": { + "type": "string", + "description": "Current errors" + }, + "generate": { + "type": "boolean", + "description": "If the generation is on or off (see getgenerate or setgenerate calls)" + }, + "genproclimit": { + "type": "number", + "description": "The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls)" + }, + "hashespersec": { + "type": "number", + "description": "The hashes per second of the generation, or 0 if no generation." + }, + "pooledtx": { + "type": "number", + "description": "The size of the mem pool" + }, + "testnet": { + "type": "boolean", + "description": "If using testnet or not" + }, + "chain": { + "type": "string", + "description": "current network name as defined in BIP70 (main, test, regtest)" + } + } + } + }, + "getnetworkhashps": { + "summary": "Returns the estimated network hashes per second based on the last n blocks. Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change. Pass in [height] to estimate the network speed at the time when a certain block was found.", + "description": [ + "", + "> lbrycrd-cli getnetworkhashps ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnetworkhashps\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Mining" + ], + "params": { + "type": "object", + "properties": { + "blocks": { + "type": "number", + "description": "The number of blocks, or -1 for blocks since last difficulty change.", + "default": 120 + }, + "height": { + "type": "number", + "description": "To estimate at the time of the given height.", + "default": -1 + } + }, + "required": [] + }, + "result": { + "type": "number", + "description": "Hashes per second estimated" + } + }, + "prioritisetransaction": { + "summary": "Accepts the transaction into mined blocks at a higher (or lower) priority", + "description": [ + "", + "> lbrycrd-cli prioritisetransaction \"txid\" 0.0 10000", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"prioritisetransaction\", \"params\": [\"txid\", 0.0, 10000] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Mining" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction id." + }, + "priority delta": { + "type": "number", + "description": "The priority to add or subtract. The transaction selection algorithm considers the tx as it would have a higher priority. (priority of a transaction is calculated: coinage * value_in_satoshis / txsize)" + }, + "fee delta": { + "type": "number", + "description": "The fee value (in satoshis) to add (or subtract, if negative). The fee is not actually paid, only the algorithm for selecting transactions into a block considers the transaction as it would have paid a higher (or lower) fee. Result true (boolean) Returns true" + } + }, + "required": [ + "txid", + "priority delta", + "fee delta" + ] + } + }, + "setgenerate": { + "summary": "Set 'generate' true or false to turn generation on or off. Generation is limited to 'genproclimit' processors, -1 is unlimited. See the getgenerate call for the current setting.", + "description": [ + "", + "", + "Set the generation on with a limit of one processor", + "> lbrycrd-cli setgenerate true 1", + "", + "Check the setting", + "> lbrycrd-cli getgenerate ", + "", + "Turn off generation", + "> lbrycrd-cli setgenerate false", + "", + "Using json rpc", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"setgenerate\", \"params\": [true, 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Mining" + ], + "params": { + "type": "object", + "properties": { + "generate": { + "type": "boolean", + "description": "Set to true to turn on generation, off to turn off." + }, + "genproclimit": { + "type": "number", + "description": "Set the processor limit for when generation is on. Can be -1 for unlimited." + } + }, + "required": [ + "generate" + ] + } + }, + "submitblock": { + "summary": "Attempts to submit new block to network. The 'jsonparametersobject' parameter is currently ignored. See https://en.bitcoin.it/wiki/BIP_0022 for full specification.", + "description": [ + "", + "> lbrycrd-cli submitblock \"mydata\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"submitblock\", \"params\": [\"mydata\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Mining" + ], + "params": { + "type": "object", + "properties": { + "hexdata": { + "type": "string", + "description": "the hex-encoded block data to submit" + }, + "jsonparametersobject": { + "type": "string", + "description": "object of optional parameters { \"workid\" : \"id\" (string, optional) if the server provided a workid, it MUST be included with submissions }" + } + }, + "required": [ + "hexdata" + ] + } + }, + "addnode": { + "summary": "Attempts add or remove a node from the addnode list. Or try a connection to a node once.", + "description": [ + "", + "> lbrycrd-cli addnode \"192.168.0.6:8333\" \"onetry\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"addnode\", \"params\": [\"192.168.0.6:8333\", \"onetry\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": { + "node": { + "type": "string", + "description": "The node (see getpeerinfo for nodes)" + }, + "command": { + "type": "string", + "description": "'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once" + } + }, + "required": [ + "node", + "command" + ] + } + }, + "clearbanned": { + "summary": "Clear all banned IPs.", + "description": [ + "", + "> lbrycrd-cli clearbanned ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"clearbanned\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + } + }, + "disconnectnode": { + "summary": "Immediately disconnects from the specified node.", + "description": [ + "", + "> lbrycrd-cli disconnectnode \"192.168.0.6:8333\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"disconnectnode\", \"params\": [\"192.168.0.6:8333\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": { + "node": { + "type": "string", + "description": "The node (see getpeerinfo for nodes)" + } + }, + "required": [ + "node" + ] + } + }, + "getaddednodeinfo": { + "summary": "Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here) If dns is false, only a list of added nodes will be provided, otherwise connected information will also be available.", + "description": [ + "", + "> lbrycrd-cli getaddednodeinfo true", + "> lbrycrd-cli getaddednodeinfo true \"192.168.0.201\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaddednodeinfo\", \"params\": [true, \"192.168.0.201\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": { + "dns": { + "type": "boolean", + "description": "If false, only a list of added nodes will be provided, otherwise connected information will also be available." + }, + "node": { + "type": "string", + "description": "If provided, return information about this specific node, otherwise all nodes are returned." + } + }, + "required": [ + "dns" + ] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "addednode": { + "type": "string", + "description": "The node ip address" + }, + "connected": { + "type": "boolean", + "description": "If connected" + }, + "addresses": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "The lbrycrd server host and port" + }, + "connected": { + "type": "string", + "description": "connection, inbound or outbound" + } + } + } + } + } + } + } + }, + "getconnectioncount": { + "summary": "Returns the number of connections to other nodes.", + "description": [ + "", + "> lbrycrd-cli getconnectioncount ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getconnectioncount\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "number", + "description": "The connection count" + } + }, + "getnettotals": { + "summary": "Returns information about network traffic, including bytes in, bytes out, and current time.", + "description": [ + "", + "> lbrycrd-cli getnettotals ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnettotals\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "totalbytesrecv": { + "type": "number", + "description": "Total bytes received" + }, + "totalbytessent": { + "type": "number", + "description": "Total bytes sent" + }, + "timemillis": { + "type": "number", + "description": "Total cpu time" + }, + "uploadtarget": { + "type": "object", + "properties": { + "timeframe": { + "type": "number", + "description": "Length of the measuring timeframe in seconds" + }, + "target": { + "type": "number", + "description": "Target in bytes" + }, + "target_reached": { + "type": "boolean", + "description": "True if target is reached" + }, + "serve_historical_blocks": { + "type": "boolean", + "description": "True if serving historical blocks" + }, + "bytes_left_in_cycle": { + "type": "number", + "description": "Bytes left in current time cycle" + }, + "time_left_in_cycle": { + "type": "number", + "description": "Seconds left in current time cycle" + } + } + } + } + } + }, + "getnetworkinfo": { + "summary": "Returns an object containing various state info regarding P2P networking.", + "description": [ + "", + "> lbrycrd-cli getnetworkinfo ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnetworkinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "version": { + "type": "number", + "description": "the server version" + }, + "subversion": { + "type": "string", + "description": "the server subversion string" + }, + "protocolversion": { + "type": "number", + "description": "the protocol version" + }, + "localservices": { + "type": "string", + "description": "the services we offer to the network" + }, + "timeoffset": { + "type": "number", + "description": "the time offset" + }, + "connections": { + "type": "number", + "description": "the number of connections" + }, + "networks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "network (ipv4, ipv6 or onion)" + }, + "limited": { + "type": "boolean", + "description": "is the network limited using -onlynet?" + }, + "reachable": { + "type": "boolean", + "description": "is the network reachable?" + }, + "proxy": { + "type": "string", + "description": "the proxy that is used for this network, or empty if none" + } + } + } + }, + "relayfee": { + "type": "number", + "description": "minimum relay fee for non-free transactions in LBC/kB" + }, + "localaddresses": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "network address" + }, + "port": { + "type": "number", + "description": "network port" + }, + "score": { + "type": "number", + "description": "relative score" + } + } + } + }, + "warnings": { + "type": "string", + "description": "any network warnings (such as alert messages)" + } + } + } + }, + "getpeerinfo": { + "summary": "Returns data about each connected network node as a json array of objects.", + "description": [ + "", + "> lbrycrd-cli getpeerinfo ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getpeerinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "Peer index" + }, + "addr": { + "type": "string", + "description": "The ip address and port of the peer" + }, + "addrlocal": { + "type": "string", + "description": "local address" + }, + "services": { + "type": "string", + "description": "The services offered" + }, + "relaytxes": { + "type": "boolean", + "description": "Whether peer has asked us to relay transactions to it" + }, + "lastsend": { + "type": "number", + "description": "The time in seconds since epoch (Jan 1 1970 GMT) of the last send" + }, + "lastrecv": { + "type": "number", + "description": "The time in seconds since epoch (Jan 1 1970 GMT) of the last receive" + }, + "bytessent": { + "type": "number", + "description": "The total bytes sent" + }, + "bytesrecv": { + "type": "number", + "description": "The total bytes received" + }, + "conntime": { + "type": "number", + "description": "The connection time in seconds since epoch (Jan 1 1970 GMT)" + }, + "timeoffset": { + "type": "number", + "description": "The time offset in seconds" + }, + "pingtime": { + "type": "number", + "description": "ping time (if available)" + }, + "minping": { + "type": "number", + "description": "minimum observed ping time (if any at all)" + }, + "pingwait": { + "type": "number", + "description": "ping wait (if non-zero)" + }, + "version": { + "type": "number", + "description": "The peer version, such as 7001" + }, + "subver": { + "type": "string", + "description": "The string version" + }, + "inbound": { + "type": "boolean", + "description": "Inbound (true) or Outbound (false)" + }, + "startingheight": { + "type": "number", + "description": "The starting height (block) of the peer" + }, + "banscore": { + "type": "number", + "description": "The ban score" + }, + "synced_headers": { + "type": "number", + "description": "The last header we have in common with this peer" + }, + "synced_blocks": { + "type": "number", + "description": "The last block we have in common with this peer" + }, + "inflight": { + "type": "array", + "items": { + "type": "object", + "properties": { + "n,": { + "type": "number", + "description": "The heights of blocks we're currently asking from this peer" + } + } + } + }, + "bytessent_per_msg": { + "type": "object", + "properties": { + "addr": { + "type": "number", + "description": "The total bytes sent aggregated by message type" + } + } + }, + "bytesrecv_per_msg": { + "type": "object", + "properties": { + "addr": { + "type": "number", + "description": "The total bytes received aggregated by message type" + } + } + } + } + } + } + }, + "listbanned": { + "summary": "List all banned IPs/Subnets.", + "description": [ + "", + "> lbrycrd-cli listbanned ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listbanned\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + } + }, + "ping": { + "summary": "Requests that a ping be sent to all other nodes, to measure ping time. Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.", + "description": [ + "", + "> lbrycrd-cli ping ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"ping\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + } + }, + "setban": { + "summary": "Attempts add or remove a IP/Subnet from the banned list.", + "description": [ + "", + "> lbrycrd-cli setban \"192.168.0.6\" \"add\" 86400", + "> lbrycrd-cli setban \"192.168.0.0/24\" \"add\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"setban\", \"params\": [\"192.168.0.6\", \"add\" 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Network" + ], + "params": { + "type": "object", + "properties": { + "ip(/netmask)": { + "type": "string", + "description": "The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)" + }, + "command": { + "type": "string", + "description": "'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list" + }, + "bantime": { + "type": "number", + "description": "time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)" + }, + "absolute": { + "type": "boolean", + "description": "If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)" + } + }, + "required": [ + "ip(/netmask)", + "command" + ] + } + }, + "createrawtransaction": { + "summary": "Create a transaction spending the given inputs and creating new outputs. Outputs can be addresses or data. Returns hex-encoded raw transaction. Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.", + "description": [ + "", + "> lbrycrd-cli createrawtransaction \"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"address\\\":0.01}\"", + "> lbrycrd-cli createrawtransaction \"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"data\\\":\\\"00010203\\\"}\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createrawtransaction\", \"params\": [\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"address\\\":0.01}\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createrawtransaction\", \"params\": [\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"data\\\":\\\"00010203\\\"}\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Rawtransactions" + ], + "params": { + "type": "object", + "properties": { + "transactions": { + "type": "string", + "description": "A json array of json objects [ { \"txid\":\"id\", (string, required) The transaction id \"vout\":n (numeric, required) The output number } ,... ]" + }, + "outputs": { + "type": "string", + "description": "a json object with outputs { \"address\": x.xxx (numeric or string, required) The key is the lbrycrd address, the numeric value (can be string) is the LBC amount \"data\": \"hex\", (string, required) The key is \"data\", the value is hex encoded data ... }" + }, + "locktime": { + "type": "number", + "description": "Raw locktime. Non-0 value also locktime-activates inputs", + "default": 0 + } + }, + "required": [ + "transactions", + "outputs" + ] + }, + "result": { + "type": "string", + "description": "hex string of the transaction" + } + }, + "decoderawtransaction": { + "summary": "Return a JSON object representing the serialized, hex-encoded transaction.", + "description": [ + "", + "> lbrycrd-cli decoderawtransaction \"hexstring\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"decoderawtransaction\", \"params\": [\"hexstring\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Rawtransactions" + ], + "params": { + "type": "object", + "properties": { + "hex": { + "type": "string", + "description": "The transaction hex string" + } + }, + "required": [ + "hex" + ] + }, + "result": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction id" + }, + "size": { + "type": "number", + "description": "The transaction size" + }, + "version": { + "type": "number", + "description": "The version" + }, + "locktime": { + "type": "number", + "description": "The lock time" + }, + "vin": { + "type": "array", + "items": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction id" + }, + "vout": { + "type": "number", + "description": "The output number" + }, + "scriptSig": { + "type": "object", + "properties": { + "asm": { + "type": "string", + "description": "asm" + }, + "hex": { + "type": "string", + "description": "hex" + } + } + }, + "sequence": { + "type": "number", + "description": "The script sequence number" + } + } + } + }, + "vout": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "The value in LBC" + }, + "n": { + "type": "number", + "description": "index" + }, + "scriptPubKey": { + "type": "object", + "properties": { + "asm": { + "type": "string", + "description": "the asm" + }, + "hex": { + "type": "string", + "description": "the hex" + }, + "reqSigs": { + "type": "number", + "description": "The required sigs" + }, + "type": { + "type": "string", + "description": "The type, eg 'pubkeyhash'" + }, + "addresses": { + "type": "array", + "items": { + "type": "array", + "properties": { + "12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc": { + "type": "string", + "description": "lbrycrd address" + } + } + } + } + } + } + } + } + } + } + } + }, + "decodescript": { + "summary": "Decode a hex-encoded script.", + "description": [ + "", + "> lbrycrd-cli decodescript \"hexstring\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"decodescript\", \"params\": [\"hexstring\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Rawtransactions" + ], + "params": { + "type": "object", + "properties": { + "hex": { + "type": "string", + "description": "the hex encoded script" + } + }, + "required": [ + "hex" + ] + }, + "result": { + "type": "object", + "properties": { + "asm": { + "type": "string", + "description": "Script public key" + }, + "hex": { + "type": "string", + "description": "hex encoded public key" + }, + "type": { + "type": "string", + "description": "The output type" + }, + "reqSigs": { + "type": "number", + "description": "The required signatures" + }, + "addresses": { + "type": "array", + "items": { + "type": "array", + "properties": { + "address": { + "type": "string", + "description": "lbrycrd address" + } + } + } + }, + "p2sh\",\"address": { + "type": "string", + "description": "script address" + } + } + } + }, + "fundrawtransaction": { + "summary": "Add inputs to a transaction until it has enough in value to meet its out value. This will not modify existing inputs, and will add one change output to the outputs. Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransaction for that. Note that all existing inputs must have their previous output transaction be in the wallet. Note that all inputs selected must be of standard form and P2SH scripts must be in the wallet using importaddress or addmultisigaddress (to calculate fees). Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only", + "description": [ + "", + "", + "Create a transaction with no inputs", + "> lbrycrd-cli createrawtransaction \"[]\" \"{\\\"myaddress\\\":0.01}\"", + "", + "Add sufficient unsigned inputs to meet the output value", + "> lbrycrd-cli fundrawtransaction \"rawtransactionhex\"", + "", + "Sign the transaction", + "> lbrycrd-cli signrawtransaction \"fundedtransactionhex\"", + "", + "Send the transaction", + "> lbrycrd-cli sendrawtransaction \"signedtransactionhex\"", + "" + ], + "tags": [ + "Rawtransactions" + ], + "params": { + "type": "object", + "properties": { + "hexstring": { + "type": "string", + "description": "The hex string of the raw transaction" + }, + "options": { + "type": "object", + "properties": { + "changeAddress": { + "type": "string", + "description": "The bitcoin address to receive the change" + }, + "changePosition": { + "type": "number", + "description": "The index of the change output" + }, + "includeWatching": { + "type": "boolean", + "description": "Also select inputs which are watch only" + }, + "lockUnspents": { + "type": "boolean", + "description": "Lock selected unspent outputs" + } + } + } + }, + "required": [ + "hexstring" + ] + }, + "result": { + "type": "object", + "properties": { + "hex": { + "type": "string", + "description": "The resulting raw transaction (hex-encoded string)" + }, + "fee": { + "type": "number", + "description": "Fee the resulting transaction pays" + }, + "changepos": { + "type": "number", + "description": "The position of the added change output, or -1" + } + } + } + }, + "getrawtransaction": { + "summary": "NOTE: By default this function only works sometimes. This is when the tx is in the mempool or there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option. Return the raw transaction data. If verbose=0, returns a string that is serialized, hex-encoded data for 'txid'. If verbose is non-zero, returns an Object with information about 'txid'.", + "description": [ + "", + "> lbrycrd-cli getrawtransaction \"mytxid\"", + "> lbrycrd-cli getrawtransaction \"mytxid\" 1", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getrawtransaction\", \"params\": [\"mytxid\", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Rawtransactions" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction id" + }, + "verbose": { + "type": "number", + "description": "If 0, return a string, other return a json object", + "default": 0 + } + }, + "required": [ + "txid" + ] + }, + "result": { + "type": "string", + "description": "The serialized, hex-encoded data for 'txid' Result (if verbose > 0): { \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid' \"txid\" : \"id\", (string) The transaction id (same as provided) \"size\" : n, (numeric) The transaction size \"version\" : n, (numeric) The version \"locktime\" : ttt, (numeric) The lock time \"vin\" : [ (array of json objects) { \"txid\": \"id\", (string) The transaction id \"vout\": n, (numeric) \"scriptSig\": { (json object) The script \"asm\": \"asm\", (string) asm \"hex\": \"hex\" (string) hex }, \"sequence\": n (numeric) The script sequence number } ,... ], \"vout\" : [ (array of json objects) { \"value\" : x.xxx, (numeric) The value in LBC \"n\" : n, (numeric) index \"scriptPubKey\" : { (json object) \"asm\" : \"asm\", (string) the asm \"hex\" : \"hex\", (string) the hex \"reqSigs\" : n, (numeric) The required sigs \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash' \"addresses\" : [ (json array of string) \"lbrycrdaddress\" (string) lbrycrd address ,... ] } } ,... ], \"blockhash\" : \"hash\", (string) the block hash \"confirmations\" : n, (numeric) The confirmations \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT) \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT) }" + } + }, + "sendrawtransaction": { + "summary": "Submits raw transaction (serialized, hex-encoded) to local node and network. Also see createrawtransaction and signrawtransaction calls.", + "description": [ + "", + "", + "Create a transaction", + "> lbrycrd-cli createrawtransaction \"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"", + "Sign the transaction, and get back the hex", + "> lbrycrd-cli signrawtransaction \"myhex\"", + "", + "Send the transaction (signed hex)", + "> lbrycrd-cli sendrawtransaction \"signedhex\"", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendrawtransaction\", \"params\": [\"signedhex\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Rawtransactions" + ], + "params": { + "type": "object", + "properties": { + "hexstring": { + "type": "string", + "description": "The hex string of the raw transaction)" + }, + "allowhighfees": { + "type": "boolean", + "description": "Allow high fees", + "default": false + } + }, + "required": [ + "hexstring" + ] + }, + "result": { + "type": "string", + "description": "The transaction hash in hex" + } + }, + "signrawtransaction": { + "summary": "Sign inputs for raw transaction (serialized, hex-encoded). The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain. The third optional argument (may be null) is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction.", + "description": [ + "", + "> lbrycrd-cli signrawtransaction \"myhex\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"signrawtransaction\", \"params\": [\"myhex\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Rawtransactions" + ], + "params": { + "type": "object", + "properties": { + "hexstring": { + "type": "string", + "description": "The transaction hex string" + }, + "prevtxs": { + "type": "string", + "description": "An json array of previous dependent transaction outputs [ (json array of json objects, or 'null' if none provided) { \"txid\":\"id\", (string, required) The transaction id \"vout\":n, (numeric, required) The output number \"scriptPubKey\": \"hex\", (string, required) script key \"redeemScript\": \"hex\" (string, required for P2SH) redeem script } ,... ]" + }, + "privatekeys": { + "type": "string", + "description": "A json array of base58-encoded private keys for signing [ (json array of strings, or 'null' if none provided) \"privatekey\" (string) private key in base58-encoding ,... ]" + }, + "sighashtype": { + "type": "string", + "description": "The signature hash type. Must be one of \"ALL\" \"NONE\" \"SINGLE\" \"ALL|ANYONECANPAY\" \"NONE|ANYONECANPAY\" \"SINGLE|ANYONECANPAY\"", + "default": "ALL" + } + }, + "required": [ + "hexstring" + ] + }, + "result": { + "type": "object", + "properties": { + "hex": { + "type": "string", + "description": "The hex-encoded raw transaction with signature(s)" + }, + "complete": { + "type": "boolean", + "description": "If the transaction has a complete set of signatures" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The hash of the referenced, previous transaction" + }, + "vout": { + "type": "number", + "description": "The index of the output to spent and used as input" + }, + "scriptSig": { + "type": "string", + "description": "The hex-encoded signature script" + }, + "sequence": { + "type": "number", + "description": "Script sequence number" + }, + "error": { + "type": "string", + "description": "Verification or signing error related to the input" + } + } + } + } + } + } + }, + "createmultisig": { + "summary": "Creates a multi-signature address with n signature of m keys required. It returns a json object with the address and redeemScript.", + "description": [ + "", + "", + "Create a multisig address from 2 addresses", + "> lbrycrd-cli createmultisig 2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createmultisig\", \"params\": [2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Util" + ], + "params": { + "type": "object", + "properties": { + "nrequired": { + "type": "number", + "description": "The number of required signatures out of the n keys or addresses." + }, + "keys": { + "type": "string", + "description": "A json array of keys which are lbrycrd addresses or hex-encoded public keys [ \"key\" (string) lbrycrd address or hex-encoded public key ,... ]" + } + }, + "required": [ + "nrequired", + "keys" + ] + }, + "result": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "The value of the new multisig address." + }, + "redeemScript": { + "type": "string", + "description": "The string value of the hex-encoded redemption script." + } + } + } + }, + "estimatefee": { + "summary": "Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks.", + "description": [ + "", + "> lbrycrd-cli estimatefee 6", + "" + ], + "tags": [ + "Util" + ], + "params": { + "type": "object", + "properties": { + "nblocks": { + "type": "number", + "description": "" + } + }, + "required": [ + "nblocks" + ] + }, + "result": { + "type": "number", + "description": "estimated fee-per-kilobyte A negative value is returned if not enough transactions and blocks have been observed to make an estimate." + } + }, + "estimatepriority": { + "summary": "Estimates the approximate priority a zero-fee transaction needs to begin confirmation within nblocks blocks.", + "description": [ + "", + "> lbrycrd-cli estimatepriority 6", + "" + ], + "tags": [ + "Util" + ], + "params": { + "type": "object", + "properties": { + "nblocks": { + "type": "number", + "description": "" + } + }, + "required": [ + "nblocks" + ] + }, + "result": { + "type": "number", + "description": "estimated priority A negative value is returned if not enough transactions and blocks have been observed to make an estimate." + } + }, + "estimatesmartfee": { + "summary": "WARNING: This interface is unstable and may disappear or change! Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks if possible and return the number of blocks for which the estimate is valid.", + "description": [ + "", + "> lbrycrd-cli estimatesmartfee 6", + "" + ], + "tags": [ + "Util" + ], + "params": { + "type": "object", + "properties": { + "nblocks": { + "type": "number", + "description": "" + } + }, + "required": [ + "nblocks" + ] + }, + "result": { + "type": "object", + "properties": { + "feerate": { + "type": "number", + "description": "estimate fee-per-kilobyte (in BTC)" + }, + "blocks": { + "type": "number", + "description": "block number where estimate was found" + } + } + } + }, + "estimatesmartpriority": { + "summary": "WARNING: This interface is unstable and may disappear or change! Estimates the approximate priority a zero-fee transaction needs to begin confirmation within nblocks blocks if possible and return the number of blocks for which the estimate is valid.", + "description": [ + "", + "> lbrycrd-cli estimatesmartpriority 6", + "" + ], + "tags": [ + "Util" + ], + "params": { + "type": "object", + "properties": { + "nblocks": { + "type": "number", + "description": "" + } + }, + "required": [ + "nblocks" + ] + }, + "result": { + "type": "object", + "properties": { + "priority": { + "type": "number", + "description": "estimated priority" + }, + "blocks": { + "type": "number", + "description": "block number where estimate was found" + } + } + } + }, + "validateaddress": { + "summary": "Return information about the given lbrycrd address.", + "description": [ + "", + "> lbrycrd-cli validateaddress \"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"validateaddress\", \"params\": [\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Util" + ], + "params": { + "type": "object", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address to validate" + } + }, + "required": [ + "lbrycrdaddress" + ] + }, + "result": { + "type": "object", + "properties": { + "isvalid": { + "type": "boolean", + "description": "If the address is valid or not. If not, this is the only property returned." + }, + "address": { + "type": "string", + "description": "The lbrycrd address validated" + }, + "scriptPubKey": { + "type": "string", + "description": "The hex encoded scriptPubKey generated by the address" + }, + "ismine": { + "type": "boolean", + "description": "If the address is yours or not" + }, + "iswatchonly": { + "type": "boolean", + "description": "If the address is watchonly" + }, + "isscript": { + "type": "boolean", + "description": "If the key is a script" + }, + "pubkey": { + "type": "string", + "description": "The hex value of the raw public key" + }, + "iscompressed": { + "type": "boolean", + "description": "If the address is compressed" + }, + "account": { + "type": "string", + "description": "DEPRECATED. The account associated with the address, \"\" is the default account" + } + } + } + }, + "verifymessage": { + "summary": "Verify a signed message", + "description": [ + "", + "", + "Unlock the wallet for 30 seconds", + "> lbrycrd-cli walletpassphrase \"mypassphrase\" 30", + "", + "Create the signature", + "> lbrycrd-cli signmessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"my message\"", + "", + "Verify the signature", + "> lbrycrd-cli verifymessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"signature\" \"my message\"", + "", + "As json rpc", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"verifymessage\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"signature\", \"my message\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Util" + ], + "params": { + "type": "object", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address to use for the signature." + }, + "signature": { + "type": "string", + "description": "The signature provided by the signer in base 64 encoding (see signmessage)." + }, + "message": { + "type": "string", + "description": "The message that was signed." + } + }, + "required": [ + "lbrycrdaddress", + "signature", + "message" + ] + }, + "result": { + "type": "boolean", + "description": "If the signature is verified or not." + } + }, + "abandontransaction": { + "summary": "Mark in-wallet transaction as abandoned This will mark this transaction and all its in-wallet descendants as abandoned which will allow for their inputs to be respent. It can be used to replace \"stuck\" or evicted transactions. It only works on transactions which are not included in a block and are not currently in the mempool. It has no effect on transactions which are already conflicted or abandoned.", + "description": [ + "", + "> lbrycrd-cli abandontransaction \"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"abandontransaction\", \"params\": [\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction id" + } + }, + "required": [ + "txid" + ] + } + }, + "addmultisigaddress": { + "summary": "Add a nrequired-to-sign multisignature address to the wallet. Each key is a Bitcoin address or hex-encoded public key. If 'account' is specified (DEPRECATED), assign address to that account.", + "description": [ + "", + "", + "Add a multisig address from 2 addresses", + "> lbrycrd-cli addmultisigaddress 2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"", + "", + "As json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"addmultisigaddress\", \"params\": [2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "nrequired": { + "type": "number", + "description": "The number of required signatures out of the n keys or addresses." + }, + "keysobject": { + "type": "string", + "description": "A json array of lbrycrd addresses or hex-encoded public keys [ \"address\" (string) lbrycrd address or hex-encoded public key ..., ]" + }, + "account": { + "type": "string", + "description": "DEPRECATED. An account to assign the addresses to." + } + }, + "required": [ + "nrequired", + "keysobject" + ] + }, + "result": { + "type": "string", + "description": "A lbrycrd address associated with the keys." + } + }, + "backupwallet": { + "summary": "Safely copies current wallet file to destination, which can be a directory or a path with filename.", + "description": [ + "", + "> lbrycrd-cli backupwallet \"backup.dat\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"backupwallet\", \"params\": [\"backup.dat\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "description": "The destination directory or file" + } + }, + "required": [ + "destination" + ] + } + }, + "dumpprivkey": { + "summary": "Reveals the private key corresponding to 'lbrycrdaddress'. Then the importprivkey can be used with this output", + "description": [ + "", + "> lbrycrd-cli dumpprivkey \"myaddress\"", + "> lbrycrd-cli importprivkey \"mykey\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"dumpprivkey\", \"params\": [\"myaddress\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address for the private key" + } + }, + "required": [ + "lbrycrdaddress" + ] + }, + "result": { + "type": "string", + "description": "The private key" + } + }, + "dumpwallet": { + "summary": "Dumps all wallet keys in a human-readable format.", + "description": [ + "", + "> lbrycrd-cli dumpwallet \"test\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"dumpwallet\", \"params\": [\"test\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "filename": { + "type": "string", + "description": "The filename" + } + }, + "required": [ + "filename" + ] + } + }, + "encryptwallet": { + "summary": "Encrypts the wallet with 'passphrase'. This is for first time encryption. After this, any calls that interact with private keys such as sending or signing will require the passphrase to be set prior the making these calls. Use the walletpassphrase call for this, and then walletlock call. If the wallet is already encrypted, use the walletpassphrasechange call. Note that this will shutdown the server.", + "description": [ + "", + "", + "Encrypt you wallet", + "> lbrycrd-cli encryptwallet \"my pass phrase\"", + "", + "Now set the passphrase to use the wallet, such as for signing or sending LBC", + "> lbrycrd-cli walletpassphrase \"my pass phrase\"", + "", + "Now we can so something like sign", + "> lbrycrd-cli signmessage \"lbrycrdaddress\" \"test message\"", + "", + "Now lock the wallet again by removing the passphrase", + "> lbrycrd-cli walletlock ", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"encryptwallet\", \"params\": [\"my pass phrase\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "passphrase": { + "type": "string", + "description": "The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long." + } + }, + "required": [ + "passphrase" + ] + } + }, + "getaccount": { + "summary": "DEPRECATED. Returns the account associated with the given address.", + "description": [ + "", + "> lbrycrd-cli getaccount \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaccount\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address for account lookup." + } + }, + "required": [ + "lbrycrdaddress" + ] + }, + "result": { + "type": "string", + "description": "the account address" + } + }, + "getaccountaddress": { + "summary": "DEPRECATED. Returns the current Bitcoin address for receiving payments to this account.", + "description": [ + "", + "> lbrycrd-cli getaccountaddress ", + "> lbrycrd-cli getaccountaddress \"\"", + "> lbrycrd-cli getaccountaddress \"myaccount\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaccountaddress\", \"params\": [\"myaccount\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "The account name for the address. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name." + } + }, + "required": [ + "account" + ] + }, + "result": { + "type": "string", + "description": "The account lbrycrd address" + } + }, + "getaddressesbyaccount": { + "summary": "DEPRECATED. Returns the list of addresses for the given account.", + "description": [ + "", + "> lbrycrd-cli getaddressesbyaccount \"tabby\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaddressesbyaccount\", \"params\": [\"tabby\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "The account name." + } + }, + "required": [ + "account" + ] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "a lbrycrd address associated with the given account" + } + } + } + } + }, + "getbalance": { + "summary": "If account is not specified, returns the server's total available balance. If account is specified (DEPRECATED), returns the balance in the account. Note that the account \"\" is not the same as leaving the parameter out. The server total may be different to the balance in the default \"\" account.", + "description": [ + "", + "", + "The total amount in the wallet", + "> lbrycrd-cli getbalance ", + "", + "The total amount in the wallet at least 5 blocks confirmed", + "> lbrycrd-cli getbalance \"*\" 6", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getbalance\", \"params\": [\"*\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "DEPRECATED. The selected account, or \"*\" for entire wallet. It may be the default account using \"\"." + }, + "minconf": { + "type": "number", + "description": "Only include transactions confirmed at least this many times.", + "default": 1 + }, + "includeWatchonly": { + "type": "boolean", + "description": "Also include balance in watchonly addresses (see 'importaddress')", + "default": false + } + }, + "required": [] + }, + "result": { + "type": "number", + "description": "The total amount in LBC received for this account." + } + }, + "getnewaddress": { + "summary": "Returns a new Bitcoin address for receiving payments. If 'account' is specified (DEPRECATED), it is added to the address book so payments received with the address will be credited to 'account'.", + "description": [ + "", + "> lbrycrd-cli getnewaddress ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnewaddress\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "DEPRECATED. The account name for the address to be linked to. If not provided, the default account \"\" is used. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name." + } + }, + "required": [] + }, + "result": { + "type": "string", + "description": "The new lbrycrd address" + } + }, + "getrawchangeaddress": { + "summary": "Returns a new Bitcoin address, for receiving change. This is for use with raw transactions, NOT normal use.", + "description": [ + "", + "> lbrycrd-cli getrawchangeaddress ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getrawchangeaddress\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "string", + "description": "The address" + } + }, + "getreceivedbyaccount": { + "summary": "DEPRECATED. Returns the total amount received by addresses with in transactions with at least [minconf] confirmations.", + "description": [ + "", + "", + "Amount received by the default account with at least 1 confirmation", + "> lbrycrd-cli getreceivedbyaccount \"\"", + "", + "Amount received at the tabby account including unconfirmed amounts with zero confirmations", + "> lbrycrd-cli getreceivedbyaccount \"tabby\" 0", + "", + "The amount with at least 6 confirmation, very safe", + "> lbrycrd-cli getreceivedbyaccount \"tabby\" 6", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getreceivedbyaccount\", \"params\": [\"tabby\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "The selected account, may be the default account using \"\"." + }, + "minconf": { + "type": "number", + "description": "Only include transactions confirmed at least this many times.", + "default": 1 + } + }, + "required": [ + "account" + ] + }, + "result": { + "type": "number", + "description": "The total amount in LBC received for this account." + } + }, + "getreceivedbyaddress": { + "summary": "Returns the total amount received by the given lbrycrdaddress in transactions with at least minconf confirmations.", + "description": [ + "", + "", + "The amount from transactions with at least 1 confirmation", + "> lbrycrd-cli getreceivedbyaddress \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"", + "", + "The amount including unconfirmed transactions, zero confirmations", + "> lbrycrd-cli getreceivedbyaddress \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" 0", + "", + "The amount with at least 6 confirmation, very safe", + "> lbrycrd-cli getreceivedbyaddress \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" 6", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getreceivedbyaddress\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address for transactions." + }, + "minconf": { + "type": "number", + "description": "Only include transactions confirmed at least this many times.", + "default": 1 + } + }, + "required": [ + "lbrycrdaddress" + ] + }, + "result": { + "type": "number", + "description": "The total amount in LBC received at this address." + } + }, + "gettransaction": { + "summary": "Get detailed information about in-wallet transaction ", + "description": [ + "", + "> lbrycrd-cli gettransaction \"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"", + "> lbrycrd-cli gettransaction \"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gettransaction\", \"params\": [\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction id" + }, + "includeWatchonly": { + "type": "boolean", + "description": "Whether to include watchonly addresses in balance calculation and details[]", + "default": false + } + }, + "required": [ + "txid" + ] + }, + "result": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "The transaction amount in LBC" + }, + "confirmations": { + "type": "number", + "description": "The number of confirmations" + }, + "blockhash": { + "type": "string", + "description": "The block hash" + }, + "blockindex": { + "type": "number", + "description": "The index of the transaction in the block that includes it" + }, + "blocktime": { + "type": "number", + "description": "The time in seconds since epoch (1 Jan 1970 GMT)" + }, + "txid": { + "type": "string", + "description": "The transaction id." + }, + "time": { + "type": "number", + "description": "The transaction time in seconds since epoch (1 Jan 1970 GMT)" + }, + "timereceived": { + "type": "number", + "description": "The time received in seconds since epoch (1 Jan 1970 GMT)" + }, + "bip125-replaceable": { + "type": "string", + "description": "Whether this transaction could be replaced due to BIP125 (replace-by-fee); may be unknown for unconfirmed transactions not in the mempool" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "DEPRECATED. The account name involved in the transaction, can be \"\" for the default account." + }, + "address": { + "type": "string", + "description": "The lbrycrd address involved in the transaction" + }, + "category": { + "type": "string", + "description": "The category, either 'send' or 'receive'" + }, + "amount": { + "type": "number", + "description": "The amount in LBC" + }, + "label": { + "type": "string", + "description": "A comment for the address/transaction, if any" + }, + "vout": { + "type": "number", + "description": "the vout value" + } + } + } + }, + "hex": { + "type": "string", + "description": "Raw data for transaction" + } + } + } + }, + "getunconfirmedbalance": { + "summary": "Returns the server's total unconfirmed balance", + "description": [], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + } + }, + "getwalletinfo": { + "summary": "Returns an object containing various wallet state info.", + "description": [ + "", + "> lbrycrd-cli getwalletinfo ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getwalletinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "walletversion": { + "type": "number", + "description": "the wallet version" + }, + "balance": { + "type": "number", + "description": "the total confirmed balance of the wallet in LBC" + }, + "unconfirmed_balance": { + "type": "number", + "description": "the total unconfirmed balance of the wallet in LBC" + }, + "immature_balance": { + "type": "number", + "description": "the total immature balance of the wallet in LBC" + }, + "txcount": { + "type": "number", + "description": "the total number of transactions in the wallet" + }, + "keypoololdest": { + "type": "number", + "description": "the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool" + }, + "keypoolsize": { + "type": "number", + "description": "how many new keys are pre-generated" + }, + "unlocked_until": { + "type": "number", + "description": "the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked" + }, + "paytxfee": { + "type": "number", + "description": "the transaction fee configuration, set in LBC/kB" + } + } + } + }, + "importaddress": { + "summary": "Adds a script (in hex) or address that can be watched as if it were in your wallet but cannot be used to spend.", + "description": [ + "", + "", + "Import a script with rescan", + "> lbrycrd-cli importaddress \"myscript\"", + "", + "Import using a label without rescan", + "> lbrycrd-cli importaddress \"myscript\" \"testing\" false", + "", + "As a JSON-RPC call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"importaddress\", \"params\": [\"myscript\", \"testing\", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "script": { + "type": "string", + "description": "The hex-encoded script (or address)" + }, + "label": { + "type": "string", + "description": "An optional label", + "default": "\"\"" + }, + "rescan": { + "type": "boolean", + "description": "Rescan the wallet for transactions", + "default": true + }, + "p2sh": { + "type": "boolean", + "description": "Add the P2SH version of the script as well Note: This call can take minutes to complete if rescan is true. If you have the full public key, you should call importpubkey instead of this.", + "default": false + } + }, + "required": [ + "script" + ] + } + }, + "importprivkey": { + "summary": "Adds a private key (as returned by dumpprivkey) to your wallet.", + "description": [ + "", + "", + "Dump a private key", + "> lbrycrd-cli dumpprivkey \"myaddress\"", + "", + "Import the private key with rescan", + "> lbrycrd-cli importprivkey \"mykey\"", + "", + "Import using a label and without rescan", + "> lbrycrd-cli importprivkey \"mykey\" \"testing\" false", + "", + "As a JSON-RPC call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"importprivkey\", \"params\": [\"mykey\", \"testing\", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "lbrycrdprivkey": { + "type": "string", + "description": "The private key (see dumpprivkey)" + }, + "label": { + "type": "string", + "description": "An optional label", + "default": "\"\"" + }, + "rescan": { + "type": "boolean", + "description": "Rescan the wallet for transactions Note: This call can take minutes to complete if rescan is true.", + "default": true + } + }, + "required": [ + "lbrycrdprivkey" + ] + } + }, + "importprunedfunds": { + "summary": "Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.", + "description": [], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "rawtransaction": { + "type": "string", + "description": "A raw transaction in hex funding an already-existing address in wallet" + }, + "txoutproof": { + "type": "string", + "description": "The hex output from gettxoutproof that contains the transaction" + }, + "label": { + "type": "string", + "description": "An optional label" + } + }, + "required": [ + "rawtransaction", + "txoutproof" + ] + } + }, + "importpubkey": { + "summary": "Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend.", + "description": [ + "", + "", + "Import a public key with rescan", + "> lbrycrd-cli importpubkey \"mypubkey\"", + "", + "Import using a label without rescan", + "> lbrycrd-cli importpubkey \"mypubkey\" \"testing\" false", + "", + "As a JSON-RPC call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"importpubkey\", \"params\": [\"mypubkey\", \"testing\", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "pubkey": { + "type": "string", + "description": "The hex-encoded public key" + }, + "label": { + "type": "string", + "description": "An optional label", + "default": "\"\"" + }, + "rescan": { + "type": "boolean", + "description": "Rescan the wallet for transactions Note: This call can take minutes to complete if rescan is true.", + "default": true + } + }, + "required": [ + "pubkey" + ] + } + }, + "importwallet": { + "summary": "Imports keys from a wallet dump file (see dumpwallet).", + "description": [ + "", + "", + "Dump the wallet", + "> lbrycrd-cli dumpwallet \"test\"", + "", + "Import the wallet", + "> lbrycrd-cli importwallet \"test\"", + "", + "Import using the json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"importwallet\", \"params\": [\"test\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "filename": { + "type": "string", + "description": "The wallet file" + } + }, + "required": [ + "filename" + ] + } + }, + "keypoolrefill": { + "summary": "Fills the keypool.", + "description": [ + "", + "> lbrycrd-cli keypoolrefill ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"keypoolrefill\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "newsize": { + "type": "number", + "description": "The new keypool size", + "default": 100 + } + }, + "required": [] + } + }, + "listaccounts": { + "summary": "DEPRECATED. Returns Object that has account names as keys, account balances as values.", + "description": [ + "", + "", + "List account balances where there at least 1 confirmation", + "> lbrycrd-cli listaccounts ", + "", + "List account balances including zero confirmation transactions", + "> lbrycrd-cli listaccounts 0", + "", + "List account balances for 6 or more confirmations", + "> lbrycrd-cli listaccounts 6", + "", + "As json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listaccounts\", \"params\": [6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "minconf": { + "type": "number", + "description": "Only include transactions with at least this many confirmations", + "default": 1 + }, + "includeWatchonly": { + "type": "boolean", + "description": "Include balances in watchonly addresses (see 'importaddress')", + "default": false + } + }, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "account": { + "type": "number", + "description": "The property name is the account name, and the value is the total balance for the account." + } + } + } + }, + "listaddressgroupings": { + "summary": "Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions", + "description": [ + "", + "> lbrycrd-cli listaddressgroupings ", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listaddressgroupings\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "array" + } + } + }, + "listlockunspent": { + "summary": "Returns list of temporarily unspendable outputs. See the lockunspent call to lock and unlock transactions for spending.", + "description": [ + "", + "", + "List the unspent transactions", + "> lbrycrd-cli listunspent ", + "", + "Lock an unspent transaction", + "> lbrycrd-cli lockunspent false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"", + "", + "List the locked transactions", + "> lbrycrd-cli listlockunspent ", + "", + "Unlock the transaction again", + "> lbrycrd-cli lockunspent true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listlockunspent\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": {}, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The transaction id locked" + }, + "vout": { + "type": "number", + "description": "The vout value" + } + } + } + } + }, + "listreceivedbyaccount": { + "summary": "DEPRECATED. List balances by account.", + "description": [ + "", + "> lbrycrd-cli listreceivedbyaccount ", + "> lbrycrd-cli listreceivedbyaccount 6 true", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listreceivedbyaccount\", \"params\": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "minconf": { + "type": "number", + "description": "The minimum number of confirmations before payments are included.", + "default": 1 + }, + "includeempty": { + "type": "boolean", + "description": "Whether to include accounts that haven't received any payments.", + "default": false + }, + "includeWatchonly": { + "type": "boolean", + "description": "Whether to include watchonly addresses (see 'importaddress').", + "default": false + } + }, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "involvesWatchonly": { + "type": "boolean", + "description": "Only returned if imported addresses were involved in transaction" + }, + "account": { + "type": "string", + "description": "The account name of the receiving account" + }, + "amount": { + "type": "number", + "description": "The total amount received by addresses with this account" + }, + "confirmations": { + "type": "number", + "description": "The number of confirmations of the most recent transaction included" + }, + "label": { + "type": "string", + "description": "A comment for the address/transaction, if any" + } + } + } + } + }, + "listreceivedbyaddress": { + "summary": "List balances by receiving address.", + "description": [ + "", + "> lbrycrd-cli listreceivedbyaddress ", + "> lbrycrd-cli listreceivedbyaddress 6 true", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listreceivedbyaddress\", \"params\": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "minconf": { + "type": "number", + "description": "The minimum number of confirmations before payments are included.", + "default": 1 + }, + "includeempty": { + "type": "boolean", + "description": "Whether to include addresses that haven't received any payments.", + "default": false + }, + "includeWatchonly": { + "type": "boolean", + "description": "Whether to include watchonly addresses (see 'importaddress').", + "default": false + } + }, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "involvesWatchonly": { + "type": "boolean", + "description": "Only returned if imported addresses were involved in transaction" + }, + "address": { + "type": "string", + "description": "The receiving address" + }, + "account": { + "type": "string", + "description": "DEPRECATED. The account of the receiving address. The default account is \"\"." + }, + "amount": { + "type": "number", + "description": "The total amount in LBC received by the address" + }, + "confirmations": { + "type": "number", + "description": "The number of confirmations of the most recent transaction included" + }, + "label": { + "type": "string", + "description": "A comment for the address/transaction, if any" + } + } + } + } + }, + "listsinceblock": { + "summary": "Get all transactions in blocks since block [blockhash], or all transactions if omitted", + "description": [ + "", + "> lbrycrd-cli listsinceblock ", + "> lbrycrd-cli listsinceblock \"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\" 6", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listsinceblock\", \"params\": [\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "blockhash": { + "type": "string", + "description": "The block hash to list transactions since" + }, + "target-confirmations": { + "type": "number", + "description": "The confirmations required, must be 1 or more" + }, + "includeWatchonly": { + "type": "boolean", + "description": "Include transactions to watchonly addresses (see 'importaddress')", + "default": false + } + }, + "required": [] + }, + "result": { + "type": "object", + "properties": { + "transactions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "DEPRECATED. The account name associated with the transaction. Will be \"\" for the default account." + }, + "address": { + "type": "string", + "description": "The lbrycrd address of the transaction. Not present for move transactions (category = move)." + }, + "category": { + "type": "string", + "description": "The transaction category. 'send' has negative amounts, 'receive' has positive amounts." + }, + "amount": { + "type": "number", + "description": "The amount in LBC. This is negative for the 'send' category, and for the 'move' category for moves outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds." + }, + "vout": { + "type": "number", + "description": "the vout value" + }, + "fee": { + "type": "number", + "description": "The amount of the fee in LBC. This is negative and only available for the 'send' category of transactions." + }, + "confirmations": { + "type": "number", + "description": "The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions." + }, + "blockhash": { + "type": "string", + "description": "The block hash containing the transaction. Available for 'send' and 'receive' category of transactions." + }, + "blockindex": { + "type": "number", + "description": "The index of the transaction in the block that includes it. Available for 'send' and 'receive' category of transactions." + }, + "blocktime": { + "type": "number", + "description": "The block time in seconds since epoch (1 Jan 1970 GMT)." + }, + "txid": { + "type": "string", + "description": "The transaction id. Available for 'send' and 'receive' category of transactions." + }, + "time": { + "type": "number", + "description": "The transaction time in seconds since epoch (Jan 1 1970 GMT)." + }, + "timereceived": { + "type": "number", + "description": "The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions." + }, + "comment": { + "type": "string", + "description": "If a comment is associated with the transaction." + }, + "label": { + "type": "string", + "description": "A comment for the address/transaction, if any" + }, + "to": { + "type": "string", + "description": "If a comment to is associated with the transaction." + } + } + } + }, + "lastblock": { + "type": "string", + "description": "The hash of the last block" + } + } + } + }, + "listtransactions": { + "summary": "Returns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.", + "description": [ + "", + "", + "List the most recent 10 transactions in the systems", + "> lbrycrd-cli listtransactions ", + "", + "List transactions 100 to 120", + "> lbrycrd-cli listtransactions \"*\" 20 100", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listtransactions\", \"params\": [\"*\", 20, 100] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "DEPRECATED. The account name. Should be \"*\"." + }, + "count": { + "type": "number", + "description": "The number of transactions to return", + "default": 10 + }, + "from": { + "type": "number", + "description": "The number of transactions to skip", + "default": 0 + }, + "includeWatchonly": { + "type": "boolean", + "description": "Include transactions to watchonly addresses (see 'importaddress')", + "default": false + } + }, + "required": [] + }, + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "DEPRECATED. The account name associated with the transaction. It will be \"\" for the default account." + }, + "address": { + "type": "string", + "description": "The lbrycrd address of the transaction. Not present for move transactions (category = move)." + }, + "category": { + "type": "string", + "description": "The transaction category. 'move' is a local (off blockchain) transaction between accounts, and not associated with an address, transaction id or block. 'send' and 'receive' transactions are associated with an address, transaction id and block details" + }, + "amount": { + "type": "number", + "description": "The amount in LBC. This is negative for the 'send' category, and for the 'move' category for moves outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds." + }, + "vout": { + "type": "number", + "description": "the vout value" + }, + "fee": { + "type": "number", + "description": "The amount of the fee in LBC. This is negative and only available for the 'send' category of transactions." + }, + "abandoned": { + "type": "boolean", + "description": "'true' if the transaction has been abandoned (inputs are respendable)." + }, + "confirmations": { + "type": "number", + "description": "The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions. Negative confirmations indicate the transaction conflicts with the block chain" + }, + "trusted": { + "type": "boolean", + "description": "Whether we consider the outputs of this unconfirmed transaction safe to spend." + }, + "blockhash": { + "type": "string", + "description": "The block hash containing the transaction. Available for 'send' and 'receive' category of transactions." + }, + "blockindex": { + "type": "number", + "description": "The index of the transaction in the block that includes it. Available for 'send' and 'receive' category of transactions." + }, + "blocktime": { + "type": "number", + "description": "The block time in seconds since epoch (1 Jan 1970 GMT)." + }, + "txid": { + "type": "string", + "description": "The transaction id. Available for 'send' and 'receive' category of transactions." + }, + "time": { + "type": "number", + "description": "The transaction time in seconds since epoch (midnight Jan 1 1970 GMT)." + }, + "timereceived": { + "type": "number", + "description": "The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions." + }, + "comment": { + "type": "string", + "description": "If a comment is associated with the transaction." + }, + "label": { + "type": "string", + "description": "A comment for the address/transaction, if any" + }, + "otheraccount": { + "type": "string", + "description": "For the 'move' category of transactions, the account the funds came from (for receiving funds, positive amounts), or went to (for sending funds, negative amounts)." + }, + "bip125-replaceable": { + "type": "string", + "description": "Whether this transaction could be replaced due to BIP125 (replace-by-fee); may be unknown for unconfirmed transactions not in the mempool" + } + } + } + } + }, + "listunspent": { + "summary": "Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations. Optionally filter to only include txouts paid to specified addresses. Results are an array of Objects, each of which has: {txid, vout, scriptPubKey, amount, confirmations}", + "description": [ + "", + "> lbrycrd-cli listunspent ", + "> lbrycrd-cli listunspent 6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listunspent\", \"params\": [6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "minconf": { + "type": "number", + "description": "The minimum confirmations to filter", + "default": 1 + }, + "maxconf": { + "type": "number", + "description": "The maximum confirmations to filter", + "default": 9999999 + }, + "addresses": { + "type": "string", + "description": "A json array of lbrycrd addresses to filter [ \"address\" (string) lbrycrd address ,... ] Result [ (array of json object) { \"txid\" : \"txid\", (string) the transaction id \"vout\" : n, (numeric) the vout value \"address\" : \"address\", (string) the lbrycrd address \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account \"scriptPubKey\" : \"key\", (string) the script key \"amount\" : x.xxx, (numeric) the transaction amount in LBC \"confirmations\" : n (numeric) The number of confirmations } ,... ]" + } + }, + "required": [ + "addresses" + ] + } + }, + "lockunspent": { + "summary": "Updates list of temporarily unspendable outputs. Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs. If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked. A locked transaction output will not be chosen by automatic coin selection, when spending LBC. Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list is always cleared (by virtue of process exit) when a node stops or fails. Also see the listunspent call", + "description": [ + "", + "", + "List the unspent transactions", + "> lbrycrd-cli listunspent ", + "", + "Lock an unspent transaction", + "> lbrycrd-cli lockunspent false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"", + "", + "List the locked transactions", + "> lbrycrd-cli listlockunspent ", + "", + "Unlock the transaction again", + "> lbrycrd-cli lockunspent true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"lockunspent\", \"params\": [false, \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "unlock": { + "type": "boolean", + "description": "Whether to unlock (true) or lock (false) the specified transactions" + }, + "transactions": { + "type": "string", + "description": "A json array of objects. Each object the txid (string) vout (numeric) [ (json array of json objects) { \"txid\":\"id\", (string) The transaction id \"vout\": n (numeric) The output number } ,... ]" + } + }, + "required": [ + "unlock" + ] + }, + "result": { + "type": "boolean", + "description": "Whether the command was successful or not" + } + }, + "move": { + "summary": "DEPRECATED. Move a specified amount from one account in your wallet to another.", + "description": [ + "", + "", + "Move 0.01 LBC from the default account to the account named tabby", + "> lbrycrd-cli move \"\" \"tabby\" 0.01", + "", + "Move 0.01 LBC timotei to akiko with a comment and funds have 6 confirmations", + "> lbrycrd-cli move \"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"move\", \"params\": [\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "fromaccount": { + "type": "string", + "description": "The name of the account to move funds from. May be the default account using \"\"." + }, + "toaccount": { + "type": "string", + "description": "The name of the account to move funds to. May be the default account using \"\"." + }, + "amount": { + "type": "number", + "description": "Quantity of LBC to move between accounts." + }, + "minconf": { + "type": "number", + "description": "Only use funds with at least this many confirmations.", + "default": 1 + }, + "comment": { + "type": "string", + "description": "An optional comment, stored in the wallet only." + } + }, + "required": [ + "fromaccount", + "toaccount", + "amount" + ] + }, + "result": { + "type": "boolean", + "description": "true if successful." + } + }, + "removeprunedfunds": { + "summary": "Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will effect wallet balances.", + "description": [ + "", + "> lbrycrd-cli removeprunedfunds \"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\"", + "", + "As a JSON-RPC call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"removprunedfunds\", \"params\": [\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "txid": { + "type": "string", + "description": "The hex-encoded id of the transaction you are deleting" + } + }, + "required": [ + "txid" + ] + } + }, + "sendfrom": { + "summary": "DEPRECATED (use sendtoaddress). Sent an amount from an account to a lbrycrd address.", + "description": [ + "", + "", + "Send 0.01 LBC from the default account to the address, must have at least 1 confirmation", + "> lbrycrd-cli sendfrom \"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01", + "", + "Send 0.01 from the tabby account to the given address, funds must have at least 6 confirmations", + "> lbrycrd-cli sendfrom \"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01 6 \"donation\" \"seans outpost\"", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendfrom\", \"params\": [\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.01, 6, \"donation\", \"seans outpost\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "fromaccount": { + "type": "string", + "description": "The name of the account to send funds from. May be the default account using \"\"." + }, + "tolbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address to send funds to." + }, + "amount": { + "type": "number", + "description": "The amount in LBC (transaction fee is added on top)." + }, + "minconf": { + "type": "number", + "description": "Only use funds with at least this many confirmations.", + "default": 1 + }, + "comment": { + "type": "string", + "description": "A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet." + }, + "comment-to": { + "type": "string", + "description": "An optional comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, it is just kept in your wallet." + } + }, + "required": [ + "fromaccount", + "tolbrycrdaddress", + "amount" + ] + }, + "result": { + "type": "string", + "description": "The transaction id." + } + }, + "sendmany": { + "summary": "Send multiple times. Amounts are double-precision floating point numbers.", + "description": [ + "", + "", + "Send two amounts to two different addresses:", + "> lbrycrd-cli sendmany \"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"", + "", + "Send two amounts to two different addresses setting the confirmation and comment:", + "> lbrycrd-cli sendmany \"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 6 \"testing\"", + "", + "Send two amounts to two different addresses, subtract fee from amount:", + "> lbrycrd-cli sendmany \"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 1 \"\" \"[\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\",\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\"]\"", + "", + "As a json rpc call", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendmany\", \"params\": [\"\", \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\", 6, \"testing\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "fromaccount": { + "type": "string", + "description": "DEPRECATED. The account to send the funds from. Should be \"\" for the default account" + }, + "amounts": { + "type": "string", + "description": "A json object with addresses and amounts { \"address\":amount (numeric or string) The lbrycrd address is the key, the numeric amount (can be string) in LBC is the value ,... }" + }, + "minconf": { + "type": "number", + "description": "Only use the balance confirmed at least this many times.", + "default": 1 + }, + "comment": { + "type": "string", + "description": "A comment" + }, + "subtractfeefromamount": { + "type": "string", + "description": "A json array with addresses. The fee will be equally deducted from the amount of each selected address. Those recipients will receive less LBC than you enter in their corresponding amount field. If no addresses are specified here, the sender pays the fee. [ \"address\" (string) Subtract fee from this address ,... ]" + } + }, + "required": [ + "fromaccount", + "amounts" + ] + }, + "result": { + "type": "string", + "description": "The transaction id for the send. Only 1 transaction is created regardless of the number of addresses." + } + }, + "sendtoaddress": { + "summary": "Send an amount to a given address.", + "description": [ + "", + "> lbrycrd-cli sendtoaddress \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1", + "> lbrycrd-cli sendtoaddress \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"donation\" \"seans outpost\"", + "> lbrycrd-cli sendtoaddress \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendtoaddress\", \"params\": [\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.1, \"donation\", \"seans outpost\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address to send to." + }, + "amount": { + "type": "number", + "description": "The amount in LBC to send. eg 0.1" + }, + "comment": { + "type": "string", + "description": "A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet." + }, + "comment-to": { + "type": "string", + "description": "A comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, just kept in your wallet." + }, + "subtractfeefromamount": { + "type": "boolean", + "description": "The fee will be deducted from the amount being sent. The recipient will receive less LBC than you enter in the amount field.", + "default": false + } + }, + "required": [ + "lbrycrdaddress", + "amount" + ] + }, + "result": { + "type": "string", + "description": "The transaction id." + } + }, + "setaccount": { + "summary": "DEPRECATED. Sets the account associated with the given address.", + "description": [ + "", + "> lbrycrd-cli setaccount \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"tabby\"", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"setaccount\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"tabby\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address to be associated with an account." + }, + "account": { + "type": "string", + "description": "The account to assign the address to." + } + }, + "required": [ + "lbrycrdaddress", + "account" + ] + } + }, + "settxfee": { + "summary": "Set the transaction fee per kB. Overwrites the paytxfee parameter.", + "description": [ + "", + "> lbrycrd-cli settxfee 0.00001", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"settxfee\", \"params\": [0.00001] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "The transaction fee in LBC/kB Result true|false (boolean) Returns true if successful" + } + }, + "required": [ + "amount" + ] + } + }, + "signmessage": { + "summary": "Sign a message with the private key of an address", + "description": [ + "", + "", + "Unlock the wallet for 30 seconds", + "> lbrycrd-cli walletpassphrase \"mypassphrase\" 30", + "", + "Create the signature", + "> lbrycrd-cli signmessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"my message\"", + "", + "Verify the signature", + "> lbrycrd-cli verifymessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"signature\" \"my message\"", + "", + "As json rpc", + "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"signmessage\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"my message\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/", + "" + ], + "tags": [ + "Wallet" + ], + "params": { + "type": "object", + "properties": { + "lbrycrdaddress": { + "type": "string", + "description": "The lbrycrd address to use for the private key." + }, + "message": { + "type": "string", + "description": "The message to create a signature of." + } + }, + "required": [ + "lbrycrdaddress", + "message" + ] + }, + "result": { + "type": "string", + "description": "The signature of the message encoded in base 64" + } + } + } +} diff --git a/contrib/devtools/generated/api_v1.json b/contrib/devtools/generated/api_v1.json new file mode 100644 index 000000000..c91f127c4 --- /dev/null +++ b/contrib/devtools/generated/api_v1.json @@ -0,0 +1,2655 @@ +[ + { + "name": "abandonclaim", + "namespace": "Claimtrie", + "description": "Create a transaction which spends a txout which assigned a value to a name, effectively abandoning that claim.", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "The transaction containing the unspent txout which should be spent.", + "is_required": true + }, + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address to send to.", + "is_required": true + }, + { + "name": "amount", + "type": "number", + "description": "The amount to send to the lbrycrd address. eg 0.1", + "is_required": true + } + ], + "examples": [], + "returns": "\"transactionid\" (string) The new transaction id." + }, + { + "name": "abandonsupport", + "namespace": "Claimtrie", + "description": "Create a transaction which spends a txout which supported a name claim, effectively abandoning that support.", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "The transaction containing the unspent txout which should be spent.", + "is_required": true + }, + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address to send to.", + "is_required": true + }, + { + "name": "amount", + "type": "number", + "description": "The amount to send to the lbrycrd address. eg 0.1", + "is_required": true + } + ], + "examples": [], + "returns": "\"transactionid\" (string) The new transaction id." + }, + { + "name": "checknormalization", + "namespace": "Claimtrie", + "description": "Given an unnormalized name of a claim, return normalized version of it", + "arguments": [ + { + "name": "name", + "type": "string", + "description": "the name to normalize", + "is_required": true + } + ], + "examples": [], + "returns": "\"normalized\" (string) fully normalized name" + }, + { + "name": "claimname", + "namespace": "Claimtrie", + "description": "Create a transaction which issues a claim assigning a value to a name. The claim will be authoritative if the transaction amount is greater than the transaction amount of all other unspent transactions which issue a claim over the same name, and it will remain authoritative as long as it remains unspent and there are no other greater unspent transactions issuing a claim over the same name. The amount is a real and is rounded to the nearest 0.00000001", + "arguments": [ + { + "name": "name", + "type": "string", + "description": "The name to be assigned the value.", + "is_required": true + }, + { + "name": "value", + "type": "string", + "description": "The value to assign to the name encoded in hexadecimal.", + "is_required": true + }, + { + "name": "amount", + "type": "number", + "description": "The amount in LBRYcrd to send. eg 0.1", + "is_required": true + } + ], + "examples": [], + "returns": "\"transactionid\" (string) The transaction id." + }, + { + "name": "getclaimbyid", + "namespace": "Claimtrie", + "description": "Get a claim by claim id", + "arguments": [ + { + "name": "claimId", + "type": "string", + "description": "the claimId of this claim", + "is_required": true + } + ], + "examples": [], + "returns": "{\n \"name\" (string) the original name of the claim (before normalization)\n \"normalized_name\" (string) the name of this claim (after normalization)\n \"value\" (string) claim metadata\n \"claimId\" (string) the claimId of this claim\n \"txid\" (string) the hash of the transaction which has successfully claimed this name\n \"n\" (numeric) vout value\n \"amount\" (numeric) txout value\n \"effective amount\" (numeric) txout amount plus amount from all supports associated with the claim\n \"supports\" (array of object) supports for this claim\n [\n \"txid\" (string) the txid of the support\n \"n\" (numeric) the index of the support in the transaction's list of outputs\n \"height\" (numeric) the height at which the support was included in the blockchain\n \"valid at height\" (numeric) the height at which the support is valid\n \"amount\" (numeric) the amount of the support\n ]\n \"height\" (numeric) the height of the block in which this claim transaction is located\n \"valid at height\" (numeric) the height at which the claim is valid\n}" + }, + { + "name": "getclaimsforname", + "namespace": "Claimtrie", + "description": "Return all claims and supports for a name", + "arguments": [ + { + "name": "name", + "type": "string", + "description": "the name for which to get claims and supports", + "is_required": true + }, + { + "name": "blockhash", + "type": "string", + "description": "get claims for name at the block specified by this block hash. If none is given, the latest active block will be used.", + "is_required": false + } + ], + "examples": [], + "returns": "{\n \"nLastTakeoverHeight\" (numeric) the last height at which ownership of the name changed\n \"normalized_name\" (string) the name of these claims after normalization\n \"claims\": [ (array of object) claims for this name\n {\n \"claimId\" (string) the claimId of this claim\n \"txid\" (string) the txid of this claim\n \"n\" (numeric) the index of the claim in the transaction's list of outputs\n \"nHeight\" (numeric) the height at which the claim was included in the blockchain\n \"nValidAtHeight\" (numeric) the height at which the claim became/becomes valid\n \"nAmount\" (numeric) the amount of the claim\n \"value\" (string) the value of the name, if it exists\n \"nEffectiveAmount\" (numeric) the total effective amount of the claim, taking into effect whether the claim or support has reached its nValidAtHeight\n \"supports\" : [ (array of object) supports for this claim\n \"txid\" (string) the txid of the support\n \"n\" (numeric) the index of the support in the transaction's list of outputs\n \"nHeight\" (numeric) the height at which the support was included in the blockchain\n \"nValidAtHeight\" (numeric) the height at which the support became/becomes valid\n \"nAmount\" (numeric) the amount of the support\n ]\n \"name\" (string) the original name of this claim before normalization\n }\n ],\n \"supports without claims\": [ (array of object) supports that did not match a claim for this name\n {\n \"txid\" (string) the txid of the support\n \"n\" (numeric) the index of the support in the transaction's list of outputs\n \"nHeight\" (numeric) the height at which the support was included in the blockchain\n \"nValidAtHeight\" (numeric) the height at which the support became/becomes valid\n \"nAmount\" (numeric) the amount of the support\n }\n ]\n}" + }, + { + "name": "getclaimsfortx", + "namespace": "Claimtrie", + "description": "Return any claims or supports found in a transaction", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "the txid of the transaction to check for unspent claims", + "is_required": true + } + ], + "examples": [], + "returns": "[\n {\n \"nOut\" (numeric) the index of the claim or support in the transaction's list out outputs\n \"claim type\" (string) 'claim' or 'support'\n \"name\" (string) the name claimed or supported\n \"claimId\" (string) if a claim, its ID\n \"value\" (string) if a name claim, the value of the claim\n \"supported txid\" (string) if a support, the txid of the supported claim\n \"supported nout\" (numeric) if a support, the index of the supported claim in its transaction\n \"depth\" (numeric) the depth of the transaction in the main chain\n \"in claim trie\" (boolean) if a name claim, whether the claim is active, i.e. has made it into the trie\n \"is controlling\" (boolean) if a name claim, whether the claim is the current controlling claim for the name\n \"in support map\" (boolean) if a support, whether the support is active, i.e. has made it into the support map\n \"in queue\" (boolean) whether the claim is in a queue waiting to be inserted into the trie or support map\n \"blocks to valid\" (numeric) if in a queue, the number of blocks until it's inserted into the trie or support map\n }\n]" + }, + { + "name": "getclaimsintrie", + "namespace": "Claimtrie", + "description": "Return all claims in the name trie.", + "arguments": [ + { + "name": "blockhash", + "type": "string", + "description": "get claims in the trie at the block specified by this block hash. If none is given, the latest active block will be used.", + "is_required": false + } + ], + "examples": [], + "returns": "[\n {\n \"normalized_name\" (string) the name of these claims (after normalization)\n \"claims\": [ (array of object) the claims for this name\n {\n \"claimId\" (string) the claimId of the claim\n \"txid\" (string) the txid of the claim\n \"n\" (numeric) the vout value of the claim\n \"amount\" (numeric) txout amount\n \"height\" (numeric) the height of the block in which this transaction is located\n \"value\" (string) the value of this claim\n \"name\" (string) the original name of this claim (before normalization)\n }\n ]\n }\n]" + }, + { + "name": "getclaimtrie", + "namespace": "Claimtrie", + "description": "DEPRECATED. Return the entire name trie.", + "arguments": [ + { + "name": "blockhash", + "type": "string", + "description": "get claim in the trie at the block specified by this block hash. If none is given, the latest active block will be used.", + "is_required": false + } + ], + "examples": [], + "returns": "[\n {\n \"name\" (string) the name of the node\n \"hash\" (string) the hash of the node\n \"txid\" (string) (if value exists) the hash of the transaction which has successfully claimed this name\n \"n\" (numeric) (if value exists) vout value\n \"value\" (numeric) (if value exists) txout value\n \"height\" (numeric) (if value exists) the height of the block in which this transaction is located\n }\n]" + }, + { + "name": "getnameproof", + "namespace": "Claimtrie", + "description": "Return the cryptographic proof that a name maps to a value or doesn't.", + "arguments": [ + { + "name": "name", + "type": "string", + "description": "the name to get a proof for", + "is_required": true + }, + { + "name": "blockhash", + "type": "string", + "description": "the hash of the block which is the basis of the proof. If none is given, the latest block will be used.", + "is_required": false + } + ], + "examples": [], + "returns": "{\n \"nodes\" : [ (array of object) full nodes (i.e.\n those which lead to\n the requested name)\n \"children\" : [ (array of object) the children of\n this node\n \"child\" : { (object) a child node, either leaf or\n reference to a full node\n \"character\" : \"char\" (string) the character which\n leads from the parent\n to this child node\n \"nodeHash\" : \"hash\" (string, if exists) the hash of\n the node if\n this is a \n leaf node\n }\n ]\n \"valueHash\" (string, if exists) the hash of this\n node's value, if\n it has one. If \n this is the\n requested name\n this will not\n exist whether\n the node has a\n value or not\n ]\n \"txhash\" : \"hash\" (string, if exists) the txid of the\n claim which controls\n this name, if there\n is one.\n \"nOut\" : n, (numeric) the nOut of the claim which\n controls this name, if there\n is one.\n \"last takeover height\" (numeric) the most recent height at\n which the value of a name\n changed other than through\n an update to the winning\n bid\n }\n}" + }, + { + "name": "gettotalclaimednames", + "namespace": "Claimtrie", + "description": "Return the total number of names that have been successfully claimed, and therefore exist in the trie", + "arguments": [], + "examples": [], + "returns": "\"total names\" (numeric) the total number of\n names in the trie" + }, + { + "name": "gettotalclaims", + "namespace": "Claimtrie", + "description": "Return the total number of active claims in the trie", + "arguments": [], + "examples": [], + "returns": "\"total claims\" (numeric) the total number\n of active claims" + }, + { + "name": "gettotalvalueofclaims", + "namespace": "Claimtrie", + "description": "Return the total value of the claims in the trie", + "arguments": [ + { + "name": "controlling_only", + "type": "boolean", + "description": "only include the value of controlling claims", + "is_required": true + } + ], + "examples": [], + "returns": "\"total value\" (numeric) the total value of the\n claims in the trie" + }, + { + "name": "getvalueforname", + "namespace": "Claimtrie", + "description": "Return the winning value associated with a name, if one exists", + "arguments": [ + { + "name": "name", + "type": "string", + "description": "the name to look up", + "is_required": true + }, + { + "name": "blockhash", + "type": "string", + "description": "get the value associated with the name at the block specified by this block hash. If none is given, the latest active block will be used.", + "is_required": false + } + ], + "examples": [], + "returns": "\"value\" (string) the value of the name, if it exists\n\"claimId\" (string) the claimId for this name claim\n\"txid\" (string) the hash of the transaction which successfully claimed the name\n\"n\" (numeric) vout value\n\"amount\" (numeric) txout amount\n\"effective amount\" (numeric) txout amount plus amount from all supports associated with the claim\n\"height\" (numeric) the height of the block in which this transaction is located\n\"name\" (string) the original name of this claim (before normalization)" + }, + { + "name": "listnameclaims", + "namespace": "Claimtrie", + "description": "Return a list of all transactions claiming names.", + "arguments": [ + { + "name": "includesupports", + "type": "boolean", + "description": "Whether to also include claim supports. Default is true.", + "is_required": false + }, + { + "name": "activeonly", + "type": "boolean", + "description": "Whether to only include transactions which are still active, i.e. have not been spent. Default is false.", + "is_required": false + }, + { + "name": "minconf", + "type": "number", + "description": "Only include transactions confirmed at least this many time.", + "is_required": false + } + ], + "examples": [], + "returns": "[\n {\n \"name\":\"claimedname\", (string) The name that is claimed.\n \"claimtype\":\"claimtype\", (string) CLAIM or SUPPORT.\n \"claimId\":\"claimId\", (string) The claimId of the claim.\n \"value\":\"value\" (string) The value assigned to the name, if claimtype is CLAIM.\n \"account\":\"accountname\", (string) The account name associated with the transaction. \n It will be \"\" for the default account.\n \"address\":\"lbrycrdaddress\", (string) The lbrycrd address of the transaction.\n \"category\":\"name\" (string) Always name\n \"amount\": x.xxx, (numeric) The amount in LBC.\n \"vout\": n, (numeric) The vout value\n \"fee\": x.xxx, (numeric) The amount of the fee in LBC.\n \"height\": n (numeric) The height of the block in which this transaction was included.\n \"confirmations\": n, (numeric) The number of confirmations for the transaction\n \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n \"blockindex\": n, (numeric) The block index containing the transaction.\n \"txid\": \"transactionid\", (string) The transaction id.\n \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n \"comment\": \"...\", (string) If a comment is associated with the transaction.\n }\n]" + }, + { + "name": "supportclaim", + "namespace": "Claimtrie", + "description": "Increase the value of a claim. Whichever claim has the greatest value, including all support values, will be the authoritative claim, according to the rest of the rules. The name is the name which is claimed by the claim that will be supported, the txid is the txid of the claim that will be supported, nout is the transaction output which contains the claim to be supported, and amount is the amount which will be added to the value of the claim. If the claim is currently the authoritative claim, this support will go into effect immediately. Otherwise, it will go into effect after 100 blocks. The support will be in effect until it is spent, and will lose its effect when the claim is spent or expires. The amount is a real and is rounded to the nearest .00000001", + "arguments": [ + { + "name": "name", + "type": "string", + "description": "The name claimed by the claim to support.", + "is_required": true + }, + { + "name": "claimid", + "type": "string", + "description": "The claimid of the claim to support. This can be obtained by TODO PUT IN PLACE THAT SHOWS THIS.", + "is_required": true + }, + { + "name": "amount", + "type": "number", + "description": "The amount in LBC to use to support the claim.", + "is_required": true + } + ], + "examples": [], + "returns": "\"transactionid\" (string) The transaction id of the support." + }, + { + "name": "updateclaim", + "namespace": "Claimtrie", + "description": "Create a transaction which issues a claim assigning a value to a name, spending the previous txout which issued a claim over the same name and therefore superseding that claim. The claim will be authoritative if the transaction amount is greater than the transaction amount of all other unspent transactions which issue a claim over the same name, and it will remain authoritative as long as it remains unspent and there are no greater unspent transactions issuing a claim over the same name.", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "The transaction containing the unspent txout which should be spent.", + "is_required": true + }, + { + "name": "value", + "type": "string", + "description": "The value to assign to the name encoded in hexadecimal.", + "is_required": true + }, + { + "name": "amount", + "type": "number", + "description": "The amount in LBRYcrd to use to bid for the name. eg 0.1", + "is_required": true + } + ], + "examples": [], + "returns": "\"transactionid\" (string) The new transaction id." + }, + { + "name": "getbestblockhash", + "namespace": "Blockchain", + "description": "Returns the hash of the best (tip) block in the longest block chain. Result \"hex\" (string) the block hash hex encoded", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getbestblockhash", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getbestblockhash\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "getblock", + "namespace": "Blockchain", + "description": "If verbose is false, returns a string that is serialized, hex-encoded data for block 'hash'. If verbose is true, returns an Object with information about block .", + "arguments": [ + { + "name": "hash", + "type": "string", + "description": "The block hash", + "is_required": true + }, + { + "name": "verbose", + "type": "boolean", + "description": "true for a json object, false for the hex encoded data", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getblock \"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblock\", \"params\": [\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"hash\" : \"hash\", (string) the block hash (same as provided)\n \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n \"size\" : n, (numeric) The block size\n \"height\" : n, (numeric) The block height or index\n \"version\" : n, (numeric) The block version\n \"versionHex\" : \"00000000\", (string) The block version formatted in hexadecimal\n \"merkleroot\" : \"xxxx\", (string) The merkle root\n \"nameclaimroot\" : \"xxxx\", (string) The hash of the root of the name claim trie\n \"tx\" : [ (array of string) The transaction ids\n \"transactionid\" (string) The transaction id\n ,...\n ],\n \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n \"mediantime\" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)\n \"nonce\" : n, (numeric) The nonce\n \"bits\" : \"1d00ffff\", (string) The bits\n \"difficulty\" : x.xxx, (numeric) The difficulty\n \"chainwork\" : \"xxxx\", (string) Expected number of hashes required to produce the chain up to this block (in hex)\n \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n \"nextblockhash\" : \"hash\" (string) The hash of the next block\n}\n\nResult (for verbose=false):\n\"data\" (string) A string that is serialized, hex-encoded data for block 'hash'." + }, + { + "name": "getblockchaininfo", + "namespace": "Blockchain", + "description": "Returns an object containing various state info regarding block chain processing.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getblockchaininfo", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockchaininfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n \"headers\": xxxxxx, (numeric) the current number of headers we have validated\n \"bestblockhash\": \"...\", (string) the hash of the currently best block\n \"difficulty\": xxxxxx, (numeric) the current difficulty\n \"mediantime\": xxxxxx, (numeric) median time for the current best block\n \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n \"pruned\": xx, (boolean) if the blocks are subject to pruning\n \"pruneheight\": xxxxxx, (numeric) heighest block available\n \"softforks\": [ (array) status of softforks in progress\n {\n \"id\": \"xxxx\", (string) name of softfork\n \"version\": xx, (numeric) block version\n \"enforce\": { (object) progress toward enforcing the softfork rules for new-version blocks\n \"status\": xx, (boolean) true if threshold reached\n \"found\": xx, (numeric) number of blocks with the new version found\n \"required\": xx, (numeric) number of blocks required to trigger\n \"window\": xx, (numeric) maximum size of examined window of recent blocks\n },\n \"reject\": { ... } (object) progress toward rejecting pre-softfork blocks (same fields as \"enforce\")\n }, ...\n ],\n \"bip9_softforks\": { (object) status of BIP9 softforks in progress\n \"xxxx\" : { (string) name of the softfork\n \"status\": \"xxxx\", (string) one of \"defined\", \"started\", \"lockedin\", \"active\", \"failed\"\n \"bit\": xx, (numeric) the bit, 0-28, in the block version field used to signal this soft fork\n \"startTime\": xx, (numeric) the minimum median time past of a block at which the bit gains its meaning\n \"timeout\": xx (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in\n }\n }\n}" + }, + { + "name": "getblockcount", + "namespace": "Blockchain", + "description": "Returns the number of blocks in the longest block chain.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getblockcount", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockcount\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "n (numeric) The current block count" + }, + { + "name": "getblockhash", + "namespace": "Blockchain", + "description": "Returns hash of block in best-block-chain at index provided.", + "arguments": [ + { + "name": "index", + "type": "number", + "description": "The block index", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getblockhash 1000", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockhash\", \"params\": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"hash\" (string) The block hash" + }, + { + "name": "getblockheader", + "namespace": "Blockchain", + "description": "If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader .", + "arguments": [ + { + "name": "hash", + "type": "string", + "description": "The block hash", + "is_required": true + }, + { + "name": "verbose", + "type": "boolean", + "description": "true for a json object, false for the hex encoded data", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getblockheader \"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockheader\", \"params\": [\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"hash\" : \"hash\", (string) the block hash (same as provided)\n \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n \"height\" : n, (numeric) The block height or index\n \"version\" : n, (numeric) The block version\n \"versionHex\" : \"00000000\", (string) The block version formatted in hexadecimal\n \"merkleroot\" : \"xxxx\", (string) The merkle root\n \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n \"mediantime\" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)\n \"nonce\" : n, (numeric) The nonce\n \"bits\" : \"1d00ffff\", (string) The bits\n \"difficulty\" : x.xxx, (numeric) The difficulty\n \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n \"nextblockhash\" : \"hash\", (string) The hash of the next block\n \"chainwork\" : \"0000...1f3\" (string) Expected number of hashes required to produce the current chain (in hex)\n}\n\nResult (for verbose=false):\n\"data\" (string) A string that is serialized, hex-encoded data for block 'hash'." + }, + { + "name": "getchaintips", + "namespace": "Blockchain", + "description": "Return information about all known tips in the block tree, including the main chain as well as orphaned branches.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getchaintips", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getchaintips\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[\n {\n \"height\": xxxx, (numeric) height of the chain tip\n \"hash\": \"xxxx\", (string) block hash of the tip\n \"branchlen\": 0 (numeric) zero for main chain\n \"status\": \"active\" (string) \"active\" for the main chain\n },\n {\n \"height\": xxxx,\n \"hash\": \"xxxx\",\n \"branchlen\": 1 (numeric) length of branch connecting the tip to the main chain\n \"status\": \"xxxx\" (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid)\n }\n]\nPossible values for status:\n1. \"invalid\" This branch contains at least one invalid block\n2. \"headers-only\" Not all blocks for this branch are available, but the headers are valid\n3. \"valid-headers\" All blocks are available for this branch, but they were never fully validated\n4. \"valid-fork\" This branch is not part of the active chain, but is fully validated\n5. \"active\" This is the tip of the active main chain, which is certainly valid" + }, + { + "name": "getdifficulty", + "namespace": "Blockchain", + "description": "Returns the proof-of-work difficulty as a multiple of the minimum difficulty.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getdifficulty", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getdifficulty\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty." + }, + { + "name": "getmempoolinfo", + "namespace": "Blockchain", + "description": "Returns details on the active state of the TX memory pool.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getmempoolinfo", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmempoolinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"size\": xxxxx, (numeric) Current tx count\n \"bytes\": xxxxx, (numeric) Sum of all tx sizes\n \"usage\": xxxxx, (numeric) Total memory usage for the mempool\n \"maxmempool\": xxxxx, (numeric) Maximum memory usage for the mempool\n \"mempoolminfee\": xxxxx (numeric) Minimum fee for tx to be accepted\n}" + }, + { + "name": "getrawmempool", + "namespace": "Blockchain", + "description": "Returns all transaction ids in memory pool as a json array of string transaction ids.", + "arguments": [ + { + "name": "verbose", + "type": "boolean", + "description": "true for a json object, false for array of transaction ids", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getrawmempool true", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getrawmempool\", \"params\": [true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[ (json array of string)\n \"transactionid\" (string) The transaction id\n ,...\n]\n\nResult: (for verbose = true):\n{ (json object)\n \"transactionid\" : { (json object)\n \"size\" : n, (numeric) transaction size in bytes\n \"fee\" : n, (numeric) transaction fee in LBC\n \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority\n \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n \"height\" : n, (numeric) block height when transaction entered pool\n \"startingpriority\" : n, (numeric) priority when transaction entered pool\n \"currentpriority\" : n, (numeric) transaction priority now\n \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n \"descendantsize\" : n, (numeric) size of in-mempool descendants (including this one)\n \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one)\n \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n \"transactionid\", (string) parent transaction id\n ... ]\n }, ...\n}" + }, + { + "name": "gettxout", + "namespace": "Blockchain", + "description": "Returns details about an unspent transaction output.", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "The transaction id", + "is_required": true + }, + { + "name": "n", + "type": "number", + "description": "vout number", + "is_required": true + }, + { + "name": "includemempool", + "type": "boolean", + "description": "Whether to include the mem pool", + "is_required": false + } + ], + "examples": [ + { + "title": "Get unspent transactions", + "cli": "> lbrycrd-cli listunspent" + }, + { + "title": "View the details", + "cli": "> lbrycrd-cli gettxout \"txid\" 1" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gettxout\", \"params\": [\"txid\", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"bestblock\" : \"hash\", (string) the block hash\n \"confirmations\" : n, (numeric) The number of confirmations\n \"value\" : x.xxx, (numeric) The transaction value in LBC\n \"scriptPubKey\" : { (json object)\n \"asm\" : \"code\", (string) \n \"hex\" : \"hex\", (string) \n \"reqSigs\" : n, (numeric) Number of required signatures\n \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n \"addresses\" : [ (array of string) array of lbrycrd addresses\n \"lbrycrdaddress\" (string) lbrycrd address\n ,...\n ]\n },\n \"version\" : n, (numeric) The version\n \"coinbase\" : true|false (boolean) Coinbase or not\n}" + }, + { + "name": "gettxoutproof", + "namespace": "Blockchain", + "description": "Returns a hex-encoded proof that \"txid\" was included in a block. NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included in manually (by blockhash). Return the raw transaction data.", + "arguments": [ + { + "name": "txids", + "type": "string", + "description": "A json array of txids to filter [ \"txid\" (string) A transaction hash ,... ]", + "is_required": true + }, + { + "name": "block hash", + "type": "string", + "description": "If specified, looks for txid in the block with this hash", + "is_required": false + } + ], + "examples": [], + "returns": "\"data\" (string) A string that is a serialized, hex-encoded data for the proof." + }, + { + "name": "gettxoutsetinfo", + "namespace": "Blockchain", + "description": "Returns statistics about the unspent transaction output set. Note this call may take some time.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli gettxoutsetinfo", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gettxoutsetinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"height\":n, (numeric) The current block height (index)\n \"bestblock\": \"hex\", (string) the best block hash hex\n \"transactions\": n, (numeric) The number of transactions\n \"txouts\": n, (numeric) The number of output transactions\n \"bytes_serialized\": n, (numeric) The serialized size\n \"hash_serialized\": \"hash\", (string) The serialized hash\n \"total_amount\": x.xxx (numeric) The total amount\n}" + }, + { + "name": "verifychain", + "namespace": "Blockchain", + "description": "Verifies blockchain database.", + "arguments": [ + { + "name": "checklevel", + "type": "number", + "description": "How thorough the block verification is.", + "is_required": false + }, + { + "name": "numblocks", + "type": "number", + "description": "The number of blocks to check.", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli verifychain", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"verifychain\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "true|false (boolean) Verified or not" + }, + { + "name": "verifytxoutproof", + "namespace": "Blockchain", + "description": "Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain", + "arguments": [ + { + "name": "proof", + "type": "string", + "description": "The hex-encoded proof generated by gettxoutproof", + "is_required": true + } + ], + "examples": [], + "returns": "[\"txid\"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof is invalid" + }, + { + "name": "getinfo", + "namespace": "Control", + "description": "Returns an object containing various state info.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getinfo", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"version\": xxxxx, (numeric) the server version\n \"protocolversion\": xxxxx, (numeric) the protocol version\n \"walletversion\": xxxxx, (numeric) the wallet version\n \"balance\": xxxxxxx, (numeric) the total lbrycrd balance of the wallet\n \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n \"timeoffset\": xxxxx, (numeric) the time offset\n \"connections\": xxxxx, (numeric) the number of connections\n \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n \"difficulty\": xxxxxx, (numeric) the current difficulty\n \"testnet\": true|false, (boolean) if the server is using testnet or not\n \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n \"paytxfee\": x.xxxx, (numeric) the transaction fee set in LBC/kB\n \"relayfee\": x.xxxx, (numeric) minimum relay fee for non-free transactions in LBC/kB\n \"errors\": \"...\" (string) any error messages\n}" + }, + { + "name": "help", + "namespace": "Control", + "description": "List all commands, or get help for a specified command.", + "arguments": [ + { + "name": "command", + "type": "string", + "description": "The command to get help on", + "is_required": false + } + ], + "examples": [], + "returns": "\"text\" (string) The help text" + }, + { + "name": "stop", + "namespace": "Control", + "description": "Stop LBRYcrd server.", + "arguments": [], + "examples": [] + }, + { + "name": "generate", + "namespace": "Generating", + "description": "Mine up to numblocks blocks immediately (before the RPC call returns)", + "arguments": [ + { + "name": "numblocks", + "type": "number", + "description": "How many blocks are generated immediately.", + "is_required": true + }, + { + "name": "maxtries", + "type": "number", + "description": "How many iterations to try (default = 1000000). Result [ blockhashes ] (array) hashes of blocks generated", + "is_required": false + } + ], + "examples": [ + { + "title": "Generate 11 blocks", + "cli": "> lbrycrd-cli generate 11" + } + ] + }, + { + "name": "generatetoaddress", + "namespace": "Generating", + "description": "Mine blocks immediately to a specified address (before the RPC call returns)", + "arguments": [ + { + "name": "numblocks", + "type": "number", + "description": "How many blocks are generated immediately.", + "is_required": true + }, + { + "name": "address", + "type": "string", + "description": "The address to send the newly generated bitcoin to.", + "is_required": true + }, + { + "name": "maxtries", + "type": "number", + "description": "How many iterations to try (default = 1000000). Result [ blockhashes ] (array) hashes of blocks generated", + "is_required": false + } + ], + "examples": [ + { + "title": "Generate 11 blocks to myaddress", + "cli": "> lbrycrd-cli generatetoaddress 11 \"myaddress\"" + } + ] + }, + { + "name": "getblocktemplate", + "namespace": "Mining", + "description": "If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'. It returns data needed to construct a block to work on. See https://en.bitcoin.it/wiki/BIP_0022 for full specification.", + "arguments": [ + { + "name": "jsonrequestobject", + "type": "string", + "description": "A json object in the following spec { \"mode\":\"template\" (string, optional) This must be set to \"template\" or omitted \"capabilities\":[ (array, optional) A list of strings \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid' ,... ] }", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getblocktemplate", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblocktemplate\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"version\" : n, (numeric) The block version\n \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n {\n \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n \"hash\" : \"xxxx\", (string) hash/id encoded in little-endian hexadecimal\n \"depends\" : [ (array) array of numbers \n n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n ,...\n ],\n \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in Satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n \"sigops\" : n, (numeric) total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any\n \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n }\n ,...\n ],\n \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n \"flags\" : \"flags\" (string) \n },\n \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in Satoshis)\n \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n \"target\" : \"xxxx\", (string) The hash target\n \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n \"mutable\" : [ (array of string) list of ways the block template may be changed \n \"value\" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n ,...\n ],\n \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n \"sizelimit\" : n, (numeric) limit of block size\n \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n \"bits\" : \"xxx\", (string) compressed target of next block\n \"height\" : n (numeric) The height of the next block\n}" + }, + { + "name": "getgenerate", + "namespace": "Mining", + "description": "Return if the server is set to generate coins or not. The default is false. It is set with the command line argument -gen (or lbrycrd.conf setting gen) It can also be set with the setgenerate call. Result true|false (boolean) If the server is set to generate coins or not", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getgenerate", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getgenerate\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "gethashespersec", + "namespace": "Mining", + "description": "Returns a recent hashes per second performance measurement while generating. See the getgenerate and setgenerate calls to turn generation on and off.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli gethashespersec", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gethashespersec\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "n (numeric) The recent hashes per second when generation is on (will return 0 if generation is off)" + }, + { + "name": "getmininginfo", + "namespace": "Mining", + "description": "Returns a json object containing mining-related information.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getmininginfo", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmininginfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"blocks\": nnn, (numeric) The current block\n \"currentblocksize\": nnn, (numeric) The last block size\n \"currentblocktx\": nnn, (numeric) The last block transaction\n \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n \"errors\": \"...\" (string) Current errors\n \"generate\": true|false (boolean) If the generation is on or off (see getgenerate or setgenerate calls)\n \"genproclimit\": n (numeric) The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls)\n \"hashespersec\": n (numeric) The hashes per second of the generation, or 0 if no generation.\n \"pooledtx\": n (numeric) The size of the mem pool\n \"testnet\": true|false (boolean) If using testnet or not\n \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n}" + }, + { + "name": "getnetworkhashps", + "namespace": "Mining", + "description": "Returns the estimated network hashes per second based on the last n blocks. Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change. Pass in [height] to estimate the network speed at the time when a certain block was found.", + "arguments": [ + { + "name": "blocks", + "type": "number", + "description": "The number of blocks, or -1 for blocks since last difficulty change.", + "is_required": false + }, + { + "name": "height", + "type": "number", + "description": "To estimate at the time of the given height.", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getnetworkhashps", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnetworkhashps\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "x (numeric) Hashes per second estimated" + }, + { + "name": "prioritisetransaction", + "namespace": "Mining", + "description": "Accepts the transaction into mined blocks at a higher (or lower) priority", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "The transaction id.", + "is_required": true + }, + { + "name": "priority delta", + "type": "number", + "description": "The priority to add or subtract. The transaction selection algorithm considers the tx as it would have a higher priority. (priority of a transaction is calculated: coinage * value_in_satoshis / txsize)", + "is_required": true + }, + { + "name": "fee delta", + "type": "number", + "description": "The fee value (in satoshis) to add (or subtract, if negative). The fee is not actually paid, only the algorithm for selecting transactions into a block considers the transaction as it would have paid a higher (or lower) fee. Result true (boolean) Returns true", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli prioritisetransaction \"txid\" 0.0 10000", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"prioritisetransaction\", \"params\": [\"txid\", 0.0, 10000] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "setgenerate", + "namespace": "Mining", + "description": "Set 'generate' true or false to turn generation on or off. Generation is limited to 'genproclimit' processors, -1 is unlimited. See the getgenerate call for the current setting.", + "arguments": [ + { + "name": "generate", + "type": "boolean", + "description": "Set to true to turn on generation, off to turn off.", + "is_required": true + }, + { + "name": "genproclimit", + "type": "number", + "description": "Set the processor limit for when generation is on. Can be -1 for unlimited.", + "is_required": false + } + ], + "examples": [ + { + "title": "Set the generation on with a limit of one processor", + "cli": "> lbrycrd-cli setgenerate true 1" + }, + { + "title": "Check the setting", + "cli": "> lbrycrd-cli getgenerate" + }, + { + "title": "Turn off generation", + "cli": "> lbrycrd-cli setgenerate false" + }, + { + "title": "Using json rpc", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"setgenerate\", \"params\": [true, 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "submitblock", + "namespace": "Mining", + "description": "Attempts to submit new block to network. The 'jsonparametersobject' parameter is currently ignored. See https://en.bitcoin.it/wiki/BIP_0022 for full specification.", + "arguments": [ + { + "name": "hexdata", + "type": "string", + "description": "the hex-encoded block data to submit", + "is_required": true + }, + { + "name": "jsonparametersobject", + "type": "string", + "description": "object of optional parameters { \"workid\" : \"id\" (string, optional) if the server provided a workid, it MUST be included with submissions }", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli submitblock \"mydata\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"submitblock\", \"params\": [\"mydata\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "" + }, + { + "name": "addnode", + "namespace": "Network", + "description": "Attempts add or remove a node from the addnode list. Or try a connection to a node once.", + "arguments": [ + { + "name": "node", + "type": "string", + "description": "The node (see getpeerinfo for nodes)", + "is_required": true + }, + { + "name": "command", + "type": "string", + "description": "'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli addnode \"192.168.0.6:8333\" \"onetry\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"addnode\", \"params\": [\"192.168.0.6:8333\", \"onetry\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "clearbanned", + "namespace": "Network", + "description": "Clear all banned IPs.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli clearbanned", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"clearbanned\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "disconnectnode", + "namespace": "Network", + "description": "Immediately disconnects from the specified node.", + "arguments": [ + { + "name": "node", + "type": "string", + "description": "The node (see getpeerinfo for nodes)", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli disconnectnode \"192.168.0.6:8333\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"disconnectnode\", \"params\": [\"192.168.0.6:8333\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "getaddednodeinfo", + "namespace": "Network", + "description": "Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here) If dns is false, only a list of added nodes will be provided, otherwise connected information will also be available.", + "arguments": [ + { + "name": "dns", + "type": "boolean", + "description": "If false, only a list of added nodes will be provided, otherwise connected information will also be available.", + "is_required": true + }, + { + "name": "node", + "type": "string", + "description": "If provided, return information about this specific node, otherwise all nodes are returned.", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getaddednodeinfo true \"192.168.0.201\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaddednodeinfo\", \"params\": [true, \"192.168.0.201\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[\n {\n \"addednode\" : \"192.168.0.201\", (string) The node ip address\n \"connected\" : true|false, (boolean) If connected\n \"addresses\" : [\n {\n \"address\" : \"192.168.0.201:8333\", (string) The lbrycrd server host and port\n \"connected\" : \"outbound\" (string) connection, inbound or outbound\n }\n ,...\n ]\n }\n ,...\n]" + }, + { + "name": "getconnectioncount", + "namespace": "Network", + "description": "Returns the number of connections to other nodes.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getconnectioncount", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getconnectioncount\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "n (numeric) The connection count" + }, + { + "name": "getnettotals", + "namespace": "Network", + "description": "Returns information about network traffic, including bytes in, bytes out, and current time.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getnettotals", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnettotals\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"totalbytesrecv\": n, (numeric) Total bytes received\n \"totalbytessent\": n, (numeric) Total bytes sent\n \"timemillis\": t, (numeric) Total cpu time\n \"uploadtarget\":\n {\n \"timeframe\": n, (numeric) Length of the measuring timeframe in seconds\n \"target\": n, (numeric) Target in bytes\n \"target_reached\": true|false, (boolean) True if target is reached\n \"serve_historical_blocks\": true|false, (boolean) True if serving historical blocks\n \"bytes_left_in_cycle\": t, (numeric) Bytes left in current time cycle\n \"time_left_in_cycle\": t (numeric) Seconds left in current time cycle\n }\n}" + }, + { + "name": "getnetworkinfo", + "namespace": "Network", + "description": "Returns an object containing various state info regarding P2P networking.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getnetworkinfo", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnetworkinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"version\": xxxxx, (numeric) the server version\n \"subversion\": \"/Satoshi:x.x.x/\", (string) the server subversion string\n \"protocolversion\": xxxxx, (numeric) the protocol version\n \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n \"timeoffset\": xxxxx, (numeric) the time offset\n \"connections\": xxxxx, (numeric) the number of connections\n \"networks\": [ (array) information per network\n {\n \"name\": \"xxx\", (string) network (ipv4, ipv6 or onion)\n \"limited\": true|false, (boolean) is the network limited using -onlynet?\n \"reachable\": true|false, (boolean) is the network reachable?\n \"proxy\": \"host:port\" (string) the proxy that is used for this network, or empty if none\n }\n ,...\n ],\n \"relayfee\": x.xxxxxxxx, (numeric) minimum relay fee for non-free transactions in LBC/kB\n \"localaddresses\": [ (array) list of local addresses\n {\n \"address\": \"xxxx\", (string) network address\n \"port\": xxx, (numeric) network port\n \"score\": xxx (numeric) relative score\n }\n ,...\n ]\n \"warnings\": \"...\" (string) any network warnings (such as alert messages) \n}" + }, + { + "name": "getpeerinfo", + "namespace": "Network", + "description": "Returns data about each connected network node as a json array of objects.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getpeerinfo", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getpeerinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[\n {\n \"id\": n, (numeric) Peer index\n \"addr\":\"host:port\", (string) The ip address and port of the peer\n \"addrlocal\":\"ip:port\", (string) local address\n \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n \"relaytxes\":true|false, (boolean) Whether peer has asked us to relay transactions to it\n \"lastsend\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n \"lastrecv\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n \"bytessent\": n, (numeric) The total bytes sent\n \"bytesrecv\": n, (numeric) The total bytes received\n \"conntime\": ttt, (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)\n \"timeoffset\": ttt, (numeric) The time offset in seconds\n \"pingtime\": n, (numeric) ping time (if available)\n \"minping\": n, (numeric) minimum observed ping time (if any at all)\n \"pingwait\": n, (numeric) ping wait (if non-zero)\n \"version\": v, (numeric) The peer version, such as 7001\n \"subver\": \"/Satoshi:0.8.5/\", (string) The string version\n \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n \"startingheight\": n, (numeric) The starting height (block) of the peer\n \"banscore\": n, (numeric) The ban score\n \"synced_headers\": n, (numeric) The last header we have in common with this peer\n \"synced_blocks\": n, (numeric) The last block we have in common with this peer\n \"inflight\": [\n n, (numeric) The heights of blocks we're currently asking from this peer\n ...\n ]\n \"bytessent_per_msg\": {\n \"addr\": n, (numeric) The total bytes sent aggregated by message type\n ...\n }\n \"bytesrecv_per_msg\": {\n \"addr\": n, (numeric) The total bytes received aggregated by message type\n ...\n }\n }\n ,...\n]" + }, + { + "name": "listbanned", + "namespace": "Network", + "description": "List all banned IPs/Subnets.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli listbanned", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listbanned\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "ping", + "namespace": "Network", + "description": "Requests that a ping be sent to all other nodes, to measure ping time. Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli ping", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"ping\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "setban", + "namespace": "Network", + "description": "Attempts add or remove a IP/Subnet from the banned list.", + "arguments": [ + { + "name": "ip(/netmask)", + "type": "string", + "description": "The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)", + "is_required": true + }, + { + "name": "command", + "type": "string", + "description": "'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list", + "is_required": true + }, + { + "name": "bantime", + "type": "number", + "description": "time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)", + "is_required": false + }, + { + "name": "absolute", + "type": "boolean", + "description": "If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli setban \"192.168.0.0/24\" \"add\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"setban\", \"params\": [\"192.168.0.6\", \"add\" 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "createrawtransaction", + "namespace": "Rawtransactions", + "description": "Create a transaction spending the given inputs and creating new outputs. Outputs can be addresses or data. Returns hex-encoded raw transaction. Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.", + "arguments": [ + { + "name": "transactions", + "type": "string", + "description": "A json array of json objects [ { \"txid\":\"id\", (string, required) The transaction id \"vout\":n (numeric, required) The output number } ,... ]", + "is_required": true + }, + { + "name": "outputs", + "type": "string", + "description": "a json object with outputs { \"address\": x.xxx (numeric or string, required) The key is the lbrycrd address, the numeric value (can be string) is the LBC amount \"data\": \"hex\", (string, required) The key is \"data\", the value is hex encoded data ... }", + "is_required": true + }, + { + "name": "locktime", + "type": "number", + "description": "Raw locktime. Non-0 value also locktime-activates inputs", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli createrawtransaction \"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"data\\\":\\\"00010203\\\"}\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createrawtransaction\", \"params\": [\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"data\\\":\\\"00010203\\\"}\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"transaction\" (string) hex string of the transaction" + }, + { + "name": "decoderawtransaction", + "namespace": "Rawtransactions", + "description": "Return a JSON object representing the serialized, hex-encoded transaction.", + "arguments": [ + { + "name": "hex", + "type": "string", + "description": "The transaction hex string", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli decoderawtransaction \"hexstring\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"decoderawtransaction\", \"params\": [\"hexstring\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"txid\" : \"id\", (string) The transaction id\n \"size\" : n, (numeric) The transaction size\n \"version\" : n, (numeric) The version\n \"locktime\" : ttt, (numeric) The lock time\n \"vin\" : [ (array of json objects)\n {\n \"txid\": \"id\", (string) The transaction id\n \"vout\": n, (numeric) The output number\n \"scriptSig\": { (json object) The script\n \"asm\": \"asm\", (string) asm\n \"hex\": \"hex\" (string) hex\n },\n \"sequence\": n (numeric) The script sequence number\n }\n ,...\n ],\n \"vout\" : [ (array of json objects)\n {\n \"value\" : x.xxx, (numeric) The value in LBC\n \"n\" : n, (numeric) index\n \"scriptPubKey\" : { (json object)\n \"asm\" : \"asm\", (string) the asm\n \"hex\" : \"hex\", (string) the hex\n \"reqSigs\" : n, (numeric) The required sigs\n \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n \"addresses\" : [ (json array of string)\n \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) lbrycrd address\n ,...\n ]\n }\n }\n ,...\n ],\n}" + }, + { + "name": "decodescript", + "namespace": "Rawtransactions", + "description": "Decode a hex-encoded script.", + "arguments": [ + { + "name": "hex", + "type": "string", + "description": "the hex encoded script", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli decodescript \"hexstring\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"decodescript\", \"params\": [\"hexstring\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"asm\":\"asm\", (string) Script public key\n \"hex\":\"hex\", (string) hex encoded public key\n \"type\":\"type\", (string) The output type\n \"reqSigs\": n, (numeric) The required signatures\n \"addresses\": [ (json array of string)\n \"address\" (string) lbrycrd address\n ,...\n ],\n \"p2sh\",\"address\" (string) script address\n}" + }, + { + "name": "fundrawtransaction", + "namespace": "Rawtransactions", + "description": "Add inputs to a transaction until it has enough in value to meet its out value. This will not modify existing inputs, and will add one change output to the outputs. Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransaction for that. Note that all existing inputs must have their previous output transaction be in the wallet. Note that all inputs selected must be of standard form and P2SH scripts must be in the wallet using importaddress or addmultisigaddress (to calculate fees). Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only", + "arguments": [ + { + "name": "hexstring", + "type": "string", + "description": "The hex string of the raw transaction", + "is_required": true + }, + { + "name": "options", + "type": "object", + "description": "{ \"changeAddress\" (string, optional, default pool address) The bitcoin address to receive the change \"changePosition\" (numeric, optional, default random) The index of the change output \"includeWatching\" (boolean, optional, default false) Also select inputs which are watch only \"lockUnspents\" (boolean, optional, default false) Lock selected unspent outputs } for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}", + "is_required": false + } + ], + "examples": [ + { + "title": "Create a transaction with no inputs", + "cli": "> lbrycrd-cli createrawtransaction \"[]\" \"{\\\"myaddress\\\":0.01}\"" + }, + { + "title": "Add sufficient unsigned inputs to meet the output value", + "cli": "> lbrycrd-cli fundrawtransaction \"rawtransactionhex\"" + }, + { + "title": "Sign the transaction", + "cli": "> lbrycrd-cli signrawtransaction \"fundedtransactionhex\"" + }, + { + "title": "Send the transaction", + "cli": "> lbrycrd-cli sendrawtransaction \"signedtransactionhex\"" + } + ], + "returns": "{\n \"hex\": \"value\", (string) The resulting raw transaction (hex-encoded string)\n \"fee\": n, (numeric) Fee the resulting transaction pays\n \"changepos\": n (numeric) The position of the added change output, or -1\n}\n\"hex\"" + }, + { + "name": "getrawtransaction", + "namespace": "Rawtransactions", + "description": "NOTE: By default this function only works sometimes. This is when the tx is in the mempool or there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option. Return the raw transaction data. If verbose=0, returns a string that is serialized, hex-encoded data for 'txid'. If verbose is non-zero, returns an Object with information about 'txid'.", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "The transaction id", + "is_required": true + }, + { + "name": "verbose", + "type": "number", + "description": "If 0, return a string, other return a json object", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getrawtransaction \"mytxid\" 1", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getrawtransaction\", \"params\": [\"mytxid\", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"data\" (string) The serialized, hex-encoded data for 'txid'\n\nResult (if verbose > 0):\n{\n \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n \"txid\" : \"id\", (string) The transaction id (same as provided)\n \"size\" : n, (numeric) The transaction size\n \"version\" : n, (numeric) The version\n \"locktime\" : ttt, (numeric) The lock time\n \"vin\" : [ (array of json objects)\n {\n \"txid\": \"id\", (string) The transaction id\n \"vout\": n, (numeric) \n \"scriptSig\": { (json object) The script\n \"asm\": \"asm\", (string) asm\n \"hex\": \"hex\" (string) hex\n },\n \"sequence\": n (numeric) The script sequence number\n }\n ,...\n ],\n \"vout\" : [ (array of json objects)\n {\n \"value\" : x.xxx, (numeric) The value in LBC\n \"n\" : n, (numeric) index\n \"scriptPubKey\" : { (json object)\n \"asm\" : \"asm\", (string) the asm\n \"hex\" : \"hex\", (string) the hex\n \"reqSigs\" : n, (numeric) The required sigs\n \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n \"addresses\" : [ (json array of string)\n \"lbrycrdaddress\" (string) lbrycrd address\n ,...\n ]\n }\n }\n ,...\n ],\n \"blockhash\" : \"hash\", (string) the block hash\n \"confirmations\" : n, (numeric) The confirmations\n \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n}" + }, + { + "name": "sendrawtransaction", + "namespace": "Rawtransactions", + "description": "Submits raw transaction (serialized, hex-encoded) to local node and network. Also see createrawtransaction and signrawtransaction calls.", + "arguments": [ + { + "name": "hexstring", + "type": "string", + "description": "The hex string of the raw transaction)", + "is_required": true + }, + { + "name": "allowhighfees", + "type": "boolean", + "description": "Allow high fees", + "is_required": false + } + ], + "examples": [ + { + "title": "Create a transaction", + "cli": "> lbrycrd-cli createrawtransaction \"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"" + }, + { + "title": "Sign the transaction, and get back the hex", + "cli": "> lbrycrd-cli signrawtransaction \"myhex\"" + }, + { + "title": "Send the transaction (signed hex)", + "cli": "> lbrycrd-cli sendrawtransaction \"signedhex\"" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendrawtransaction\", \"params\": [\"signedhex\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"hex\" (string) The transaction hash in hex" + }, + { + "name": "signrawtransaction", + "namespace": "Rawtransactions", + "description": "Sign inputs for raw transaction (serialized, hex-encoded). The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain. The third optional argument (may be null) is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction.", + "arguments": [ + { + "name": "hexstring", + "type": "string", + "description": "The transaction hex string", + "is_required": true + }, + { + "name": "prevtxs", + "type": "string", + "description": "An json array of previous dependent transaction outputs [ (json array of json objects, or 'null' if none provided) { \"txid\":\"id\", (string, required) The transaction id \"vout\":n, (numeric, required) The output number \"scriptPubKey\": \"hex\", (string, required) script key \"redeemScript\": \"hex\" (string, required for P2SH) redeem script } ,... ]", + "is_required": false + }, + { + "name": "privatekeys", + "type": "string", + "description": "A json array of base58-encoded private keys for signing [ (json array of strings, or 'null' if none provided) \"privatekey\" (string) private key in base58-encoding ,... ]", + "is_required": false + }, + { + "name": "sighashtype", + "type": "string", + "description": "The signature hash type. Must be one of \"ALL\" \"NONE\" \"SINGLE\" \"ALL|ANYONECANPAY\" \"NONE|ANYONECANPAY\" \"SINGLE|ANYONECANPAY\"", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli signrawtransaction \"myhex\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"signrawtransaction\", \"params\": [\"myhex\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"hex\" : \"value\", (string) The hex-encoded raw transaction with signature(s)\n \"complete\" : true|false, (boolean) If the transaction has a complete set of signatures\n \"errors\" : [ (json array of objects) Script verification errors (if there are any)\n {\n \"txid\" : \"hash\", (string) The hash of the referenced, previous transaction\n \"vout\" : n, (numeric) The index of the output to spent and used as input\n \"scriptSig\" : \"hex\", (string) The hex-encoded signature script\n \"sequence\" : n, (numeric) Script sequence number\n \"error\" : \"text\" (string) Verification or signing error related to the input\n }\n ,...\n ]\n}" + }, + { + "name": "createmultisig", + "namespace": "Util", + "description": "Creates a multi-signature address with n signature of m keys required. It returns a json object with the address and redeemScript.", + "arguments": [ + { + "name": "nrequired", + "type": "number", + "description": "The number of required signatures out of the n keys or addresses.", + "is_required": true + }, + { + "name": "keys", + "type": "string", + "description": "A json array of keys which are lbrycrd addresses or hex-encoded public keys [ \"key\" (string) lbrycrd address or hex-encoded public key ,... ]", + "is_required": true + } + ], + "examples": [ + { + "title": "Create a multisig address from 2 addresses", + "cli": "> lbrycrd-cli createmultisig 2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createmultisig\", \"params\": [2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n}" + }, + { + "name": "estimatefee", + "namespace": "Util", + "description": "Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks.", + "arguments": [ + { + "name": "nblocks", + "type": "number", + "description": [], + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli estimatefee 6" + } + ], + "returns": "n (numeric) estimated fee-per-kilobyte\n\nA negative value is returned if not enough transactions and blocks\nhave been observed to make an estimate." + }, + { + "name": "estimatepriority", + "namespace": "Util", + "description": "Estimates the approximate priority a zero-fee transaction needs to begin confirmation within nblocks blocks.", + "arguments": [ + { + "name": "nblocks", + "type": "number", + "description": [], + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli estimatepriority 6" + } + ], + "returns": "n (numeric) estimated priority\n\nA negative value is returned if not enough transactions and blocks\nhave been observed to make an estimate." + }, + { + "name": "estimatesmartfee", + "namespace": "Util", + "description": "WARNING: This interface is unstable and may disappear or change! Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks if possible and return the number of blocks for which the estimate is valid.", + "arguments": [ + { + "name": "nblocks", + "type": "number", + "description": [], + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli estimatesmartfee 6" + } + ], + "returns": "{\n \"feerate\" : x.x, (numeric) estimate fee-per-kilobyte (in BTC)\n \"blocks\" : n (numeric) block number where estimate was found\n}\n\nA negative value is returned if not enough transactions and blocks\nhave been observed to make an estimate for any number of blocks.\nHowever it will not return a value below the mempool reject fee." + }, + { + "name": "estimatesmartpriority", + "namespace": "Util", + "description": "WARNING: This interface is unstable and may disappear or change! Estimates the approximate priority a zero-fee transaction needs to begin confirmation within nblocks blocks if possible and return the number of blocks for which the estimate is valid.", + "arguments": [ + { + "name": "nblocks", + "type": "number", + "description": [], + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli estimatesmartpriority 6" + } + ], + "returns": "{\n \"priority\" : x.x, (numeric) estimated priority\n \"blocks\" : n (numeric) block number where estimate was found\n}\n\nA negative value is returned if not enough transactions and blocks\nhave been observed to make an estimate for any number of blocks.\nHowever if the mempool reject fee is set it will return 1e9 * MAX_MONEY." + }, + { + "name": "validateaddress", + "namespace": "Util", + "description": "Return information about the given lbrycrd address.", + "arguments": [ + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address to validate", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli validateaddress \"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"validateaddress\", \"params\": [\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n \"address\" : \"lbrycrdaddress\", (string) The lbrycrd address validated\n \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n \"ismine\" : true|false, (boolean) If the address is yours or not\n \"iswatchonly\" : true|false, (boolean) If the address is watchonly\n \"isscript\" : true|false, (boolean) If the key is a script\n \"pubkey\" : \"publickeyhex\", (string) The hex value of the raw public key\n \"iscompressed\" : true|false, (boolean) If the address is compressed\n \"account\" : \"account\" (string) DEPRECATED. The account associated with the address, \"\" is the default account\n}" + }, + { + "name": "verifymessage", + "namespace": "Util", + "description": "Verify a signed message", + "arguments": [ + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address to use for the signature.", + "is_required": true + }, + { + "name": "signature", + "type": "string", + "description": "The signature provided by the signer in base 64 encoding (see signmessage).", + "is_required": true + }, + { + "name": "message", + "type": "string", + "description": "The message that was signed.", + "is_required": true + } + ], + "examples": [ + { + "title": "Unlock the wallet for 30 seconds", + "cli": "> lbrycrd-cli walletpassphrase \"mypassphrase\" 30" + }, + { + "title": "Create the signature", + "cli": "> lbrycrd-cli signmessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"my message\"" + }, + { + "title": "Verify the signature", + "cli": "> lbrycrd-cli verifymessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"signature\" \"my message\"" + }, + { + "title": "As json rpc", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"verifymessage\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"signature\", \"my message\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "true|false (boolean) If the signature is verified or not." + }, + { + "name": "abandontransaction", + "namespace": "Wallet", + "description": "Mark in-wallet transaction as abandoned This will mark this transaction and all its in-wallet descendants as abandoned which will allow for their inputs to be respent. It can be used to replace \"stuck\" or evicted transactions. It only works on transactions which are not included in a block and are not currently in the mempool. It has no effect on transactions which are already conflicted or abandoned.", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "The transaction id", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli abandontransaction \"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"abandontransaction\", \"params\": [\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "" + }, + { + "name": "addmultisigaddress", + "namespace": "Wallet", + "description": "Add a nrequired-to-sign multisignature address to the wallet. Each key is a Bitcoin address or hex-encoded public key. If 'account' is specified (DEPRECATED), assign address to that account.", + "arguments": [ + { + "name": "nrequired", + "type": "number", + "description": "The number of required signatures out of the n keys or addresses.", + "is_required": true + }, + { + "name": "keysobject", + "type": "string", + "description": "A json array of lbrycrd addresses or hex-encoded public keys [ \"address\" (string) lbrycrd address or hex-encoded public key ..., ]", + "is_required": true + }, + { + "name": "account", + "type": "string", + "description": "DEPRECATED. An account to assign the addresses to.", + "is_required": false + } + ], + "examples": [ + { + "title": "Add a multisig address from 2 addresses", + "cli": "> lbrycrd-cli addmultisigaddress 2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"" + }, + { + "title": "As json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"addmultisigaddress\", \"params\": [2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"lbrycrdaddress\" (string) A lbrycrd address associated with the keys." + }, + { + "name": "backupwallet", + "namespace": "Wallet", + "description": "Safely copies current wallet file to destination, which can be a directory or a path with filename.", + "arguments": [ + { + "name": "destination", + "type": "string", + "description": "The destination directory or file", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli backupwallet \"backup.dat\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"backupwallet\", \"params\": [\"backup.dat\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "dumpprivkey", + "namespace": "Wallet", + "description": "Reveals the private key corresponding to 'lbrycrdaddress'. Then the importprivkey can be used with this output", + "arguments": [ + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address for the private key", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli importprivkey \"mykey\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"dumpprivkey\", \"params\": [\"myaddress\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"key\" (string) The private key" + }, + { + "name": "dumpwallet", + "namespace": "Wallet", + "description": "Dumps all wallet keys in a human-readable format.", + "arguments": [ + { + "name": "filename", + "type": "string", + "description": "The filename", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli dumpwallet \"test\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"dumpwallet\", \"params\": [\"test\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "encryptwallet", + "namespace": "Wallet", + "description": "Encrypts the wallet with 'passphrase'. This is for first time encryption. After this, any calls that interact with private keys such as sending or signing will require the passphrase to be set prior the making these calls. Use the walletpassphrase call for this, and then walletlock call. If the wallet is already encrypted, use the walletpassphrasechange call. Note that this will shutdown the server.", + "arguments": [ + { + "name": "passphrase", + "type": "string", + "description": "The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.", + "is_required": true + } + ], + "examples": [ + { + "title": "Encrypt you wallet", + "cli": "> lbrycrd-cli encryptwallet \"my pass phrase\"" + }, + { + "title": "Now set the passphrase to use the wallet, such as for signing or sending LBC", + "cli": "> lbrycrd-cli walletpassphrase \"my pass phrase\"" + }, + { + "title": "Now we can so something like sign", + "cli": "> lbrycrd-cli signmessage \"lbrycrdaddress\" \"test message\"" + }, + { + "title": "Now lock the wallet again by removing the passphrase", + "cli": "> lbrycrd-cli walletlock" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"encryptwallet\", \"params\": [\"my pass phrase\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "getaccount", + "namespace": "Wallet", + "description": "DEPRECATED. Returns the account associated with the given address.", + "arguments": [ + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address for account lookup.", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getaccount \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaccount\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"accountname\" (string) the account address" + }, + { + "name": "getaccountaddress", + "namespace": "Wallet", + "description": "DEPRECATED. Returns the current Bitcoin address for receiving payments to this account.", + "arguments": [ + { + "name": "account", + "type": "string", + "description": "The account name for the address. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name.", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getaccountaddress \"myaccount\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaccountaddress\", \"params\": [\"myaccount\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"lbrycrdaddress\" (string) The account lbrycrd address" + }, + { + "name": "getaddressesbyaccount", + "namespace": "Wallet", + "description": "DEPRECATED. Returns the list of addresses for the given account.", + "arguments": [ + { + "name": "account", + "type": "string", + "description": "The account name.", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getaddressesbyaccount \"tabby\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaddressesbyaccount\", \"params\": [\"tabby\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[ (json array of string)\n \"lbrycrdaddress\" (string) a lbrycrd address associated with the given account\n ,...\n]" + }, + { + "name": "getbalance", + "namespace": "Wallet", + "description": "If account is not specified, returns the server's total available balance. If account is specified (DEPRECATED), returns the balance in the account. Note that the account \"\" is not the same as leaving the parameter out. The server total may be different to the balance in the default \"\" account.", + "arguments": [ + { + "name": "account", + "type": "string", + "description": "DEPRECATED. The selected account, or \"*\" for entire wallet. It may be the default account using \"\".", + "is_required": false + }, + { + "name": "minconf", + "type": "number", + "description": "Only include transactions confirmed at least this many times.", + "is_required": false + }, + { + "name": "includeWatchonly", + "type": "boolean", + "description": "Also include balance in watchonly addresses (see 'importaddress')", + "is_required": false + } + ], + "examples": [ + { + "title": "The total amount in the wallet", + "cli": "> lbrycrd-cli getbalance" + }, + { + "title": "The total amount in the wallet at least 5 blocks confirmed", + "cli": "> lbrycrd-cli getbalance \"*\" 6" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getbalance\", \"params\": [\"*\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "amount (numeric) The total amount in LBC received for this account." + }, + { + "name": "getnewaddress", + "namespace": "Wallet", + "description": "Returns a new Bitcoin address for receiving payments. If 'account' is specified (DEPRECATED), it is added to the address book so payments received with the address will be credited to 'account'.", + "arguments": [ + { + "name": "account", + "type": "string", + "description": "DEPRECATED. The account name for the address to be linked to. If not provided, the default account \"\" is used. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli getnewaddress", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnewaddress\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"lbrycrdaddress\" (string) The new lbrycrd address" + }, + { + "name": "getrawchangeaddress", + "namespace": "Wallet", + "description": "Returns a new Bitcoin address, for receiving change. This is for use with raw transactions, NOT normal use.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getrawchangeaddress", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getrawchangeaddress\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"address\" (string) The address" + }, + { + "name": "getreceivedbyaccount", + "namespace": "Wallet", + "description": "DEPRECATED. Returns the total amount received by addresses with in transactions with at least [minconf] confirmations.", + "arguments": [ + { + "name": "account", + "type": "string", + "description": "The selected account, may be the default account using \"\".", + "is_required": true + }, + { + "name": "minconf", + "type": "number", + "description": "Only include transactions confirmed at least this many times.", + "is_required": false + } + ], + "examples": [ + { + "title": "Amount received by the default account with at least 1 confirmation", + "cli": "> lbrycrd-cli getreceivedbyaccount \"\"" + }, + { + "title": "Amount received at the tabby account including unconfirmed amounts with zero confirmations", + "cli": "> lbrycrd-cli getreceivedbyaccount \"tabby\" 0" + }, + { + "title": "The amount with at least 6 confirmation, very safe", + "cli": "> lbrycrd-cli getreceivedbyaccount \"tabby\" 6" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getreceivedbyaccount\", \"params\": [\"tabby\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "amount (numeric) The total amount in LBC received for this account." + }, + { + "name": "getreceivedbyaddress", + "namespace": "Wallet", + "description": "Returns the total amount received by the given lbrycrdaddress in transactions with at least minconf confirmations.", + "arguments": [ + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address for transactions.", + "is_required": true + }, + { + "name": "minconf", + "type": "number", + "description": "Only include transactions confirmed at least this many times.", + "is_required": false + } + ], + "examples": [ + { + "title": "The amount from transactions with at least 1 confirmation", + "cli": "> lbrycrd-cli getreceivedbyaddress \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"" + }, + { + "title": "The amount including unconfirmed transactions, zero confirmations", + "cli": "> lbrycrd-cli getreceivedbyaddress \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" 0" + }, + { + "title": "The amount with at least 6 confirmation, very safe", + "cli": "> lbrycrd-cli getreceivedbyaddress \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" 6" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getreceivedbyaddress\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "amount (numeric) The total amount in LBC received at this address." + }, + { + "name": "gettransaction", + "namespace": "Wallet", + "description": "Get detailed information about in-wallet transaction ", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "The transaction id", + "is_required": true + }, + { + "name": "includeWatchonly", + "type": "boolean", + "description": "Whether to include watchonly addresses in balance calculation and details[]", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli gettransaction \"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gettransaction\", \"params\": [\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"amount\" : x.xxx, (numeric) The transaction amount in LBC\n \"confirmations\" : n, (numeric) The number of confirmations\n \"blockhash\" : \"hash\", (string) The block hash\n \"blockindex\" : xx, (numeric) The index of the transaction in the block that includes it\n \"blocktime\" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\n \"txid\" : \"transactionid\", (string) The transaction id.\n \"time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n \"timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n \"bip125-replaceable\": \"yes|no|unknown\" (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n may be unknown for unconfirmed transactions not in the mempool\n \"details\" : [\n {\n \"account\" : \"accountname\", (string) DEPRECATED. The account name involved in the transaction, can be \"\" for the default account.\n \"address\" : \"lbrycrdaddress\", (string) The lbrycrd address involved in the transaction\n \"category\" : \"send|receive\", (string) The category, either 'send' or 'receive'\n \"amount\" : x.xxx, (numeric) The amount in LBC\n \"label\" : \"label\", (string) A comment for the address/transaction, if any\n \"vout\" : n, (numeric) the vout value\n }\n ,...\n ],\n \"hex\" : \"data\" (string) Raw data for transaction\n}" + }, + { + "name": "getunconfirmedbalance", + "namespace": "Wallet", + "description": "Returns the server's total unconfirmed balance", + "arguments": [], + "examples": [] + }, + { + "name": "getwalletinfo", + "namespace": "Wallet", + "description": "Returns an object containing various wallet state info.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli getwalletinfo", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getwalletinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"walletversion\": xxxxx, (numeric) the wallet version\n \"balance\": xxxxxxx, (numeric) the total confirmed balance of the wallet in LBC\n \"unconfirmed_balance\": xxx, (numeric) the total unconfirmed balance of the wallet in LBC\n \"immature_balance\": xxxxxx, (numeric) the total immature balance of the wallet in LBC\n \"txcount\": xxxxxxx, (numeric) the total number of transactions in the wallet\n \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n \"paytxfee\": x.xxxx, (numeric) the transaction fee configuration, set in LBC/kB\n}" + }, + { + "name": "importaddress", + "namespace": "Wallet", + "description": "Adds a script (in hex) or address that can be watched as if it were in your wallet but cannot be used to spend.", + "arguments": [ + { + "name": "script", + "type": "string", + "description": "The hex-encoded script (or address)", + "is_required": true + }, + { + "name": "label", + "type": "string", + "description": "An optional label", + "is_required": false + }, + { + "name": "rescan", + "type": "boolean", + "description": "Rescan the wallet for transactions", + "is_required": false + }, + { + "name": "p2sh", + "type": "boolean", + "description": "Add the P2SH version of the script as well Note: This call can take minutes to complete if rescan is true. If you have the full public key, you should call importpubkey instead of this.", + "is_required": false + } + ], + "examples": [ + { + "title": "Import a script with rescan", + "cli": "> lbrycrd-cli importaddress \"myscript\"" + }, + { + "title": "Import using a label without rescan", + "cli": "> lbrycrd-cli importaddress \"myscript\" \"testing\" false" + }, + { + "title": "As a JSON-RPC call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"importaddress\", \"params\": [\"myscript\", \"testing\", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "importprivkey", + "namespace": "Wallet", + "description": "Adds a private key (as returned by dumpprivkey) to your wallet.", + "arguments": [ + { + "name": "lbrycrdprivkey", + "type": "string", + "description": "The private key (see dumpprivkey)", + "is_required": true + }, + { + "name": "label", + "type": "string", + "description": "An optional label", + "is_required": false + }, + { + "name": "rescan", + "type": "boolean", + "description": "Rescan the wallet for transactions Note: This call can take minutes to complete if rescan is true.", + "is_required": false + } + ], + "examples": [ + { + "title": "Dump a private key", + "cli": "> lbrycrd-cli dumpprivkey \"myaddress\"" + }, + { + "title": "Import the private key with rescan", + "cli": "> lbrycrd-cli importprivkey \"mykey\"" + }, + { + "title": "Import using a label and without rescan", + "cli": "> lbrycrd-cli importprivkey \"mykey\" \"testing\" false" + }, + { + "title": "As a JSON-RPC call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"importprivkey\", \"params\": [\"mykey\", \"testing\", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "importprunedfunds", + "namespace": "Wallet", + "description": "Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.", + "arguments": [ + { + "name": "rawtransaction", + "type": "string", + "description": "A raw transaction in hex funding an already-existing address in wallet", + "is_required": true + }, + { + "name": "txoutproof", + "type": "string", + "description": "The hex output from gettxoutproof that contains the transaction", + "is_required": true + }, + { + "name": "label", + "type": "string", + "description": "An optional label", + "is_required": false + } + ], + "examples": [] + }, + { + "name": "importpubkey", + "namespace": "Wallet", + "description": "Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend.", + "arguments": [ + { + "name": "pubkey", + "type": "string", + "description": "The hex-encoded public key", + "is_required": true + }, + { + "name": "label", + "type": "string", + "description": "An optional label", + "is_required": false + }, + { + "name": "rescan", + "type": "boolean", + "description": "Rescan the wallet for transactions Note: This call can take minutes to complete if rescan is true.", + "is_required": false + } + ], + "examples": [ + { + "title": "Import a public key with rescan", + "cli": "> lbrycrd-cli importpubkey \"mypubkey\"" + }, + { + "title": "Import using a label without rescan", + "cli": "> lbrycrd-cli importpubkey \"mypubkey\" \"testing\" false" + }, + { + "title": "As a JSON-RPC call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"importpubkey\", \"params\": [\"mypubkey\", \"testing\", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "importwallet", + "namespace": "Wallet", + "description": "Imports keys from a wallet dump file (see dumpwallet).", + "arguments": [ + { + "name": "filename", + "type": "string", + "description": "The wallet file", + "is_required": true + } + ], + "examples": [ + { + "title": "Dump the wallet", + "cli": "> lbrycrd-cli dumpwallet \"test\"" + }, + { + "title": "Import the wallet", + "cli": "> lbrycrd-cli importwallet \"test\"" + }, + { + "title": "Import using the json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"importwallet\", \"params\": [\"test\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "keypoolrefill", + "namespace": "Wallet", + "description": "Fills the keypool.", + "arguments": [ + { + "name": "newsize", + "type": "number", + "description": "The new keypool size", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli keypoolrefill", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"keypoolrefill\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "listaccounts", + "namespace": "Wallet", + "description": "DEPRECATED. Returns Object that has account names as keys, account balances as values.", + "arguments": [ + { + "name": "minconf", + "type": "number", + "description": "Only include transactions with at least this many confirmations", + "is_required": false + }, + { + "name": "includeWatchonly", + "type": "boolean", + "description": "Include balances in watchonly addresses (see 'importaddress')", + "is_required": false + } + ], + "examples": [ + { + "title": "List account balances where there at least 1 confirmation", + "cli": "> lbrycrd-cli listaccounts" + }, + { + "title": "List account balances including zero confirmation transactions", + "cli": "> lbrycrd-cli listaccounts 0" + }, + { + "title": "List account balances for 6 or more confirmations", + "cli": "> lbrycrd-cli listaccounts 6" + }, + { + "title": "As json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listaccounts\", \"params\": [6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{ (json object where keys are account names, and values are numeric balances\n \"account\": x.xxx, (numeric) The property name is the account name, and the value is the total balance for the account.\n ...\n}" + }, + { + "name": "listaddressgroupings", + "namespace": "Wallet", + "description": "Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli listaddressgroupings", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listaddressgroupings\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[\n [\n [\n \"lbrycrdaddress\", (string) The lbrycrd address\n amount, (numeric) The amount in LBC\n \"account\" (string, optional) The account (DEPRECATED)\n ]\n ,...\n ]\n ,...\n]" + }, + { + "name": "listlockunspent", + "namespace": "Wallet", + "description": "Returns list of temporarily unspendable outputs. See the lockunspent call to lock and unlock transactions for spending.", + "arguments": [], + "examples": [ + { + "title": "List the unspent transactions", + "cli": "> lbrycrd-cli listunspent" + }, + { + "title": "Lock an unspent transaction", + "cli": "> lbrycrd-cli lockunspent false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"" + }, + { + "title": "List the locked transactions", + "cli": "> lbrycrd-cli listlockunspent" + }, + { + "title": "Unlock the transaction again", + "cli": "> lbrycrd-cli lockunspent true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listlockunspent\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[\n {\n \"txid\" : \"transactionid\", (string) The transaction id locked\n \"vout\" : n (numeric) The vout value\n }\n ,...\n]" + }, + { + "name": "listreceivedbyaccount", + "namespace": "Wallet", + "description": "DEPRECATED. List balances by account.", + "arguments": [ + { + "name": "minconf", + "type": "number", + "description": "The minimum number of confirmations before payments are included.", + "is_required": false + }, + { + "name": "includeempty", + "type": "boolean", + "description": "Whether to include accounts that haven't received any payments.", + "is_required": false + }, + { + "name": "includeWatchonly", + "type": "boolean", + "description": "Whether to include watchonly addresses (see 'importaddress').", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli listreceivedbyaccount 6 true", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listreceivedbyaccount\", \"params\": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[\n {\n \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n \"account\" : \"accountname\", (string) The account name of the receiving account\n \"amount\" : x.xxx, (numeric) The total amount received by addresses with this account\n \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n \"label\" : \"label\" (string) A comment for the address/transaction, if any\n }\n ,...\n]" + }, + { + "name": "listreceivedbyaddress", + "namespace": "Wallet", + "description": "List balances by receiving address.", + "arguments": [ + { + "name": "minconf", + "type": "number", + "description": "The minimum number of confirmations before payments are included.", + "is_required": false + }, + { + "name": "includeempty", + "type": "boolean", + "description": "Whether to include addresses that haven't received any payments.", + "is_required": false + }, + { + "name": "includeWatchonly", + "type": "boolean", + "description": "Whether to include watchonly addresses (see 'importaddress').", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli listreceivedbyaddress 6 true", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listreceivedbyaddress\", \"params\": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[\n {\n \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n \"address\" : \"receivingaddress\", (string) The receiving address\n \"account\" : \"accountname\", (string) DEPRECATED. The account of the receiving address. The default account is \"\".\n \"amount\" : x.xxx, (numeric) The total amount in LBC received by the address\n \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n \"label\" : \"label\" (string) A comment for the address/transaction, if any\n }\n ,...\n]" + }, + { + "name": "listsinceblock", + "namespace": "Wallet", + "description": "Get all transactions in blocks since block [blockhash], or all transactions if omitted", + "arguments": [ + { + "name": "blockhash", + "type": "string", + "description": "The block hash to list transactions since", + "is_required": false + }, + { + "name": "target-confirmations:", + "type": "number", + "description": "The confirmations required, must be 1 or more", + "is_required": false + }, + { + "name": "includeWatchonly:", + "type": "boolean", + "description": "Include transactions to watchonly addresses (see 'importaddress')", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli listsinceblock \"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\" 6", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listsinceblock\", \"params\": [\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{\n \"transactions\": [\n \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. Will be \"\" for the default account.\n \"address\":\"lbrycrdaddress\", (string) The lbrycrd address of the transaction. Not present for move transactions (category = move).\n \"category\":\"send|receive\", (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.\n \"amount\": x.xxx, (numeric) The amount in LBC. This is negative for the 'send' category, and for the 'move' category for moves \n outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.\n \"vout\" : n, (numeric) the vout value\n \"fee\": x.xxx, (numeric) The amount of the fee in LBC. This is negative and only available for the 'send' category of transactions.\n \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n \"blockindex\": n, (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive' category of transactions.\n \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n \"time\": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.\n \"comment\": \"...\", (string) If a comment is associated with the transaction.\n \"label\" : \"label\" (string) A comment for the address/transaction, if any\n \"to\": \"...\", (string) If a comment to is associated with the transaction.\n ],\n \"lastblock\": \"lastblockhash\" (string) The hash of the last block\n}" + }, + { + "name": "listtransactions", + "namespace": "Wallet", + "description": "Returns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.", + "arguments": [ + { + "name": "account", + "type": "string", + "description": "DEPRECATED. The account name. Should be \"*\".", + "is_required": false + }, + { + "name": "count", + "type": "number", + "description": "The number of transactions to return", + "is_required": false + }, + { + "name": "from", + "type": "number", + "description": "The number of transactions to skip", + "is_required": false + }, + { + "name": "includeWatchonly", + "type": "boolean", + "description": "Include transactions to watchonly addresses (see 'importaddress')", + "is_required": false + } + ], + "examples": [ + { + "title": "List the most recent 10 transactions in the systems", + "cli": "> lbrycrd-cli listtransactions" + }, + { + "title": "List transactions 100 to 120", + "cli": "> lbrycrd-cli listtransactions \"*\" 20 100" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listtransactions\", \"params\": [\"*\", 20, 100] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "[\n {\n \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. \n It will be \"\" for the default account.\n \"address\":\"lbrycrdaddress\", (string) The lbrycrd address of the transaction. Not present for \n move transactions (category = move).\n \"category\":\"send|receive|move\", (string) The transaction category. 'move' is a local (off blockchain)\n transaction between accounts, and not associated with an address,\n transaction id or block. 'send' and 'receive' transactions are \n associated with an address, transaction id and block details\n \"amount\": x.xxx, (numeric) The amount in LBC. This is negative for the 'send' category, and for the\n 'move' category for moves outbound. It is positive for the 'receive' category,\n and for the 'move' category for inbound funds.\n \"vout\": n, (numeric) the vout value\n \"fee\": x.xxx, (numeric) The amount of the fee in LBC. This is negative and only available for the \n 'send' category of transactions.\n \"abandoned\": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable).\n \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n 'receive' category of transactions. Negative confirmations indicate the\n transaction conflicts with the block chain\n \"trusted\": xxx (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive'\n category of transactions.\n \"blockindex\": n, (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive'\n category of transactions.\n \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \n for 'send' and 'receive' category of transactions.\n \"comment\": \"...\", (string) If a comment is associated with the transaction.\n \"label\": \"label\" (string) A comment for the address/transaction, if any\n \"otheraccount\": \"accountname\", (string) For the 'move' category of transactions, the account the funds came \n from (for receiving funds, positive amounts), or went to (for sending funds,\n negative amounts).\n \"bip125-replaceable\": \"yes|no|unknown\" (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n may be unknown for unconfirmed transactions not in the mempool\n }\n]" + }, + { + "name": "listunspent", + "namespace": "Wallet", + "description": "Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations. Optionally filter to only include txouts paid to specified addresses.", + "arguments": [], + "examples": [ + { + "cli": "> lbrycrd-cli listunspent 6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listunspent\", \"params\": [6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "{txid, vout, scriptPubKey, amount, confirmations}\n\nArguments:\n1. minconf (numeric, optional, default=1) The minimum confirmations to filter\n2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n3. \"addresses\" (string) A json array of lbrycrd addresses to filter\n [\n \"address\" (string) lbrycrd address\n ,...\n ]\n\nResult\n[ (array of json object)\n {\n \"txid\" : \"txid\", (string) the transaction id \n \"vout\" : n, (numeric) the vout value\n \"address\" : \"address\", (string) the lbrycrd address\n \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n \"scriptPubKey\" : \"key\", (string) the script key\n \"amount\" : x.xxx, (numeric) the transaction amount in LBC\n \"confirmations\" : n (numeric) The number of confirmations\n }\n ,...\n]" + }, + { + "name": "lockunspent", + "namespace": "Wallet", + "description": "Updates list of temporarily unspendable outputs. Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs. If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked. A locked transaction output will not be chosen by automatic coin selection, when spending LBC. Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list is always cleared (by virtue of process exit) when a node stops or fails. Also see the listunspent call", + "arguments": [ + { + "name": "unlock", + "type": "boolean", + "description": "Whether to unlock (true) or lock (false) the specified transactions", + "is_required": true + }, + { + "name": "transactions", + "type": "string", + "description": "A json array of objects. Each object the txid (string) vout (numeric) [ (json array of json objects) { \"txid\":\"id\", (string) The transaction id \"vout\": n (numeric) The output number } ,... ]", + "is_required": false + } + ], + "examples": [ + { + "title": "List the unspent transactions", + "cli": "> lbrycrd-cli listunspent" + }, + { + "title": "Lock an unspent transaction", + "cli": "> lbrycrd-cli lockunspent false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"" + }, + { + "title": "List the locked transactions", + "cli": "> lbrycrd-cli listlockunspent" + }, + { + "title": "Unlock the transaction again", + "cli": "> lbrycrd-cli lockunspent true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"lockunspent\", \"params\": [false, \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "true|false (boolean) Whether the command was successful or not" + }, + { + "name": "move", + "namespace": "Wallet", + "description": "DEPRECATED. Move a specified amount from one account in your wallet to another.", + "arguments": [ + { + "name": "fromaccount", + "type": "string", + "description": "The name of the account to move funds from. May be the default account using \"\".", + "is_required": true + }, + { + "name": "toaccount", + "type": "string", + "description": "The name of the account to move funds to. May be the default account using \"\".", + "is_required": true + }, + { + "name": "amount", + "type": "number", + "description": "Quantity of LBC to move between accounts.", + "is_required": true + }, + { + "name": "minconf", + "type": "number", + "description": "Only use funds with at least this many confirmations.", + "is_required": false + }, + { + "name": "comment", + "type": "string", + "description": "An optional comment, stored in the wallet only.", + "is_required": false + } + ], + "examples": [ + { + "title": "Move 0.01 LBC from the default account to the account named tabby", + "cli": "> lbrycrd-cli move \"\" \"tabby\" 0.01" + }, + { + "title": "Move 0.01 LBC timotei to akiko with a comment and funds have 6 confirmations", + "cli": "> lbrycrd-cli move \"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"move\", \"params\": [\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "true|false (boolean) true if successful." + }, + { + "name": "removeprunedfunds", + "namespace": "Wallet", + "description": "Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will effect wallet balances.", + "arguments": [ + { + "name": "txid", + "type": "string", + "description": "The hex-encoded id of the transaction you are deleting", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli removeprunedfunds \"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\"", + "title": "As a JSON-RPC call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"removprunedfunds\", \"params\": [\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "sendfrom", + "namespace": "Wallet", + "description": "DEPRECATED (use sendtoaddress). Sent an amount from an account to a lbrycrd address.", + "arguments": [ + { + "name": "fromaccount", + "type": "string", + "description": "The name of the account to send funds from. May be the default account using \"\".", + "is_required": true + }, + { + "name": "tolbrycrdaddress", + "type": "string", + "description": "The lbrycrd address to send funds to.", + "is_required": true + }, + { + "name": "amount", + "type": "number", + "description": "The amount in LBC (transaction fee is added on top).", + "is_required": true + }, + { + "name": "minconf", + "type": "number", + "description": "Only use funds with at least this many confirmations.", + "is_required": false + }, + { + "name": "comment", + "type": "string", + "description": "A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet.", + "is_required": false + }, + { + "name": "comment-to", + "type": "string", + "description": "An optional comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, it is just kept in your wallet.", + "is_required": false + } + ], + "examples": [ + { + "title": "Send 0.01 LBC from the default account to the address, must have at least 1 confirmation", + "cli": "> lbrycrd-cli sendfrom \"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01" + }, + { + "title": "Send 0.01 from the tabby account to the given address, funds must have at least 6 confirmations", + "cli": "> lbrycrd-cli sendfrom \"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01 6 \"donation\" \"seans outpost\"" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendfrom\", \"params\": [\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.01, 6, \"donation\", \"seans outpost\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"transactionid\" (string) The transaction id." + }, + { + "name": "sendmany", + "namespace": "Wallet", + "description": "Send multiple times. Amounts are double-precision floating point numbers.", + "arguments": [ + { + "name": "fromaccount", + "type": "string", + "description": "DEPRECATED. The account to send the funds from. Should be \"\" for the default account", + "is_required": true + }, + { + "name": "amounts", + "type": "string", + "description": "A json object with addresses and amounts { \"address\":amount (numeric or string) The lbrycrd address is the key, the numeric amount (can be string) in LBC is the value ,... }", + "is_required": true + }, + { + "name": "minconf", + "type": "number", + "description": "Only use the balance confirmed at least this many times.", + "is_required": false + }, + { + "name": "comment", + "type": "string", + "description": "A comment", + "is_required": false + }, + { + "name": "subtractfeefromamount", + "type": "string", + "description": "A json array with addresses. The fee will be equally deducted from the amount of each selected address. Those recipients will receive less LBC than you enter in their corresponding amount field. If no addresses are specified here, the sender pays the fee. [ \"address\" (string) Subtract fee from this address ,... ]", + "is_required": false + } + ], + "examples": [ + { + "title": "Send two amounts to two different addresses:", + "cli": "> lbrycrd-cli sendmany \"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"" + }, + { + "title": "Send two amounts to two different addresses setting the confirmation and comment:", + "cli": "> lbrycrd-cli sendmany \"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 6 \"testing\"" + }, + { + "title": "Send two amounts to two different addresses, subtract fee from amount:", + "cli": "> lbrycrd-cli sendmany \"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 1 \"\" \"[\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\",\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\"]\"" + }, + { + "title": "As a json rpc call", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendmany\", \"params\": [\"\", \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\", 6, \"testing\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"transactionid\" (string) The transaction id for the send. Only 1 transaction is created regardless of \n the number of addresses." + }, + { + "name": "sendtoaddress", + "namespace": "Wallet", + "description": "Send an amount to a given address.", + "arguments": [ + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address to send to.", + "is_required": true + }, + { + "name": "amount", + "type": "number", + "description": "The amount in LBC to send. eg 0.1", + "is_required": true + }, + { + "name": "comment", + "type": "string", + "description": "A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet.", + "is_required": false + }, + { + "name": "comment-to", + "type": "string", + "description": "A comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, just kept in your wallet.", + "is_required": false + }, + { + "name": "subtractfeefromamount", + "type": "boolean", + "description": "The fee will be deducted from the amount being sent. The recipient will receive less LBC than you enter in the amount field.", + "is_required": false + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli sendtoaddress \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendtoaddress\", \"params\": [\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.1, \"donation\", \"seans outpost\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"transactionid\" (string) The transaction id." + }, + { + "name": "setaccount", + "namespace": "Wallet", + "description": "DEPRECATED. Sets the account associated with the given address.", + "arguments": [ + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address to be associated with an account.", + "is_required": true + }, + { + "name": "account", + "type": "string", + "description": "The account to assign the address to.", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli setaccount \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"tabby\"", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"setaccount\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"tabby\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "settxfee", + "namespace": "Wallet", + "description": "Set the transaction fee per kB. Overwrites the paytxfee parameter.", + "arguments": [ + { + "name": "amount", + "type": "number", + "description": "The transaction fee in LBC/kB Result true|false (boolean) Returns true if successful", + "is_required": true + } + ], + "examples": [ + { + "cli": "> lbrycrd-cli settxfee 0.00001", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"settxfee\", \"params\": [0.00001] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ] + }, + { + "name": "signmessage", + "namespace": "Wallet", + "description": "Sign a message with the private key of an address", + "arguments": [ + { + "name": "lbrycrdaddress", + "type": "string", + "description": "The lbrycrd address to use for the private key.", + "is_required": true + }, + { + "name": "message", + "type": "string", + "description": "The message to create a signature of.", + "is_required": true + } + ], + "examples": [ + { + "title": "Unlock the wallet for 30 seconds", + "cli": "> lbrycrd-cli walletpassphrase \"mypassphrase\" 30" + }, + { + "title": "Create the signature", + "cli": "> lbrycrd-cli signmessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"my message\"" + }, + { + "title": "Verify the signature", + "cli": "> lbrycrd-cli verifymessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"signature\" \"my message\"" + }, + { + "title": "As json rpc", + "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"signmessage\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"my message\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" + } + ], + "returns": "\"signature\" (string) The signature of the message encoded in base 64" + } +] diff --git a/contrib/patches/atomic.patch b/contrib/patches/atomic.patch new file mode 100644 index 000000000..398aa1d37 --- /dev/null +++ b/contrib/patches/atomic.patch @@ -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; diff --git a/depends/.gitignore b/depends/.gitignore index 72734102c..1f163897b 100644 --- a/depends/.gitignore +++ b/depends/.gitignore @@ -7,6 +7,3 @@ x86_64* i686* mips* arm* -aarch64* -riscv32* -riscv64* diff --git a/depends/Makefile b/depends/Makefile index 3686aaf1f..cde860b9a 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -1,12 +1,13 @@ .NOTPARALLEL : SOURCES_PATH ?= $(BASEDIR)/sources -WORK_PATH = $(BASEDIR)/work BASE_CACHE ?= $(BASEDIR)/built SDK_PATH ?= $(BASEDIR)/SDKs NO_QT ?= NO_WALLET ?= NO_UPNP ?= +ICU_DIR ?= +ICU_ONLY ?= FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources BUILD = $(shell ./config.guess) @@ -22,6 +23,7 @@ BUILD_ID_SALT ?= salt host:=$(BUILD) ifneq ($(HOST),) host:=$(HOST) +host_toolchain:=$(HOST)- endif ifneq ($(DEBUG),) @@ -30,9 +32,9 @@ else release_type=release endif -base_build_dir=$(WORK_PATH)/build -base_staging_dir=$(WORK_PATH)/staging -base_download_dir=$(WORK_PATH)/download +base_build_dir=$(BASEDIR)/work/build +base_staging_dir=$(BASEDIR)/work/staging +base_download_dir=$(BASEDIR)/work/download canonical_host:=$(shell ./config.sub $(HOST)) build:=$(shell ./config.sub $(BUILD)) @@ -73,7 +75,11 @@ include hosts/$(host_os).mk include hosts/default.mk include builders/$(build_os).mk include builders/default.mk +ifeq ($(ICU_ONLY),) include packages/packages.mk +else +include packages/packages.icu.mk +endif build_id_string:=$(BUILD_ID_SALT) 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_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) upnp_packages_$(NO_UPNP) = $(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) - -ifneq ($(qt_packages_),) -native_packages += $(qt_native_packages) -endif - +$(info $$packages is [${packages}]) +native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) $(qt_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 @@ -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|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \ -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|@ICU_DIR@|$(ICU_DIR)|' \ -e 's|@no_wallet@|$(NO_WALLET)|' \ -e 's|@no_upnp@|$(NO_UPNP)|' \ -e 's|@debug@|$(DEBUG)|' \ @@ -166,23 +169,17 @@ $(host_prefix)/share/config.site: check-packages 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 download-one: check-sources $(all_sources) download-osx: - @$(MAKE) -s HOST=x86_64-apple-darwin14 download-one + @$(MAKE) -s HOST=x86_64-apple-darwin11 download-one download-linux: @$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one download-win: @$(MAKE) -s HOST=x86_64-w64-mingw32 download-one 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 diff --git a/depends/README.md b/depends/README.md index fd343f701..271bbd80b 100644 --- a/depends/README.md +++ b/depends/README.md @@ -22,42 +22,17 @@ Common `host-platform-triplets` for cross compilation are: - `i686-w64-mingw32` for Win32 - `x86_64-w64-mingw32` for Win64 -- `x86_64-apple-darwin14` for macOS -- `arm-linux-gnueabihf` for Linux ARM 32 bit -- `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 +- `x86_64-apple-darwin11` for MacOSX +- `arm-linux-gnueabihf` for Linux ARM 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: The following can be set when running make: make FOO=bar SOURCES_PATH: downloaded sources 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 NO_QT: Don't download/build/cache qt and its dependencies 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: 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-linux: run 'make download-linux' to fetch all sources needed for linux builds diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index c7671c154..200d6ed22 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -1,17 +1,17 @@ -build_darwin_CC:=$(shell xcrun -f clang) -build_darwin_CXX:=$(shell xcrun -f clang++) -build_darwin_AR:=$(shell xcrun -f ar) -build_darwin_RANLIB:=$(shell xcrun -f ranlib) -build_darwin_STRIP:=$(shell xcrun -f strip) -build_darwin_OTOOL:=$(shell xcrun -f otool) -build_darwin_NM:=$(shell xcrun -f nm) +build_darwin_CC: = $(shell xcrun -f clang) +build_darwin_CXX: = $(shell xcrun -f clang++) +build_darwin_AR: = $(shell xcrun -f ar) +build_darwin_RANLIB: = $(shell xcrun -f ranlib) +build_darwin_STRIP: = $(shell xcrun -f strip) +build_darwin_OTOOL: = $(shell xcrun -f otool) +build_darwin_NM: = $(shell xcrun -f nm) build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) -build_darwin_SHA256SUM=shasum -a 256 -build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o +build_darwin_SHA256SUM = shasum -a 256 +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_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_RANLIB:=$(shell xcrun -f ranlib) darwin_STRIP:=$(shell xcrun -f strip) diff --git a/depends/config.guess b/depends/config.guess index 2b79f6d83..373a659a0 100755 --- a/depends/config.guess +++ b/depends/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2018-07-06' +timestamp='2016-02-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2018-07-06' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ timestamp='2018-07-06' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Options: +Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -101,15 +101,15 @@ trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && e trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp 2>/dev/null) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in - ,,) echo "int x;" > "$dummy.c" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do - if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -132,14 +132,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "$UNAME_SYSTEM" in +case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval "$set_cc_for_build" - cat <<-EOF > "$dummy.c" + eval $set_cc_for_build + cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,20 +149,13 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" - - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl - fi + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -176,30 +169,27 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` - case "$UNAME_MACHINE_ARCH" in + case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-unknown + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in - earm*) - os=netbsdelf - ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval "$set_cc_for_build" + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -215,10 +205,10 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in ;; esac # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in + case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; esac # The OS release @@ -226,55 +216,46 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in + case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; - *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix + echo ${UNAME_MACHINE}-unknown-sortix exit ;; - *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; - mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -326,19 +307,28 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos + echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos + echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -350,7 +340,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" + echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -377,38 +367,38 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" + echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval "$set_cc_for_build" + eval $set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -417,25 +407,25 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" + echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" + echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" + echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" + echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -446,44 +436,44 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" + echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" + echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" + echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" + echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" + echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" + echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" + echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" + echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" + echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -492,23 +482,23 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`"$dummy" "$dummyarg"` && + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" + echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -534,17 +524,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] then - echo m88k-dg-dgux"$UNAME_RELEASE" + echo m88k-dg-dgux${UNAME_RELEASE} else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else - echo i586-dg-dgux"$UNAME_RELEASE" + echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -561,7 +551,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -573,14 +563,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #include main() @@ -591,7 +581,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else @@ -605,7 +595,7 @@ EOF exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -614,18 +604,18 @@ EOF IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -640,28 +630,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - case "$UNAME_MACHINE" in - 9000/31?) HP_ARCH=m68000 ;; - 9000/[34]??) HP_ARCH=m68k ;; + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "$sc_cpu_version" in + case "${sc_cpu_version}" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in + case "${sc_kernel_bits}" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include @@ -694,13 +684,13 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ "$HP_ARCH" = hppa2.0w ] + if [ ${HP_ARCH} = hppa2.0w ] then - eval "$set_cc_for_build" + eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -711,7 +701,7 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w @@ -719,15 +709,15 @@ EOF HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux"$HPUX_REV" + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #include int main () @@ -752,11 +742,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -765,7 +755,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -773,9 +763,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + echo ${UNAME_MACHINE}-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -800,109 +790,127 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" + echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case "$UNAME_PROCESSOR" in + case ${UNAME_PROCESSOR} in amd64) - UNAME_PROCESSOR=x86_64 ;; - i386) - UNAME_PROCESSOR=i586 ;; + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin + echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 + echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 + echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 + echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case "$UNAME_MACHINE" in + case ${UNAME_MACHINE} in x86) - echo i586-pc-interix"$UNAME_RELEASE" + echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" + echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" + echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin + echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; - *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -916,63 +924,63 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) - eval "$set_cc_for_build" + eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -986,70 +994,64 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" - test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" + echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" + echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" + echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1063,34 +1065,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx + echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop + echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos + echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable + echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" + echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp + echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; - i*86:*:4.*:*) - UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) @@ -1100,12 +1102,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1115,9 +1117,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv32 + echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1137,9 +1139,9 @@ EOF exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1159,9 +1161,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1170,28 +1172,28 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" + echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" + echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" + echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" + echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" + echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1202,7 +1204,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo "$UNAME_MACHINE"-sni-sysv4 + echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1222,23 +1224,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos + echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" + echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv"$UNAME_RELEASE" + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv"$UNAME_RELEASE" + echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1257,56 +1259,46 @@ EOF echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" + echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" + echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" + echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" + echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" + echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; - SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" + echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" + echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval "$set_cc_for_build" + eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub @@ -1317,7 +1309,7 @@ EOF # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1325,25 +1317,19 @@ EOF UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" + echo nse-tandem-nsk${UNAME_RELEASE} exit ;; - NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1352,7 +1338,7 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 @@ -1363,7 +1349,7 @@ EOF else UNAME_MACHINE="$cputype" fi - echo "$UNAME_MACHINE"-unknown-plan9 + echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1384,14 +1370,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "$UNAME_MACHINE" in + case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1400,48 +1386,37 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos + echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros + echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx + echo ${UNAME_MACHINE}-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac -echo "$0: unable to guess system type" >&2 - -case "$UNAME_MACHINE:$UNAME_SYSTEM" in - mips:Linux | mips64:Linux) - # If we got here on MIPS GNU/Linux, output extra information. - cat >&2 <&2 < in order to provide the needed +information to handle your system. config.guess timestamp = $timestamp @@ -1460,16 +1435,16 @@ hostinfo = `(hostinfo) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = "$UNAME_MACHINE" -UNAME_RELEASE = "$UNAME_RELEASE" -UNAME_SYSTEM = "$UNAME_SYSTEM" -UNAME_VERSION = "$UNAME_VERSION" +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/depends/config.site.in b/depends/config.site.in index 8444dc26f..5c68b87c5 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -1,25 +1,27 @@ -depends_prefix="`dirname ${ac_site_file}`/.." - cross_compiling=maybe host_alias=@HOST@ ac_tool_prefix=${host_alias}- if test -z $with_boost; then - with_boost=$depends_prefix + with_boost=$prefix fi if test -z $with_qt_plugindir; then - with_qt_plugindir=$depends_prefix/plugins + with_qt_plugindir=$prefix/plugins fi if test -z $with_qt_translationdir; then - with_qt_translationdir=$depends_prefix/translations + with_qt_translationdir=$prefix/translations fi -if test -z $with_qt_bindir && test -z "@no_qt@"; then - with_qt_bindir=$depends_prefix/native/bin +if test -z $with_qt_bindir; then + with_qt_bindir=$prefix/native/bin fi -if test -z $with_protoc_bindir && test -z "@no_qt@"; then - with_protoc_bindir=$depends_prefix/native/bin +if test -z $with_protoc_bindir; then + 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 +with_icu_dir=@icu_dir@ if test -z $enable_wallet && test -n "@no_wallet@"; then enable_wallet=no @@ -40,31 +42,32 @@ fi if test x@host_os@ = xmingw32; then if test -z $with_qt_incdir; then - with_qt_incdir=$depends_prefix/include + with_qt_incdir=$prefix/include fi if test -z $with_qt_libdir; then - with_qt_libdir=$depends_prefix/lib + with_qt_libdir=$prefix/lib fi fi -PATH=$depends_prefix/native/bin:$PATH +PATH=$prefix/native/bin:$PATH PKG_CONFIG="`which pkg-config` --static" # 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 # 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" -LDFLAGS="-L$depends_prefix/lib $LDFLAGS" +export PKG_CONFIG_LIBDIR=$prefix/lib/pkgconfig +export PKG_CONFIG_PATH=$prefix/share/pkgconfig + +CPPFLAGS="-I$prefix/include/ $CPPFLAGS" +LDFLAGS="-L$prefix/lib $LDFLAGS" CC="@CC@" CXX="@CXX@" 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 AR=@AR@ @@ -97,3 +100,6 @@ fi if test -n "@LDFLAGS@"; then LDFLAGS="@LDFLAGS@ $LDFLAGS" fi +if test -n "@ICU_DIR@"; then + ICU_DIR="@ICU_DIR@" +fi diff --git a/depends/config.sub b/depends/config.sub index c95acc681..6223dde93 100755 --- a/depends/config.sub +++ b/depends/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2018-07-03' +timestamp='2016-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2018-07-03' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ timestamp='2018-07-03' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Options: +Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -94,7 +94,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. - echo "$1" + echo $1 exit ;; * ) @@ -110,455 +110,134 @@ case $# in exit 1;; esac -# Split fields of configuration type -IFS="-" read -r field1 field2 field3 field4 <&2 - exit 1 +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. ;; - *-*-*-*) - basic_machine=$field1-$field2 - os=$field3-$field4 + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 ;; - *-*-*) - # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two - # parts - maybe_os=$field2-$field3 - case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) - basic_machine=$field1 - os=$maybe_os - ;; - android-linux) - basic_machine=$field1-unknown - os=linux-android - ;; - *) - basic_machine=$field1-$field2 - os=$field3 - ;; - esac + -bluegene*) + os=-cnk ;; - *-*) - # Second component is usually, but not always the OS - case $field2 in - # Prevent following clause from handling this valid os - sun*os*) - basic_machine=$field1 - os=$field2 - ;; - # Manufacturers - dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* \ - | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ - | unicom* | ibm* | next | hp | isi* | apollo | altos* \ - | convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* \ - | c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* \ - | harris | dolphin | highlevel | gould | cbm | ns | masscomp \ - | apple | axis | knuth | cray | microblaze* \ - | sim | cisco | oki | wec | wrs | winbond) - basic_machine=$field1-$field2 - os= - ;; - *) - basic_machine=$field1 - os=$field2 - ;; - esac + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 ;; - *) - # Convert single-component short-hands not valid as part of - # multi-component configurations. - case $field1 in - 386bsd) - basic_machine=i386-pc - os=bsd - ;; - a29khif) - basic_machine=a29k-amd - os=udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=scout - ;; - am29k) - basic_machine=a29k-none - os=bsd - ;; - amdahl) - basic_machine=580-amdahl - os=sysv - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=bsd - ;; - aros) - basic_machine=i386-pc - os=aros - ;; - aux) - basic_machine=m68k-apple - os=aux - ;; - balance) - basic_machine=ns32k-sequent - os=dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=linux - ;; - cegcc) - basic_machine=arm-unknown - os=cegcc - ;; - cray) - basic_machine=j90-cray - os=unicos - ;; - craynv) - basic_machine=craynv-cray - os=unicosmp - ;; - delta88) - basic_machine=m88k-motorola - os=sysv3 - ;; - dicos) - basic_machine=i686-pc - os=dicos - ;; - djgpp) - basic_machine=i586-pc - os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd - os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=ose - ;; - gmicro) - basic_machine=tron-gmicro - os=sysv - ;; - go32) - basic_machine=i386-pc - os=go32 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=hms - ;; - harris) - basic_machine=m88k-harris - os=sysv3 - ;; - hp300bsd) - basic_machine=m68k-hp - os=bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=hpux - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=proelf - ;; - i386mach) - basic_machine=i386-mach - os=mach - ;; - vsta) - basic_machine=i386-unknown - os=vsta - ;; - isi68 | isi) - basic_machine=m68k-isi - os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=sysv - ;; - merlin) - basic_machine=ns32k-utek - os=sysv - ;; - mingw64) - basic_machine=x86_64-pc - os=mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k - os=coff - ;; - morphos) - basic_machine=powerpc-unknown - os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=moxiebox - ;; - msdos) - basic_machine=i386-pc - os=msdos - ;; - msys) - basic_machine=i686-pc - os=msys - ;; - mvs) - basic_machine=i370-ibm - os=mvs - ;; - nacl) - basic_machine=le32-unknown - os=nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=newsos - ;; - news1000) - basic_machine=m68030-sony - os=newsos - ;; - necv70) - basic_machine=v70-nec - os=sysv - ;; - nh3000) - basic_machine=m68k-harris - os=cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=cxux - ;; - nindy960) - basic_machine=i960-intel - os=nindy - ;; - mon960) - basic_machine=i960-intel - os=mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=nonstopux - ;; - os400) - basic_machine=powerpc-ibm - os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=ose - ;; - os68k) - basic_machine=m68k-none - os=os68k - ;; - paragon) - basic_machine=i860-intel - os=osf - ;; - parisc) - basic_machine=hppa-unknown - os=linux - ;; - pw32) - basic_machine=i586-unknown - os=pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=rdos - ;; - rdos32) - basic_machine=i386-pc - os=rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=coff - ;; - sa29200) - basic_machine=a29k-amd - os=udi - ;; - sei) - basic_machine=mips-sei - os=seiux - ;; - sps7) - basic_machine=m68k-bull - os=sysv2 - ;; - stratus) - basic_machine=i860-stratus - os=sysv4 - ;; - sun2os3) - basic_machine=m68000-sun - os=sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=solaris2 - ;; - sv1) - basic_machine=sv1-cray - os=unicos - ;; - symmetry) - basic_machine=i386-sequent - os=dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=unicos - ;; - t90) - basic_machine=t90-cray - os=unicos - ;; - toad1) - basic_machine=pdp10-xkl - os=tops20 - ;; - tpf) - basic_machine=s390x-ibm - os=tpf - ;; - udi29k) - basic_machine=a29k-amd - os=udi - ;; - ultra3) - basic_machine=a29k-nyu - os=sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=none - ;; - vaxv) - basic_machine=vax-dec - os=sysv - ;; - vms) - basic_machine=vax-dec - os=vms - ;; - vxworks960) - basic_machine=i960-wrs - os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=vxworks - ;; - xbox) - basic_machine=i686-pc - os=mingw32 - ;; - ymp) - basic_machine=ymp-cray - os=unicos - ;; - *) - basic_machine=$1 - os= - ;; - esac + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint ;; esac @@ -573,18 +252,18 @@ case $basic_machine in | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ - | c4x | c8051 | clipper | csky \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia16 | ia64 \ + | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ @@ -617,15 +296,13 @@ case $basic_machine in | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nfp \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ - | pdp10 | pj | pjl \ + | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ | pyramid \ - | riscv | riscv32 | riscv64 \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -637,7 +314,7 @@ case $basic_machine in | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ - | wasm32 \ + | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -656,23 +333,20 @@ case $basic_machine in ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown - os=${os:-none} + os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) - ;; - m9s12z | m68hcs12z | hcs12z | s12z) - basic_machine=s12z-unknown - os=${os:-none} + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; + strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown - os=${os:-none} + os=-none ;; xscaleeb) basic_machine=armeb-unknown @@ -688,6 +362,11 @@ case $basic_machine in i*86 | x86_64) basic_machine=$basic_machine-pc ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ @@ -701,14 +380,14 @@ case $basic_machine in | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ @@ -742,7 +421,6 @@ case $basic_machine in | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nfp-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ @@ -750,9 +428,8 @@ case $basic_machine in | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ | pyramid-* \ - | riscv-* | riscv32-* | riscv64-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ @@ -767,7 +444,6 @@ case $basic_machine in | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ - | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -780,77 +456,141 @@ case $basic_machine in ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; abacus) basic_machine=abacus-unknown ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; amd64) basic_machine=x86_64-pc ;; amd64-*) - basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; asmjs) basic_machine=asmjs-unknown ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; blackfin-*) - basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=linux + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux ;; bluegene*) basic_machine=powerpc-ibm - os=cnk + os=-cnk ;; c54x-*) - basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) - basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) - basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray - os=${os:-unicos} + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc ;; convex-c1) basic_machine=c1-convex - os=bsd + os=-bsd ;; convex-c2) basic_machine=c2-convex - os=bsd + os=-bsd ;; convex-c32) basic_machine=c32-convex - os=bsd + os=-bsd ;; convex-c34) basic_machine=c34-convex - os=bsd + os=-bsd ;; convex-c38) basic_machine=c38-convex - os=bsd + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown - os=${os:-elf} + os=-elf ;; crds | unos) basic_machine=m68k-crds @@ -863,7 +603,7 @@ case $basic_machine in ;; crx) basic_machine=crx-unknown - os=${os:-elf} + os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 @@ -873,38 +613,50 @@ case $basic_machine in ;; decsystem10* | dec10*) basic_machine=pdp10-dec - os=tops10 + os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec - os=tops20 + os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull - os=${os:-bosx} + os=-bosx ;; - dpx2*) + dpx2* | dpx2*-bull) basic_machine=m68k-bull - os=sysv3 + os=-sysv3 ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" + ebmon29k) + basic_machine=a29k-amd + os=-ebmon ;; - e500v[12]-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=$os"spe" + elxsi) + basic_machine=elxsi-elxsi + os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; - elxsi) - basic_machine=elxsi-elxsi - os=${os:-bsd} + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose ;; fx2800) basic_machine=i860-alliant @@ -912,13 +664,45 @@ case $basic_machine in genix) basic_machine=ns32k-ns ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi - os=hiuxwe2 + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; @@ -948,82 +732,200 @@ case $basic_machine in hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=sysv32 + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 ;; i*86v4*) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=sysv4 + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 ;; i*86v) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=sysv + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv ;; i*86sol2) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=solaris2 + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 ;; - j90 | j90-cray) - basic_machine=j90-cray - os=${os:-unicos} + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in - irix*) + -irix*) ;; *) - os=irix4 + os=-irix4 ;; esac ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; leon-*|leon[3-9]-*) - basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux ;; m68knommu-*) - basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=linux + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; - *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari - os=mint + os=-mint ;; mips3*-*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos ;; ms1-*) - basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony - os=newsos + os=-newsos ;; - next | m*-next) + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) basic_machine=m68k-next case $os in - nextstep* ) + -nextstep* ) ;; - ns2*) - os=nextstep2 + -ns2*) + os=-nextstep2 ;; *) - os=nextstep3 + os=-nextstep3 ;; esac ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; np1) basic_machine=np1-gould ;; @@ -1036,26 +938,40 @@ case $basic_machine in nsr-tandem) basic_machine=nsr-tandem ;; - nsv-tandem) - basic_machine=nsv-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem - ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki - os=proelf + os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; pa-hitachi) basic_machine=hppa1.1-hitachi - os=hiuxwe2 + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux ;; parisc-*) - basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=linux + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux ;; pbd) basic_machine=sparc-tti @@ -1070,7 +986,7 @@ case $basic_machine in basic_machine=i386-pc ;; pc98-*) - basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc @@ -1085,16 +1001,16 @@ case $basic_machine in basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) - basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -1104,27 +1020,43 @@ case $basic_machine in ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle) + ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little) + ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; rm[46]00) basic_machine=mips-siemens ;; @@ -1137,6 +1069,10 @@ case $basic_machine in s390x | s390x-*) basic_machine=s390x-ibm ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; sb1) basic_machine=mipsisa64sb1-unknown ;; @@ -1145,17 +1081,32 @@ case $basic_machine in ;; sde) basic_machine=mipsisa32-sde - os=${os:-elf} + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux ;; sequent) basic_machine=i386-sequent ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; sh5el) basic_machine=sh5le-unknown ;; - simso-wrs) + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs - os=vxworks + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 ;; spur) basic_machine=spur-unknown @@ -1163,12 +1114,44 @@ case $basic_machine in st2000) basic_machine=m68k-tandem ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; strongarm-* | thumb-*) - basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; sun3 | sun3-*) basic_machine=m68k-sun ;; @@ -1178,9 +1161,25 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; tile*) basic_machine=$basic_machine-unknown - os=linux-gnu + os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown @@ -1188,32 +1187,85 @@ case $basic_machine in tx39el) basic_machine=mipstx39el-unknown ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; w65*) basic_machine=w65-wdc - os=none + os=-none ;; w89k-*) basic_machine=hppa1.1-winbond - os=proelf + os=-proelf ;; - x64) - basic_machine=x86_64-pc + xbox) + basic_machine=i686-pc + os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) - basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim ;; none) basic_machine=none-none - os=${os:-none} + os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in @@ -1239,6 +1291,10 @@ case $basic_machine in vax) basic_machine=vax-dec ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; pdp11) basic_machine=pdp11-dec ;; @@ -1248,6 +1304,9 @@ case $basic_machine in sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; cydra) basic_machine=cydra-cydrome ;; @@ -1267,7 +1326,7 @@ case $basic_machine in # Make sure to match an already-canonicalized machine name. ;; *) - echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac @@ -1275,10 +1334,10 @@ esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) - basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) - basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1286,246 +1345,198 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x$os != x ] +if [ x"$os" != x"" ] then case $os in - # First match some system type aliases that might get confused - # with valid system types. - # solaris* is a basic system type, with this one exception. - auroraux) - os=auroraux + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux ;; - bluegene*) - os=cnk - ;; - solaris1 | solaris1.*) + -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - solaris) - os=solaris2 + -solaris) + os=-solaris2 ;; - unixware*) - os=sysv4.2uw + -svr4*) + os=-sysv4 ;; - gnu/linux*) + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # es1800 is here to avoid being matched by es* (a different OS) - es1800*) - os=ose - ;; - # Some version numbers need modification - chorusos*) - os=chorusos - ;; - isc) - os=isc2.2 - ;; - sco6) - os=sco5v6 - ;; - sco5) - os=sco3.2v5 - ;; - sco4) - os=sco3.2v4 - ;; - sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - ;; - sco3.2v[4-9]* | sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - ;; - scout) - # Don't match below - ;; - sco*) - os=sco3.2v2 - ;; - psos*) - os=psos - ;; - # Now accept the basic system types. + # First accept the basic system types. # The portable systems comes first. - # Each alternative MUST end in a * to match a version number. - # sysv* is not here because it comes later, after sysvr4. - gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ - | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ - | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ - | sym* | kopensolaris* | plan9* \ - | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ - | aos* | aros* | cloudabi* | sortix* \ - | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ - | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ - | knetbsd* | mirbsd* | netbsd* \ - | bitrig* | openbsd* | solidbsd* | libertybsd* \ - | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ - | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ - | chorusrdb* | cegcc* | glidix* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ - | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ - | linux-newlib* | linux-musl* | linux-uclibc* \ - | uxpv* | beos* | mpeix* | udk* | moxiebox* \ - | interix* | uwin* | mks* | rhapsody* | darwin* \ - | openstep* | oskit* | conix* | pw32* | nonstopux* \ - | storm-chaos* | tops10* | tenex* | tops20* | its* \ - | os2* | vos* | palmos* | uclinux* | nucleus* \ - | morphos* | superux* | rtmk* | windiss* \ - | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ - | skyos* | haiku* | rdos* | toppers* | drops* | es* \ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ - | midnightbsd*) + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; - qnx*) + -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) - os=nto-$os + os=-nto$os ;; esac ;; - hiux*) - os=hiuxwe2 + -nto-qnx*) ;; - nto-qnx*) - ;; - nto*) + -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - sim | xray | os68k* | v88r* \ - | windows* | osx | abug | netware* | os9* \ - | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; - linux-dietlibc) - os=linux-dietlibc + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` ;; - linux*) + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - lynx*178) - os=lynxos178 + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; - lynx*5) - os=lynxos5 + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; - lynx*) - os=lynxos + -opened*) + os=-openedition ;; - mac*) - os=`echo "$os" | sed -e 's|mac|macos|'` + -os400*) + os=-os400 ;; - opened*) - os=openedition + -wince*) + os=-wince ;; - os400*) - os=os400 + -osfrose*) + os=-osfrose ;; - sunos5*) - os=`echo "$os" | sed -e 's|sunos5|solaris2|'` + -osf*) + os=-osf ;; - sunos6*) - os=`echo "$os" | sed -e 's|sunos6|solaris3|'` + -utek*) + os=-bsd ;; - wince*) - os=wince + -dynix*) + os=-bsd ;; - utek*) - os=bsd + -acis*) + os=-aos ;; - dynix*) - os=bsd + -atheos*) + os=-atheos ;; - acis*) - os=aos + -syllable*) + os=-syllable ;; - atheos*) - os=atheos + -386bsd) + os=-bsd ;; - syllable*) - os=syllable + -ctix* | -uts*) + os=-sysv ;; - 386bsd) - os=bsd + -nova*) + os=-rtmk-nova ;; - ctix* | uts*) - os=sysv + -ns2 ) + os=-nextstep2 ;; - nova*) - os=rtmk-nova - ;; - ns2) - os=nextstep2 - ;; - nsk*) - os=nsk + -nsk*) + os=-nsk ;; # Preserve the version number of sinix5. - sinix5.*) + -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - sinix*) - os=sysv4 + -sinix*) + os=-sysv4 ;; - tpf*) - os=tpf + -tpf*) + os=-tpf ;; - triton*) - os=sysv3 + -triton*) + os=-sysv3 ;; - oss*) - os=sysv3 + -oss*) + os=-sysv3 ;; - svr4*) - os=sysv4 + -svr4) + os=-sysv4 ;; - svr3) - os=sysv3 + -svr3) + os=-sysv3 ;; - sysvr4) - os=sysv4 + -sysvr4) + os=-sysv4 ;; - # This must come after sysvr4. - sysv*) + # This must come after -sysvr4. + -sysv*) ;; - ose*) - os=ose + -ose*) + os=-ose ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) - os=mint + -es1800*) + os=-ose ;; - zvmoe) - os=zvmoe + -xenix) + os=-xenix ;; - dicos*) - os=dicos + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint ;; - pikeos*) - # Until real need of OS specific support for - # particular features comes up, bare metal - # configurations are quite functional. - case $basic_machine in - arm*) - os=eabi - ;; - *) - os=elf - ;; - esac + -aros*) + os=-aros ;; - nacl*) + -zvmoe) + os=-zvmoe ;; - ios) + -dicos*) + os=-dicos ;; - none) + -nacl*) ;; - *-eabi) + -none) ;; *) - echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac @@ -1543,179 +1554,176 @@ else case $basic_machine in score-*) - os=elf + os=-elf ;; spu-*) - os=elf + os=-elf ;; *-acorn) - os=riscix1.2 + os=-riscix1.2 ;; arm*-rebel) - os=linux + os=-linux ;; arm*-semi) - os=aout + os=-aout ;; c4x-* | tic4x-*) - os=coff + os=-coff ;; c8051-*) - os=elf - ;; - clipper-intergraph) - os=clix + os=-elf ;; hexagon-*) - os=elf + os=-elf ;; tic54x-*) - os=coff + os=-coff ;; tic55x-*) - os=coff + os=-coff ;; tic6x-*) - os=coff + os=-coff ;; # This must come before the *-dec entry. pdp10-*) - os=tops20 + os=-tops20 ;; pdp11-*) - os=none + os=-none ;; *-dec | vax-*) - os=ultrix4.2 + os=-ultrix4.2 ;; m68*-apollo) - os=domain + os=-domain ;; i386-sun) - os=sunos4.0.2 + os=-sunos4.0.2 ;; m68000-sun) - os=sunos3 + os=-sunos3 ;; m68*-cisco) - os=aout + os=-aout ;; mep-*) - os=elf + os=-elf ;; mips*-cisco) - os=elf + os=-elf ;; mips*-*) - os=elf + os=-elf ;; or32-*) - os=coff + os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=sysv3 + os=-sysv3 ;; sparc-* | *-sun) - os=sunos4.1.1 - ;; - pru-*) - os=elf + os=-sunos4.1.1 ;; *-be) - os=beos + os=-beos + ;; + *-haiku) + os=-haiku ;; *-ibm) - os=aix + os=-aix ;; *-knuth) - os=mmixware + os=-mmixware ;; *-wec) - os=proelf + os=-proelf ;; *-winbond) - os=proelf + os=-proelf ;; *-oki) - os=proelf + os=-proelf ;; *-hp) - os=hpux + os=-hpux ;; *-hitachi) - os=hiux + os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=sysv + os=-sysv ;; *-cbm) - os=amigaos + os=-amigaos ;; *-dg) - os=dgux + os=-dgux ;; *-dolphin) - os=sysv3 + os=-sysv3 ;; m68k-ccur) - os=rtu + os=-rtu ;; m88k-omron*) - os=luna + os=-luna ;; - *-next) - os=nextstep + *-next ) + os=-nextstep ;; *-sequent) - os=ptx + os=-ptx ;; *-crds) - os=unos + os=-unos ;; *-ns) - os=genix + os=-genix ;; i370-*) - os=mvs + os=-mvs + ;; + *-next) + os=-nextstep3 ;; *-gould) - os=sysv + os=-sysv ;; *-highlevel) - os=bsd + os=-bsd ;; *-encore) - os=bsd + os=-bsd ;; *-sgi) - os=irix + os=-irix ;; *-siemens) - os=sysv4 + os=-sysv4 ;; *-masscomp) - os=rtu + os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=uxpv + os=-uxpv ;; *-rom68k) - os=coff + os=-coff ;; *-*bug) - os=coff + os=-coff ;; *-apple) - os=macos + os=-macos ;; *-atari*) - os=mint - ;; - *-wrs) - os=vxworks + os=-mint ;; *) - os=none + os=-none ;; esac fi @@ -1726,82 +1734,79 @@ vendor=unknown case $basic_machine in *-unknown) case $os in - riscix*) + -riscix*) vendor=acorn ;; - sunos*) + -sunos*) vendor=sun ;; - cnk*|-aix*) + -cnk*|-aix*) vendor=ibm ;; - beos*) + -beos*) vendor=be ;; - hpux*) + -hpux*) vendor=hp ;; - mpeix*) + -mpeix*) vendor=hp ;; - hiux*) + -hiux*) vendor=hitachi ;; - unos*) + -unos*) vendor=crds ;; - dgux*) + -dgux*) vendor=dg ;; - luna*) + -luna*) vendor=omron ;; - genix*) + -genix*) vendor=ns ;; - clix*) - vendor=intergraph - ;; - mvs* | opened*) + -mvs* | -opened*) vendor=ibm ;; - os400*) + -os400*) vendor=ibm ;; - ptx*) + -ptx*) vendor=sequent ;; - tpf*) + -tpf*) vendor=ibm ;; - vxsim* | vxworks* | windiss*) + -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; - aux*) + -aux*) vendor=apple ;; - hms*) + -hms*) vendor=hitachi ;; - mpw* | macos*) + -mpw* | -macos*) vendor=apple ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; - vos*) + -vos*) vendor=stratus ;; esac - basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo "$basic_machine-$os" +echo $basic_machine$os exit # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/depends/description.md b/depends/description.md index 9fc7093be..74f9ef3f2 100644 --- a/depends/description.md +++ b/depends/description.md @@ -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 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 -Linux or macOS. +Linux or OSX. ### No reliance on timestamps diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index a1c943d60..2958dc50c 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,9 +1,9 @@ -OSX_MIN_VERSION=10.10 -OSX_SDK_VERSION=10.11 +OSX_MIN_VERSION=10.7 +OSX_SDK_VERSION=10.9 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_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_CXXFLAGS=$(darwin_CFLAGS) diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk index 144e5f88b..6f60d6b3f 100644 --- a/depends/hosts/default.mk +++ b/depends/hosts/default.mk @@ -1,7 +1,3 @@ -ifneq ($(host),$(build)) -host_toolchain:=$(host)- -endif - default_host_CC = $(host_toolchain)gcc default_host_CXX = $(host_toolchain)g++ default_host_AR = $(host_toolchain)ar diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk index 6c9876c2c..e2f85ad4f 100644 --- a/depends/packages/bdb.mk +++ b/depends/packages/bdb.mk @@ -9,13 +9,11 @@ define $(package)_set_vars $(package)_config_opts=--disable-shared --enable-cxx --disable-replication $(package)_config_opts_mingw32=--enable-mingw $(package)_config_opts_linux=--with-pic -$(package)_cxxflags=-std=c++11 endef define $(package)_preprocess_cmds 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 && \ - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist + 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 endef define $(package)_config_cmds diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 61806c750..e7d9ea393 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -1,14 +1,16 @@ package=boost -$(package)_version=1_64_0 -$(package)_download_path=https://dl.bintray.com/boostorg/release/1.64.0/source/ +$(package)_version=1_59_0 +$(package)_download_path=http://sourceforge.net/projects/boost/files/boost/1.59.0 $(package)_file_name=$(package)_$($(package)_version).tar.bz2 -$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332 +$(package)_sha256_hash=727a932322d94287b62abb1bd2d41723eec4356a7728909e38adb65ca25241ca +$(package)_dependencies:icu define $(package)_set_vars $(package)_config_opts_release=variant=release $(package)_config_opts_debug=variant=debug -$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam -$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 +$(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 -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_darwin=--toolset=darwin-4.2.1 runtime-link=shared $(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)_toolset_darwin=darwin $(package)_archiver_darwin=$($(package)_libtool) -$(package)_config_libraries=chrono,filesystem,system,thread,test -$(package)_cxxflags=-std=c++11 -fvisibility=hidden +$(package)_config_libraries=chrono,filesystem,program_options,system,locale,regex,thread,test +$(package)_cxxflags=-fvisibility=hidden $(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 define $(package)_preprocess_cmds @@ -29,13 +39,12 @@ define $(package)_preprocess_cmds endef 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 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 define $(package)_stage_cmds - ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install endef diff --git a/depends/packages/dbus.mk b/depends/packages/dbus.mk index bbe037540..8ac9ab742 100644 --- a/depends/packages/dbus.mk +++ b/depends/packages/dbus.mk @@ -1,8 +1,8 @@ package=dbus -$(package)_version=1.10.18 -$(package)_download_path=https://dbus.freedesktop.org/releases/dbus +$(package)_version=1.8.6 +$(package)_download_path=http://dbus.freedesktop.org/releases/dbus $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=6049ddd5f3f3e2618f615f1faeda0a115104423a7996b7aa73e2f36e38cc514a +$(package)_sha256_hash=eded83ca007b719f32761e60fd8b9ffd0f5796a4caf455b01b5a5ef740ebd23f $(package)_dependencies=expat define $(package)_set_vars diff --git a/depends/packages/expat.mk b/depends/packages/expat.mk index acbc60eea..1ac443537 100644 --- a/depends/packages/expat.mk +++ b/depends/packages/expat.mk @@ -1,8 +1,8 @@ package=expat -$(package)_version=2.2.5 -$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_5/ -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6 +$(package)_version=2.1.0 +$(package)_download_path=http://sourceforge.net/projects/expat/files/expat/$($(package)_version) +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=823705472f816df21c8f6aa026dd162b280806838bb55b3432b0fb1fcca7eb86 define $(package)_set_vars $(package)_config_opts=--disable-static diff --git a/depends/packages/fontconfig.mk b/depends/packages/fontconfig.mk index 12695db4b..2cf553ed9 100644 --- a/depends/packages/fontconfig.mk +++ b/depends/packages/fontconfig.mk @@ -1,8 +1,8 @@ package=fontconfig -$(package)_version=2.12.1 +$(package)_version=2.11.1 $(package)_download_path=http://www.freedesktop.org/software/fontconfig/release/ $(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f7d6c7f3 +$(package)_sha256_hash=dc62447533bca844463a3c3fd4083b57c90f18a70506e7a9f4936b5a1e516a99 $(package)_dependencies=freetype expat define $(package)_set_vars @@ -13,13 +13,7 @@ define $(package)_config_cmds $($(package)_autoconf) 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 - 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) endef diff --git a/depends/packages/freetype.mk b/depends/packages/freetype.mk index 76b025c46..f7d6e0f9f 100644 --- a/depends/packages/freetype.mk +++ b/depends/packages/freetype.mk @@ -1,8 +1,8 @@ package=freetype -$(package)_version=2.7.1 -$(package)_download_path=http://download.savannah.gnu.org/releases/$(package) +$(package)_version=2.5.3 +$(package)_download_path=http://downloads.sourceforge.net/$(package) $(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4aa82f88 +$(package)_sha256_hash=c0848b29d52ef3ca27ad92e08351f023c5e24ce8cea7d8fe69fc96358e65f75e define $(package)_set_vars $(package)_config_opts=--without-zlib --without-png --disable-static diff --git a/depends/packages/icu.mk b/depends/packages/icu.mk new file mode 100644 index 000000000..88fb2e014 --- /dev/null +++ b/depends/packages/icu.mk @@ -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 diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk index 5f622f8e6..2e9be1e98 100644 --- a/depends/packages/libevent.mk +++ b/depends/packages/libevent.mk @@ -1,15 +1,16 @@ package=libevent -$(package)_version=2.1.8-stable -$(package)_download_path=https://github.com/libevent/libevent/archive/ -$(package)_file_name=release-$($(package)_version).tar.gz -$(package)_sha256_hash=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d +$(package)_version=2.0.22 +$(package)_download_path=https://github.com/libevent/libevent/releases/download/release-2.0.22-stable +$(package)_file_name=$(package)-$($(package)_version)-stable.tar.gz +$(package)_sha256_hash=71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3 +$(package)_patches=reuseaddr.patch define $(package)_preprocess_cmds - ./autogen.sh + patch -p1 < $($(package)_patch_dir)/reuseaddr.patch endef 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_linux=--with-pic endef diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk index 5ad2b580d..45fa03631 100644 --- a/depends/packages/miniupnpc.mk +++ b/depends/packages/miniupnpc.mk @@ -1,12 +1,12 @@ package=miniupnpc -$(package)_version=2.0.20180203 +$(package)_version=1.9.20160209 $(package)_download_path=http://miniupnp.free.fr/files $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=90dda8c7563ca6cd4a83e23b3c66dbbea89603a1675bfdb852897c2c9cc220b7 +$(package)_sha256_hash=572171eacc1d72537ce47b6f4571260757ab7bcfdaf54c3a55c7f88594d94b6f define $(package)_set_vars $(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_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)" endef diff --git a/depends/packages/native_biplist.mk b/depends/packages/native_biplist.mk index 5f247e9bf..eb8672d55 100644 --- a/depends/packages/native_biplist.mk +++ b/depends/packages/native_biplist.mk @@ -1,8 +1,8 @@ package=native_biplist -$(package)_version=1.0.3 -$(package)_download_path=https://bitbucket.org/wooster/biplist/downloads +$(package)_version=0.9 +$(package)_download_path=https://pypi.python.org/packages/source/b/biplist $(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 define $(package)_build_cmds diff --git a/depends/packages/native_ccache.mk b/depends/packages/native_ccache.mk new file mode 100644 index 000000000..cc76f9a79 --- /dev/null +++ b/depends/packages/native_ccache.mk @@ -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 diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index 44d238cc4..b5603a8d4 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -1,14 +1,14 @@ package=native_cctools -$(package)_version=807d6fd1be5d2224872e381870c0a75387fe05e6 +$(package)_version=ee31ae567931c426136c94aad457c7b51d844beb $(package)_download_path=https://github.com/theuni/cctools-port/archive $(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a +$(package)_sha256_hash=ef107e6ab1b3994cb22e14f4f5c59ea0c0b5a988e6b21d42ed9616b018bbcbf9 $(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_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz -$(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz -$(package)_clang_sha256_hash=99b28a6b48e793705228a390471991386daa33a9717cd9ca007fcdde69608fd9 +$(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)-amd64-Ubuntu-12.04.2.tar.gz +$(package)_clang_sha256_hash=60d8f69f032d62ef61bf527857ebb933741ec3352d4d328c5516aa520662dab7 $(package)_extra_sources=$($(package)_clang_file_name) define $(package)_fetch_cmds @@ -23,7 +23,6 @@ define $(package)_extract_cmds $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \ 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 "exit 0" >> toolchain/bin/$(host)-dsymutil && \ chmod +x toolchain/bin/$(host)-dsymutil && \ @@ -31,15 +30,14 @@ define $(package)_extract_cmds endef 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)_cc=$($(package)_extract_dir)/toolchain/bin/clang $(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++ endef define $(package)_preprocess_cmds - cd $($(package)_build_subdir); ./autogen.sh && \ - sed -i.old "/define HAVE_PTHREADS/d" ld64/src/ld/InputFiles.h + cd $($(package)_build_subdir); ./autogen.sh endef define $(package)_config_cmds @@ -55,11 +53,10 @@ define $(package)_stage_cmds cd $($(package)_extract_dir)/toolchain && \ mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/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++ $($(package)_staging_prefix_dir)/bin/ &&\ + cp -P bin/clang bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\ 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 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 lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi endef diff --git a/depends/packages/native_comparisontool.mk b/depends/packages/native_comparisontool.mk new file mode 100644 index 000000000..e0ae0cec7 --- /dev/null +++ b/depends/packages/native_comparisontool.mk @@ -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 diff --git a/depends/packages/native_ds_store.mk b/depends/packages/native_ds_store.mk index 116fa25d3..8e902af1b 100644 --- a/depends/packages/native_ds_store.mk +++ b/depends/packages/native_ds_store.mk @@ -1,8 +1,9 @@ package=native_ds_store -$(package)_version=1.1.2 -$(package)_download_path=https://github.com/al45tair/ds_store/archive/ -$(package)_file_name=v$($(package)_version).tar.gz -$(package)_sha256_hash=3b3ecb7bf0a5157f5b6010bc3af7c141fb0ad3527084e63336220d22744bc20c +$(package)_version=c80c23706eae +$(package)_download_path=https://bitbucket.org/al45tair/ds_store/get +$(package)_download_file=$($(package)_version).tar.bz2 +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=ce1aa412211610c63d567bbe3e06213006a2d5ba5d76d89399c151b5472cb0da $(package)_install_libdir=$(build_prefix)/lib/python/dist-packages $(package)_dependencies=native_biplist diff --git a/depends/packages/native_mac_alias.mk b/depends/packages/native_mac_alias.mk index 306c83565..d117c1c9a 100644 --- a/depends/packages/native_mac_alias.mk +++ b/depends/packages/native_mac_alias.mk @@ -1,8 +1,9 @@ package=native_mac_alias -$(package)_version=2.0.7 -$(package)_download_path=https://github.com/al45tair/mac_alias/archive/ -$(package)_file_name=v$($(package)_version).tar.gz -$(package)_sha256_hash=6f606d3b6bccd2112aeabf1a063f5b5ece87005a5d7e97c8faca23b916e88838 +$(package)_version=1.1.0 +$(package)_download_path=https://bitbucket.org/al45tair/mac_alias/get +$(package)_download_file=v$($(package)_version).tar.bz2 +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=87ad827e66790028361e43fc754f68ed041a9bdb214cca03c853f079b04fb120 $(package)_install_libdir=$(build_prefix)/lib/python/dist-packages define $(package)_build_cmds diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index db47113b2..c6452820a 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -6,54 +6,18 @@ $(package)_sha256_hash=8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fce define $(package)_set_vars $(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+=no-camellia -$(package)_config_opts+=no-capieng -$(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=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl no-zlib no-shared no-dso +$(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-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+=$($(package)_cflags) $($(package)_cppflags) $(package)_config_opts_linux=-fPIC -Wa,--noexecstack $(package)_config_opts_x86_64_linux=linux-x86_64 $(package)_config_opts_i686_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_mipsel_linux=linux-generic32 $(package)_config_opts_mips_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_mingw32=mingw64 $(package)_config_opts_i686_mingw32=mingw diff --git a/depends/packages/packages.icu.mk b/depends/packages/packages.icu.mk new file mode 100644 index 000000000..4c7cfdfc7 --- /dev/null +++ b/depends/packages/packages.icu.mk @@ -0,0 +1 @@ +packages:=icu diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 5fe6f98da..13b894c2f 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -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_packages = qrencode protobuf zlib - -qt_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans +qt_packages = qrencode protobuf +qt_linux_packages= qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans qt_darwin_packages=qt qt_mingw32_packages=qt diff --git a/depends/packages/protobuf.mk b/depends/packages/protobuf.mk index 54d3fd924..5affad283 100644 --- a/depends/packages/protobuf.mk +++ b/depends/packages/protobuf.mk @@ -4,7 +4,6 @@ $(package)_download_path=$(native_$(package)_download_path) $(package)_file_name=$(native_$(package)_file_name) $(package)_sha256_hash=$(native_$(package)_sha256_hash) $(package)_dependencies=native_$(package) -$(package)_cxxflags=-std=c++11 define $(package)_set_vars $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc diff --git a/depends/packages/qrencode.mk b/depends/packages/qrencode.mk index 44fdf1c29..7b2124713 100644 --- a/depends/packages/qrencode.mk +++ b/depends/packages/qrencode.mk @@ -1,7 +1,7 @@ package=qrencode $(package)_version=3.4.4 $(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 define $(package)_set_vars diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 113b8dbc3..77df77b73 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -1,47 +1,42 @@ PACKAGE=qt -$(package)_version=5.9.6 -$(package)_download_path=https://download.qt.io/official_releases/qt/5.9/$($(package)_version)/submodules -$(package)_suffix=opensource-src-$($(package)_version).tar.xz +$(package)_version=5.5.0 +$(package)_download_path=http://download.qt.io/official_releases/qt/5.5/$($(package)_version)/submodules +$(package)_suffix=opensource-src-$($(package)_version).tar.gz $(package)_file_name=qtbase-$($(package)_suffix) -$(package)_sha256_hash=eed620cb268b199bd83b3fc6a471c51d51e1dc2dbb5374fc97a0cc75facbe36f -$(package)_dependencies=openssl zlib -$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext +$(package)_sha256_hash=7e82b1318f88e56a2a9376e069aa608d4fd96b48cb0e1b880ae658b0a1af0561 +$(package)_dependencies=openssl +$(package)_linux_dependencies=freetype fontconfig dbus libxcb libX11 xproto libXext $(package)_build_subdir=qtbase $(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_sha256_hash=9822084f8e2d2939ba39f4af4c0c2320e45d5996762a9423f833055607604ed8 +$(package)_qttranslations_sha256_hash=c4bd6db6e426965c6f8824c54e81f68bbd61e2bae1bcadc328c6e81c45902a0d $(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)_qttools_file_name) define $(package)_set_vars $(package)_config_opts_release = -release -$(package)_config_opts_debug = -debug -$(package)_config_opts += -bindir $(build_prefix)/bin -$(package)_config_opts += -c++std c++11 -$(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_debug = -debug +$(package)_config_opts += -opensource -confirm-license +$(package)_config_opts += -no-audio-backend $(package)_config_opts += -no-glib $(package)_config_opts += -no-icu +$(package)_config_opts += -no-cups $(package)_config_opts += -no-iconv -$(package)_config_opts += -no-kms -$(package)_config_opts += -no-linuxfb -$(package)_config_opts += -no-libudev -$(package)_config_opts += -no-mtdev -$(package)_config_opts += -no-openvg -$(package)_config_opts += -no-reduce-relocations +$(package)_config_opts += -no-gif +$(package)_config_opts += -no-freetype +$(package)_config_opts += -no-nis +$(package)_config_opts += -no-pch $(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-ibase $(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-sqlite $(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 += -qt-libpng -$(package)_config_opts += -qt-libjpeg -$(package)_config_opts += -qt-pcre -$(package)_config_opts += -system-zlib +$(package)_config_opts += -hostprefix $(build_prefix) +$(package)_config_opts += -bindir $(build_prefix)/bin +$(package)_config_opts += -no-c++11 +$(package)_config_opts += -openssl-linked +$(package)_config_opts += -v $(package)_config_opts += -static $(package)_config_opts += -silent -$(package)_config_opts += -v -$(package)_config_opts += -no-feature-printer -$(package)_config_opts += -no-feature-printdialog -$(package)_config_opts += -no-feature-concurrent -$(package)_config_opts += -no-feature-xml +$(package)_config_opts += -pkg-config +$(package)_config_opts += -qt-libpng +$(package)_config_opts += -qt-libjpeg +$(package)_config_opts += -qt-zlib +$(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) $(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) endif -$(package)_config_opts_linux = -qt-xkbcommon-x11 +$(package)_config_opts_linux = -qt-xkbcommon $(package)_config_opts_linux += -qt-xcb $(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 += -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_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)_build_env = QT_RCC_TEST=1 -$(package)_build_env += QT_RCC_SOURCE_DATE_OVERRIDE=1 endef define $(package)_fetch_cmds @@ -119,33 +120,24 @@ define $(package)_extract_cmds endef 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 "/updateqm.depends =/d" qttranslations/translations/translations.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/src_plugins.depends = src_sql src_xml src_network/src_plugins.depends = src_xml 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/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 &&\ 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/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ 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++ && \ - sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch &&\ - patch -p1 -i $($(package)_patch_dir)/fix_configure_mac.patch &&\ - patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch &&\ - patch -p1 -i $($(package)_patch_dir)/fix_rcc_determinism.patch &&\ - patch -p1 -i $($(package)_patch_dir)/xkb-default.patch &&\ - echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.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 + patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch && \ + patch -p1 < $($(package)_patch_dir)/mingw-uuidof.patch && \ + patch -p1 < $($(package)_patch_dir)/pidlist_absolute.patch && \ + echo "QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ + echo "QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ + echo "QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ + sed -i.old "s|QMAKE_CFLAGS = |QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ + sed -i.old "s|QMAKE_LFLAGS = |QMAKE_LFLAGS = $($(package)_ldflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ + sed -i.old "s|QMAKE_CXXFLAGS = |QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf endef define $(package)_config_cmds @@ -153,26 +145,21 @@ define $(package)_config_cmds export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \ export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ ./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 && \ cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \ - cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. && \ - cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile && \ - cd ../lupdate/ && ../../../../qtbase/bin/qmake lupdate.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 endef define $(package)_build_cmds $(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \ $(MAKE) -C ../qttools/src/linguist/lrelease && \ - $(MAKE) -C ../qttools/src/linguist/lupdate && \ $(MAKE) -C ../qttranslations endef 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/lupdate INSTALL_ROOT=$($(package)_staging_dir) install_target && \ $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \ 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; \ diff --git a/depends/packages/qt46.mk b/depends/packages/qt46.mk new file mode 100644 index 000000000..8fb30a5c4 --- /dev/null +++ b/depends/packages/qt46.mk @@ -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 diff --git a/depends/packages/xextproto.mk b/depends/packages/xextproto.mk index 7065237bd..98a11eb49 100644 --- a/depends/packages/xextproto.mk +++ b/depends/packages/xextproto.mk @@ -4,10 +4,6 @@ $(package)_download_path=http://xorg.freedesktop.org/releases/individual/proto $(package)_file_name=$(package)-$($(package)_version).tar.bz2 $(package)_sha256_hash=f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0 -define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . -endef - define $(package)_set_vars $(package)_config_opts=--disable-shared endef diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index dfbc50580..7b866e9c0 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -1,20 +1,12 @@ package=zeromq -$(package)_version=4.3.1 -$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ +$(package)_version=4.0.7 +$(package)_download_path=http://download.zeromq.org $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb -$(package)_patches=0001-fix-build-with-older-mingw64.patch 0002-disable-pthread_set_name_np.patch +$(package)_sha256_hash=e00b2967e074990d0538361cc79084a0a92892df2c6e7585da34e4c61ee47b03 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)_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 define $(package)_config_cmds @@ -22,14 +14,13 @@ define $(package)_config_cmds endef define $(package)_build_cmds - $(MAKE) src/libzmq.la + $(MAKE) -C src endef define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA + $(MAKE) -C src DESTDIR=$($(package)_staging_dir) install endef define $(package)_postprocess_cmds - sed -i.old "s/ -lstdc++//" lib/pkgconfig/libzmq.pc && \ rm -rf bin share endef diff --git a/depends/packages/zlib.mk b/depends/packages/zlib.mk deleted file mode 100644 index 589490800..000000000 --- a/depends/packages/zlib.mk +++ /dev/null @@ -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 - diff --git a/depends/patches/libevent/reuseaddr.patch b/depends/patches/libevent/reuseaddr.patch new file mode 100644 index 000000000..58695c11f --- /dev/null +++ b/depends/patches/libevent/reuseaddr.patch @@ -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 + } + diff --git a/depends/patches/qt/fix-xcb-include-order.patch b/depends/patches/qt/fix-xcb-include-order.patch new file mode 100644 index 000000000..ae469ea94 --- /dev/null +++ b/depends/patches/qt/fix-xcb-include-order.patch @@ -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 ++} diff --git a/depends/patches/qt/fix_configure_mac.patch b/depends/patches/qt/fix_configure_mac.patch deleted file mode 100644 index 0d7dd647d..000000000 --- a/depends/patches/qt/fix_configure_mac.patch +++ /dev/null @@ -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*) - - diff --git a/depends/patches/qt/fix_no_printer.patch b/depends/patches/qt/fix_no_printer.patch deleted file mode 100644 index f868ca257..000000000 --- a/depends/patches/qt/fix_no_printer.patch +++ /dev/null @@ -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 -+#include - - #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 diff --git a/depends/patches/qt/fix_qt_pkgconfig.patch b/depends/patches/qt/fix_qt_pkgconfig.patch deleted file mode 100644 index 34302a9f2..000000000 --- a/depends/patches/qt/fix_qt_pkgconfig.patch +++ /dev/null @@ -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: \ diff --git a/depends/patches/qt/fix_rcc_determinism.patch b/depends/patches/qt/fix_rcc_determinism.patch deleted file mode 100644 index c1b07fe23..000000000 --- a/depends/patches/qt/fix_rcc_determinism.patch +++ /dev/null @@ -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'); - } diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf index 337d0eb9c..a6d0070cc 100644 --- a/depends/patches/qt/mac-qmake.conf +++ b/depends/patches/qt/mac-qmake.conf @@ -1,5 +1,6 @@ MAKEFILE_GENERATOR = UNIX 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 include(../common/macx.conf) include(../common/gcc-base-mac.conf) @@ -10,15 +11,14 @@ QMAKE_XCODE_VERSION=4.3 QMAKE_XCODE_DEVELOPER_PATH=/Developer QMAKE_MACOSX_DEPLOYMENT_TARGET = $${MAC_MIN_VERSION} 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.SDKVersion = $${MAC_SDK_VERSION} -QMAKE_MAC_SDK.macosx.PlatformPath = /phony -QMAKE_APPLE_DEVICE_ARCHS=x86_64 -!host_build: QMAKE_CFLAGS += -target $${MAC_TARGET} -!host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS -!host_build: QMAKE_CXXFLAGS += $$QMAKE_CFLAGS -!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} -mlinker-version=$${MAC_LD64_VERSION} +QMAKE_MAC_SDK.macosx.version = $${MAC_SDK_VERSION} +QMAKE_MAC_SDK.macosx.platform_path = /phony +QMAKE_CFLAGS += -target $${MAC_TARGET} +QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS +QMAKE_LFLAGS += -target $${MAC_TARGET} -mlinker-version=$${MAC_LD64_VERSION} QMAKE_AR = $${CROSS_COMPILE}ar cq QMAKE_RANLIB=$${CROSS_COMPILE}ranlib QMAKE_LIBTOOL=$${CROSS_COMPILE}libtool diff --git a/depends/patches/qt/mingw-uuidof.patch b/depends/patches/qt/mingw-uuidof.patch new file mode 100644 index 000000000..975366e61 --- /dev/null +++ b/depends/patches/qt/mingw-uuidof.patch @@ -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 + #include + #include +-#ifndef Q_OS_WINCE ++#if !defined(Q_OS_WINCE) && (!defined(USE___UUIDOF) || (defined(USE___UUIDOF) && USE___UUIDOF == 1)) + # include + #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; + } + diff --git a/depends/patches/qt/pidlist_absolute.patch b/depends/patches/qt/pidlist_absolute.patch new file mode 100644 index 000000000..0b49c050d --- /dev/null +++ b/depends/patches/qt/pidlist_absolute.patch @@ -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())); diff --git a/depends/patches/qt/xkb-default.patch b/depends/patches/qt/xkb-default.patch deleted file mode 100644 index 165abf3e2..000000000 --- a/depends/patches/qt/xkb-default.patch +++ /dev/null @@ -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) { diff --git a/depends/patches/qt46/stlfix.patch b/depends/patches/qt46/stlfix.patch new file mode 100644 index 000000000..f8f6fb04b --- /dev/null +++ b/depends/patches/qt46/stlfix.patch @@ -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 + #include + #include ++#include + + // something mean to see if the compiler and C++ standard lib are good enough + template diff --git a/depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch b/depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch deleted file mode 100644 index a6c508fb8..000000000 --- a/depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 1a159c128c69a42d90819375c06a39994f3fbfc1 Mon Sep 17 00:00:00 2001 -From: Cory Fields -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 - #include - #include -+ -+#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 -+#include -+#endif - #include - - #if !defined __MINGW32__ --- -2.7.4 - diff --git a/depends/patches/zeromq/0002-disable-pthread_set_name_np.patch b/depends/patches/zeromq/0002-disable-pthread_set_name_np.patch deleted file mode 100644 index d220b54f3..000000000 --- a/depends/patches/zeromq/0002-disable-pthread_set_name_np.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 6e6b47d5ab381c3df3b30bb0b0a6cf210dfb1eba Mon Sep 17 00:00:00 2001 -From: Cory Fields -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 - diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 08ff4d6ac..c58817078 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -1,13 +1,13 @@ dist_man1_MANS= if BUILD_BITCOIND - dist_man1_MANS+=bitcoind.1 + dist_man1_MANS+=lbrycrdd.1 endif if ENABLE_QT - dist_man1_MANS+=bitcoin-qt.1 + dist_man1_MANS+=lbrycrd-qt.1 endif if BUILD_BITCOIN_UTILS - dist_man1_MANS+=bitcoin-cli.1 bitcoin-tx.1 + dist_man1_MANS+=lbrycrd-cli.1 lbrycrd-tx.1 endif diff --git a/doc/man/bitcoin-cli.1 b/doc/man/lbrycrd-cli.1 similarity index 80% rename from doc/man/bitcoin-cli.1 rename to doc/man/lbrycrd-cli.1 index 9f8cb5caf..de289a6f8 100644 --- a/doc/man/bitcoin-cli.1 +++ b/doc/man/lbrycrd-cli.1 @@ -1,21 +1,21 @@ .\" 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 -bitcoin-cli \- manual page for bitcoin-cli v0.17.1.0 +lbrycrd-cli \- manual page for lbrycrd-cli v0.17.1.0 .SH SYNOPSIS -.B bitcoin-cli -[\fI\,options\/\fR] \fI\, \/\fR[\fI\,params\/\fR] \fI\,Send command to Bitcoin Core\/\fR +.B lbrycrd-cli +[\fI\,options\/\fR] \fI\, \/\fR[\fI\,params\/\fR] \fI\,Send command to LBRYcrd Core\/\fR .br -.B bitcoin-cli -[\fI\,options\/\fR] \fI\,-named \/\fR[\fI\,name=value\/\fR]... \fI\,Send command to Bitcoin Core (with named arguments)\/\fR +.B lbrycrd-cli +[\fI\,options\/\fR] \fI\,-named \/\fR[\fI\,name=value\/\fR]... \fI\,Send command to LBRYcrd Core (with named arguments)\/\fR .br -.B bitcoin-cli +.B lbrycrd-cli [\fI\,options\/\fR] \fI\,help List commands\/\fR .br -.B bitcoin-cli +.B lbrycrd-cli [\fI\,options\/\fR] \fI\,help Get help for a command\/\fR .SH DESCRIPTION -Bitcoin Core RPC client version v0.17.1.0 +LBRYcrd Core RPC client version v0.17.1.0 .SH OPTIONS .HP \-? @@ -25,7 +25,7 @@ This help message \fB\-conf=\fR .IP Specify configuration file. Relative paths will be prefixed by datadir -location. (default: bitcoin.conf) +location. (default: lbrycrd.conf) .HP \fB\-datadir=\fR .IP @@ -76,7 +76,7 @@ Wait for RPC server to start \fB\-rpcwallet=\fR .IP 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 \fB\-stdin\fR .IP @@ -101,11 +101,11 @@ Chain selection options: .IP Use the test chain .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 - for further information about the software. -The source code is available from . +Please contribute if you find LBRYcrd Core useful. Visit + for further information about the software. +The source code is available from . This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING diff --git a/doc/man/bitcoin-qt.1 b/doc/man/lbrycrd-qt.1 similarity index 97% rename from doc/man/bitcoin-qt.1 rename to doc/man/lbrycrd-qt.1 index a94bd84b3..951fc0697 100644 --- a/doc/man/bitcoin-qt.1 +++ b/doc/man/lbrycrd-qt.1 @@ -1,12 +1,12 @@ .\" 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 -bitcoin-qt \- manual page for bitcoin-qt v0.17.1.0 +lbrycrd-qt \- manual page for lbrycrd-qt v0.17.1.0 .SH SYNOPSIS -.B bitcoin-qt +.B lbrycrd-qt [\fI\,command-line options\/\fR] .SH DESCRIPTION -Bitcoin Core version v0.17.1.0 (64\-bit) +LBRYcrd Core version v0.17.1.0 (64\-bit) .SH OPTIONS .HP \-? @@ -44,7 +44,7 @@ Specify blocks directory (default: /blocks) \fB\-conf=\fR .IP Specify configuration file. Relative paths will be prefixed by datadir -location. (default: bitcoin.conf) +location. (default: lbrycrd.conf) .HP \fB\-daemon\fR .IP @@ -98,7 +98,7 @@ Whether to save the mempool on shutdown and load on restart (default: 1) \fB\-pid=\fR .IP Specify pid file. Relative paths will be prefixed by a net\-specific -datadir location. (default: bitcoind.pid) +datadir location. (default: lbrycrdd.pid) .HP \fB\-prune=\fR .IP @@ -604,11 +604,11 @@ Set SSL root certificates for payment request (default: \fB\-system\-\fR) .IP Show splash screen on startup (default: 1) .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 - for further information about the software. -The source code is available from . +Please contribute if you find LBRYcrd Core useful. Visit + for further information about the software. +The source code is available from . This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING diff --git a/doc/man/bitcoin-tx.1 b/doc/man/lbrycrd-tx.1 similarity index 82% rename from doc/man/bitcoin-tx.1 rename to doc/man/lbrycrd-tx.1 index 10f8231c6..ecf312ea5 100644 --- a/doc/man/bitcoin-tx.1 +++ b/doc/man/lbrycrd-tx.1 @@ -1,15 +1,15 @@ .\" 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 -bitcoin-tx \- manual page for bitcoin-tx v0.17.1.0 +lbrycrd-tx \- manual page for lbrycrd-tx v0.17.1.0 .SH SYNOPSIS -.B bitcoin-tx -[\fI\,options\/\fR] \fI\, \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded bitcoin transaction\/\fR +.B lbrycrd-tx +[\fI\,options\/\fR] \fI\, \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded lbrycrd transaction\/\fR .br -.B bitcoin-tx -[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded bitcoin transaction\/\fR +.B lbrycrd-tx +[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded lbrycrd transaction\/\fR .SH DESCRIPTION -Bitcoin Core bitcoin\-tx utility version v0.17.1.0 +LBRYcrd Core lbrycrd\-tx utility version v0.17.1.0 .SH OPTIONS .HP \-? @@ -105,11 +105,11 @@ set=NAME:JSON\-STRING .IP Set register NAME to given JSON\-STRING .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 - for further information about the software. -The source code is available from . +Please contribute if you find LBRYcrd Core useful. Visit + for further information about the software. +The source code is available from . This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING diff --git a/doc/man/bitcoind.1 b/doc/man/lbrycrdd.1 similarity index 96% rename from doc/man/bitcoind.1 rename to doc/man/lbrycrdd.1 index 01bd67160..eb99ef777 100644 --- a/doc/man/bitcoind.1 +++ b/doc/man/lbrycrdd.1 @@ -1,12 +1,12 @@ .\" 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 -bitcoind \- manual page for bitcoind v0.17.1.0 +lbrycrdd \- manual page for lbrycrdd v0.17.1.0 .SH SYNOPSIS -.B bitcoind -[\fI\,options\/\fR] \fI\,Start Bitcoin Core Daemon\/\fR +.B lbrycrdd +[\fI\,options\/\fR] \fI\,Start LBRYcrd Core Daemon\/\fR .SH DESCRIPTION -Bitcoin Core Daemon version v0.17.1.0 +LBRYcrd Core Daemon version v0.17.1.0 .SH OPTIONS .HP \-? @@ -44,7 +44,7 @@ Specify blocks directory (default: /blocks) \fB\-conf=\fR .IP Specify configuration file. Relative paths will be prefixed by datadir -location. (default: bitcoin.conf) +location. (default: lbrycrd.conf) .HP \fB\-daemon\fR .IP @@ -98,7 +98,7 @@ Whether to save the mempool on shutdown and load on restart (default: 1) \fB\-pid=\fR .IP Specify pid file. Relative paths will be prefixed by a net\-specific -datadir location. (default: bitcoind.pid) +datadir location. (default: lbrycrdd.pid) .HP \fB\-prune=\fR .IP @@ -578,11 +578,11 @@ Username for JSON\-RPC connections .IP Accept command line and JSON\-RPC commands .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 - for further information about the software. -The source code is available from . +Please contribute if you find LBRYcrd Core useful. Visit + for further information about the software. +The source code is available from . This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING diff --git a/packaging/build_windows.sh b/packaging/build_windows.sh new file mode 100755 index 000000000..6c620bb78 --- /dev/null +++ b/packaging/build_windows.sh @@ -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" diff --git a/packaging/remove_consensus.patch b/packaging/remove_consensus.patch new file mode 100644 index 000000000..aa16a5d9e --- /dev/null +++ b/packaging/remove_consensus.patch @@ -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 = diff --git a/reproducible_build.sh b/reproducible_build.sh new file mode 100755 index 000000000..d32ecb160 --- /dev/null +++ b/reproducible_build.sh @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index d1693fa85..7981d5926 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,7 +19,7 @@ else LIBUNIVALUE = $(UNIVALUE_LIBS) 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 += $(UNIVALUE_CFLAGS) @@ -80,11 +80,11 @@ TESTS = BENCHMARKS = if BUILD_BITCOIND - bin_PROGRAMS += bitcoind + bin_PROGRAMS += lbrycrdd endif if BUILD_BITCOIN_UTILS - bin_PROGRAMS += bitcoin-cli bitcoin-tx + bin_PROGRAMS += lbrycrd-cli lbrycrd-tx endif .PHONY: FORCE check-symbols check-security @@ -102,6 +102,7 @@ BITCOIN_CORE_H = \ chainparamsseeds.h \ checkpoints.h \ checkqueue.h \ + claimtrie.h \ clientversion.h \ coins.h \ compat.h \ @@ -127,12 +128,14 @@ BITCOIN_CORE_H = \ key.h \ key_io.h \ keystore.h \ + lbry.h \ dbwrapper.h \ limitedmap.h \ logging.h \ memusage.h \ merkleblock.h \ miner.h \ + nameclaim.h \ net.h \ net_processing.h \ netaddress.h \ @@ -178,10 +181,12 @@ BITCOIN_CORE_H = \ txdb.h \ txmempool.h \ ui_interface.h \ + uint256.h \ undo.h \ util.h \ utilmemory.h \ utilmoneystr.h \ + utilstrencodings.h \ utiltime.h \ validation.h \ validationinterface.h \ @@ -221,6 +226,8 @@ libbitcoin_server_a_SOURCES = \ blockencodings.cpp \ chain.cpp \ checkpoints.cpp \ + claimtrie.cpp \ + claimtrieforks.cpp \ consensus/tx_verify.cpp \ httprpc.cpp \ httpserver.cpp \ @@ -228,8 +235,10 @@ libbitcoin_server_a_SOURCES = \ index/txindex.cpp \ init.cpp \ dbwrapper.cpp \ + lbry.cpp \ merkleblock.cpp \ miner.cpp \ + nameclaim.cpp \ net.cpp \ net_processing.cpp \ noui.cpp \ @@ -240,6 +249,7 @@ libbitcoin_server_a_SOURCES = \ pow.cpp \ rest.cpp \ rpc/blockchain.cpp \ + rpc/claimtrie.cpp \ rpc/mining.cpp \ rpc/misc.cpp \ rpc/net.cpp \ @@ -253,6 +263,8 @@ libbitcoin_server_a_SOURCES = \ txdb.cpp \ txmempool.cpp \ ui_interface.cpp \ + uint256.cpp \ + utilstrencodings.cpp \ validation.cpp \ validationinterface.cpp \ versionbits.cpp \ @@ -383,6 +395,7 @@ libbitcoin_common_a_SOURCES = \ key.cpp \ key_io.cpp \ keystore.cpp \ + nameclaim.cpp \ netaddress.cpp \ netbase.cpp \ policy/feerate.cpp \ @@ -399,7 +412,7 @@ libbitcoin_common_a_SOURCES = \ # This library *must* be included to make sure that the glibc # backward-compatibility objects and their sanity checks are linked. 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 = \ support/lockedpool.cpp \ chainparamsbase.cpp \ @@ -416,6 +429,7 @@ libbitcoin_util_a_SOURCES = \ support/cleanse.cpp \ sync.cpp \ threadinterrupt.cpp \ + uint256.cpp \ util.cpp \ utilmoneystr.cpp \ utilstrencodings.cpp \ @@ -427,7 +441,7 @@ libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp AM_LDFLAGS += $(COMPAT_LDFLAGS) 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_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_cli_a_SOURCES = \ @@ -438,16 +452,16 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h # # bitcoind binary # -bitcoind_SOURCES = bitcoind.cpp -bitcoind_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -bitcoind_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +lbrycrdd_SOURCES = bitcoind.cpp +lbrycrdd_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) +lbrycrdd_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +lbrycrdd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) if TARGET_WINDOWS -bitcoind_SOURCES += bitcoind-res.rc +lbrycrdd_SOURCES += bitcoind-res.rc endif -bitcoind_LDADD = \ +lbrycrdd_LDADD = \ $(LIBBITCOIN_SERVER) \ $(LIBBITCOIN_WALLET) \ $(LIBBITCOIN_COMMON) \ @@ -461,38 +475,38 @@ bitcoind_LDADD = \ $(LIBMEMENV) \ $(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 # -bitcoin_cli_SOURCES = bitcoin-cli.cpp -bitcoin_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) -bitcoin_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +# lbrycrd-cli binary # +lbrycrd_cli_SOURCES = bitcoin-cli.cpp +lbrycrd_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) +lbrycrd_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +lbrycrd_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) if TARGET_WINDOWS -bitcoin_cli_SOURCES += bitcoin-cli-res.rc +lbrycrd_cli_SOURCES += bitcoin-cli-res.rc endif -bitcoin_cli_LDADD = \ +lbrycrd_cli_LDADD = \ $(LIBBITCOIN_CLI) \ $(LIBUNIVALUE) \ $(LIBBITCOIN_UTIL) \ $(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_SOURCES = bitcoin-tx.cpp -bitcoin_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -bitcoin_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +lbrycrd_tx_SOURCES = bitcoin-tx.cpp +lbrycrd_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) +lbrycrd_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +lbrycrd_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) if TARGET_WINDOWS -bitcoin_tx_SOURCES += bitcoin-tx-res.rc +lbrycrd_tx_SOURCES += bitcoin-tx-res.rc endif -bitcoin_tx_LDADD = \ +lbrycrd_tx_LDADD = \ $(LIBUNIVALUE) \ $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_UTIL) \ @@ -500,7 +514,7 @@ bitcoin_tx_LDADD = \ $(LIBBITCOIN_CRYPTO) \ $(LIBSECP256K1) -bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) +lbrycrd_tx_LDADD += $(BOOST_LIBS) $(ICU_LIBS) $(CRYPTO_LIBS) # # bitcoinconsensus library # diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index f5293585a..34814781e 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -55,7 +55,7 @@ if ENABLE_WALLET bench_bench_bitcoin_SOURCES += bench/coin_selection.cpp 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) CLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno $(GENERATED_BENCH_FILES) diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index c7a196313..98371539a 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -2,7 +2,7 @@ # Distributed under the MIT software license, see the accompanying # 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 # bitcoin qt core # @@ -366,7 +366,7 @@ BITCOIN_RC = qt/res/bitcoin-qt-res.rc BITCOIN_QT_INCLUDES = -DQT_NO_KEYWORDS 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_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 # before anything else. $(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. #This makes sure it's done. $(QT_MOC): $(PROTOBUF_H) $(QT_MOC_CPP): $(PROTOBUF_H) -# bitcoin-qt binary # -qt_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ +# lbrycrd-qt binary # +qt_lbrycrd_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ $(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 - qt_bitcoin_qt_SOURCES += $(BITCOIN_MM) + qt_lbrycrd_qt_SOURCES += $(BITCOIN_MM) endif if TARGET_WINDOWS - qt_bitcoin_qt_SOURCES += $(BITCOIN_RC) + qt_lbrycrd_qt_SOURCES += $(BITCOIN_RC) endif -qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER) +qt_lbrycrd_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER) if ENABLE_WALLET -qt_bitcoin_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET) +qt_lbrycrd_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET) endif if ENABLE_ZMQ -qt_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) +qt_lbrycrd_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif -qt_bitcoin_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) \ +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) $(ICU_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \ $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) -qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -qt_bitcoin_qt_LIBTOOLFLAGS = $(AM_LIBTOOLFLAGS) --tag CXX +qt_lbrycrd_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +qt_lbrycrd_qt_LIBTOOLFLAGS = $(AM_LIBTOOLFLAGS) --tag CXX #locale/foo.ts -> locale/foo.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) 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 @test -f $(UIC) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 4b14212b2..450e9faf7 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -2,8 +2,8 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -bin_PROGRAMS += qt/test/test_bitcoin-qt -TESTS += qt/test/test_bitcoin-qt +bin_PROGRAMS += qt/test/test_lbrycrd-qt +TESTS += qt/test/test_lbrycrd-qt TEST_QT_MOC_CPP = \ qt/test/moc_compattests.cpp \ @@ -33,10 +33,10 @@ TEST_BITCOIN_CPP = \ 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_test_test_bitcoin_qt_SOURCES = \ +qt_test_test_lbrycrd_qt_SOURCES = \ qt/test/compattests.cpp \ qt/test/rpcnestedtests.cpp \ qt/test/test_main.cpp \ @@ -46,37 +46,37 @@ qt_test_test_bitcoin_qt_SOURCES = \ $(TEST_BITCOIN_CPP) \ $(TEST_BITCOIN_H) if ENABLE_WALLET -qt_test_test_bitcoin_qt_SOURCES += \ +qt_test_test_lbrycrd_qt_SOURCES += \ qt/test/addressbooktests.cpp \ qt/test/paymentservertests.cpp \ qt/test/wallettests.cpp \ wallet/test/wallet_test_fixture.cpp 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 -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET) +qt_test_test_lbrycrd_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET) endif if ENABLE_ZMQ -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) +qt_test_test_lbrycrd_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) 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) \ - $(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) -qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -qt_test_test_bitcoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS) +qt_test_test_lbrycrd_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +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 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=$^ -test_bitcoin_qt_clean: FORCE - rm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_bitcoin_qt_OBJECTS) +test_lbrycrd_qt_clean: FORCE + rm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_lbrycrd_qt_OBJECTS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 65672f15e..dc21c0507 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -2,13 +2,14 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -bin_PROGRAMS += test/test_bitcoin -noinst_PROGRAMS += test/test_bitcoin_fuzzy +bin_PROGRAMS += test/test_lbrycrd +noinst_PROGRAMS += test/test_lbrycrd_fuzzy TEST_SRCDIR = test -TEST_BINARY=test/test_bitcoin$(EXEEXT) +TEST_BINARY=test/test_lbrycrd$(EXEEXT) JSON_TEST_FILES = \ test/data/base58_encode_decode.json \ + test/data/base58_keys_valid.json \ test/data/key_io_valid.json \ test/data/key_io_invalid.json \ test/data/script_tests.json \ @@ -40,6 +41,7 @@ BITCOIN_TESTS =\ test/blockchain_tests.cpp \ test/blockencodings_tests.cpp \ test/bloom_tests.cpp \ + test/Checkpoints_tests.cpp \ test/bswap_tests.cpp \ test/checkqueue_tests.cpp \ test/coins_tests.cpp \ @@ -62,6 +64,9 @@ BITCOIN_TESTS =\ test/miner_tests.cpp \ test/multisig_tests.cpp \ test/net_tests.cpp \ + test/claimtriecache_tests.cpp \ + test/claimtriebranching_tests.cpp \ + test/nameclaim_tests.cpp \ test/netbase_tests.cpp \ test/pmt_tests.cpp \ test/policyestimator_tests.cpp \ @@ -107,32 +112,32 @@ BITCOIN_TEST_SUITE += \ wallet/test/wallet_test_fixture.h endif -test_test_bitcoin_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_bitcoin_LDADD = +test_test_lbrycrd_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) +test_test_lbrycrd_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(EVENT_CFLAGS) $(ICU_CPPFLAGS) +test_test_lbrycrd_LDADD = if ENABLE_WALLET -test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) +test_test_lbrycrd_LDADD += $(LIBBITCOIN_WALLET) 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) -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_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static +test_test_lbrycrd_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(CRYPTO_LIBS) $(ICU_LIBS) $(MINIUPNPC_LIBS) +test_test_lbrycrd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static if ENABLE_ZMQ -test_test_bitcoin_LDADD += $(ZMQ_LIBS) +test_test_lbrycrd_LDADD += $(ZMQ_LIBS) endif # # test_bitcoin_fuzzy binary # -test_test_bitcoin_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp -test_test_bitcoin_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -test_test_bitcoin_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -test_test_bitcoin_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +test_test_lbrycrd_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp +test_test_lbrycrd_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) +test_test_lbrycrd_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +test_test_lbrycrd_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -test_test_bitcoin_fuzzy_LDADD = \ +test_test_lbrycrd_fuzzy_LDADD = \ $(LIBUNIVALUE) \ $(LIBBITCOIN_SERVER) \ $(LIBBITCOIN_COMMON) \ @@ -144,10 +149,10 @@ test_test_bitcoin_fuzzy_LDADD = \ $(LIBBITCOIN_CRYPTO_SHANI) \ $(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) @@ -155,13 +160,13 @@ CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES) 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=$^ -bitcoin_test_clean : FORCE - rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) +lbrycrd_test_clean : FORCE + rm -f $(CLEAN_BITCOIN_TEST) $(test_test_lbrycrd_OBJECTS) $(TEST_BINARY) check-local: $(BITCOIN_TESTS:.cpp=.cpp.test) @echo "Running test/util/bitcoin-util-test.py..." @@ -186,3 +191,12 @@ endif echo "};};"; \ } > "$@.new" && mv -f "$@.new" "$@" @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 $@" + diff --git a/src/amount.h b/src/amount.h index 2bd367cba..fc32631e5 100644 --- a/src/amount.h +++ b/src/amount.h @@ -23,7 +23,7 @@ static const CAmount CENT = 1000000; * 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. * */ -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); } #endif // BITCOIN_AMOUNT_H diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index 804120961..bc99b8cdc 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -41,7 +41,8 @@ static CTxIn MineBlock(const CScript& coinbase_scriptPubKey) auto block = PrepareBlock(coinbase_scriptPubKey); while (!CheckProofOfWork(block->GetHash(), block->nBits, Params().GetConsensus())) { - assert(++block->nNonce); + ++block->nNonce; + assert(block->nNonce); } bool processed{ProcessNewBlock(Params(), block, true, nullptr)}; diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index db713f58d..2684399cf 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -107,10 +107,10 @@ static int AppInitRPC(int argc, char* argv[]) std::string strUsage = PACKAGE_NAME " RPC client version " + FormatFullVersion() + "\n"; if (!gArgs.IsArgSet("-version")) { strUsage += "\n" - "Usage: bitcoin-cli [options] [params] Send command to " PACKAGE_NAME "\n" - "or: bitcoin-cli [options] -named [name=value]... Send command to " PACKAGE_NAME " (with named arguments)\n" - "or: bitcoin-cli [options] help List commands\n" - "or: bitcoin-cli [options] help Get help for a command\n"; + "Usage: lbrycrd-cli [options] [params] Send command to " PACKAGE_NAME "\n" + "or: lbrycrd-cli [options] -named [name=value]... Send command to " PACKAGE_NAME " (with named arguments)\n" + "or: lbrycrd-cli [options] help List commands\n" + "or: lbrycrd-cli [options] help Get help for a command\n"; strUsage += "\n" + gArgs.GetHelpMessage(); } @@ -470,7 +470,7 @@ static int CommandLineRPC(int argc, char *argv[]) strPrint += "error message:\n"+errMsg.get_str(); if (errCode.isNum() && errCode.get_int() == RPC_WALLET_NOT_SPECIFIED) { - strPrint += "\nTry adding \"-rpcwallet=\" option to bitcoin-cli command line."; + strPrint += "\nTry adding \"-rpcwallet=\" option to lbrycrd-cli command line."; } } } else { diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 5fef4724c..f2bdeba7c 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -98,9 +98,9 @@ static int AppInitRawTx(int argc, char* argv[]) if (argc < 2 || HelpRequested(gArgs)) { // First part of help message is specific to this utility - std::string strUsage = PACKAGE_NAME " bitcoin-tx utility version " + FormatFullVersion() + "\n\n" + - "Usage: bitcoin-tx [options] [commands] Update hex-encoded bitcoin transaction\n" + - "or: bitcoin-tx [options] -create [commands] Create hex-encoded bitcoin transaction\n" + + std::string strUsage = PACKAGE_NAME " lbrycrd-tx utility version " + FormatFullVersion() + "\n\n" + + "Usage: lbrycrd-tx [options] [commands] Update hex-encoded lbrycrd transaction\n" + + "or: lbrycrd-tx [options] -create [commands] Create hex-encoded lbrycrd transaction\n" + "\n"; strUsage += gArgs.GetHelpMessage(); diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 06f862242..2da24e5e9 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -79,7 +79,7 @@ static bool AppInit(int argc, char* argv[]) } else { - strUsage += "\nUsage: bitcoind [options] Start " PACKAGE_NAME " Daemon\n"; + strUsage += "\nUsage: lbrycrdd [options] Start " PACKAGE_NAME " Daemon\n"; strUsage += "\n" + gArgs.GetHelpMessage(); } @@ -109,7 +109,7 @@ static bool AppInit(int argc, char* argv[]) // Error out when loose non-argument tokens are encountered on command line for (int i = 1; i < argc; i++) { 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; } } @@ -141,7 +141,7 @@ static bool AppInit(int argc, char* argv[]) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif - fprintf(stdout, "Bitcoin server starting\n"); + fprintf(stdout, "LBRYcrd server starting\n"); // Daemonize if (daemon(1, 0)) { // don't chdir (1), do close FDs (0) diff --git a/src/chain.h b/src/chain.h index 01011d54f..9aa305444 100644 --- a/src/chain.h +++ b/src/chain.h @@ -209,6 +209,7 @@ public: //! block header int32_t nVersion; uint256 hashMerkleRoot; + uint256 hashClaimTrie; uint32_t nTime; uint32_t nBits; uint32_t nNonce; @@ -237,6 +238,7 @@ public: nVersion = 0; hashMerkleRoot = uint256(); + hashClaimTrie = uint256(); nTime = 0; nBits = 0; nNonce = 0; @@ -253,6 +255,7 @@ public: nVersion = block.nVersion; hashMerkleRoot = block.hashMerkleRoot; + hashClaimTrie = block.hashClaimTrie; nTime = block.nTime; nBits = block.nBits; nNonce = block.nNonce; @@ -283,6 +286,7 @@ public: if (pprev) block.hashPrevBlock = pprev->GetBlockHash(); block.hashMerkleRoot = hashMerkleRoot; + block.hashClaimTrie = hashClaimTrie; block.nTime = nTime; block.nBits = nBits; block.nNonce = nNonce; @@ -294,6 +298,11 @@ public: return *phashBlock; } + uint256 GetBlockPoWHash() const + { + return GetBlockHeader().GetPoWHash(); + } + int64_t GetBlockTime() const { return (int64_t)nTime; @@ -322,9 +331,10 @@ public: 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, hashMerkleRoot.ToString(), + hashClaimTrie.ToString(), GetBlockHash().ToString()); } @@ -402,6 +412,7 @@ public: READWRITE(this->nVersion); READWRITE(hashPrev); READWRITE(hashMerkleRoot); + READWRITE(hashClaimTrie); READWRITE(nTime); READWRITE(nBits); READWRITE(nNonce); @@ -413,19 +424,20 @@ public: block.nVersion = nVersion; block.hashPrevBlock = hashPrev; block.hashMerkleRoot = hashMerkleRoot; + block.hashClaimTrie = hashClaimTrie; block.nTime = nTime; block.nBits = nBits; block.nNonce = nNonce; return block.GetHash(); } - std::string ToString() const { std::string str = "CDiskBlockIndex("; str += CBlockIndex::ToString(); - str += strprintf("\n hashBlock=%s, hashPrev=%s)", + str += strprintf("\n hashBlock=%s, hashClaimTrie=%s, hashPrev=%s)", GetBlockHash().ToString(), + hashClaimTrie.ToString(), hashPrev.ToString()); return str; } diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 93bb3e764..d542fde49 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -14,6 +14,38 @@ #include +//#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) { CMutableTransaction txNew; @@ -22,6 +54,9 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesi txNew.vout.resize(1); txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp)); 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; CBlock genesis; @@ -32,6 +67,21 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesi genesis.vtx.push_back(MakeTransactionRef(std::move(txNew))); genesis.hashPrevBlock.SetNull(); 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; } @@ -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) { - const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"; - const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG; + const char* pszTimestamp = "insert timestamp string";//"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"; + const CScript genesisOutputScript = CScript() << OP_DUP << OP_HASH160 << ParseHex("345991dbf57bfb014b87006acdfafbfc5fe8292f") << OP_EQUALVERIFY << OP_CHECKSIG; return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward); } @@ -73,16 +123,26 @@ void CChainParams::UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64 class CMainParams : public CChainParams { public: CMainParams() { - strNetworkID = "main"; - consensus.nSubsidyHalvingInterval = 210000; + strNetworkID = "lbrycrd"; + consensus.nSubsidyLevelInterval = 1<<5; + consensus.nMajorityEnforceBlockUpgrade = 750; + consensus.nMajorityRejectBlockOutdated = 950; + consensus.nMajorityWindow = 1000; consensus.BIP16Exception = uint256S("0x00000000000002dc756eebf4f49723ed8d30cc28a5f108eb94b1ba88ac4f9c22"); - consensus.BIP34Height = 227931; - consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8"); - consensus.BIP65Height = 388381; // 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0 - consensus.BIP66Height = 363725; // 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931 - consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks - consensus.nPowTargetSpacing = 10 * 60; + consensus.BIP34Height = 1; + consensus.BIP34Hash = uint256S("0xdecb9e2cca03a419fd9cca0cb2b1d5ad11b088f22f8f38556d93ac4358b86c24"); + // FIXME: adjust heights + consensus.BIP65Height = 600000; + consensus.BIP66Height = 600000; + consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + 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.fPowNoRetargeting = false; consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016 @@ -98,82 +158,73 @@ public: // Deployment of SegWit (BIP141, BIP143, and BIP147) consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1; - consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1479168000; // November 15th, 2016. - consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1510704000; // November 15th, 2017. + consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1547942400; // Jan 20, 2019 + consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1548288000; // Jan 24, 2019 // 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. - 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 characters are rarely used upper ASCII, not valid as UTF-8, and produce * a large 32-bit integer with any alignment. */ - pchMessageStart[0] = 0xf9; - pchMessageStart[1] = 0xbe; - pchMessageStart[2] = 0xb4; - pchMessageStart[3] = 0xd9; - nDefaultPort = 8333; + pchMessageStart[0] = 0xfa; + pchMessageStart[1] = 0xe4; + pchMessageStart[2] = 0xaa; + pchMessageStart[3] = 0xf1; + nDefaultPort = 9246; nPruneAfterHeight = 100000; - genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN); + genesis = CreateGenesisBlock(1446058291, MAINNET_GENESIS_NONCE, 0x1f00ffff, 1, 400000000 * COIN); consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f")); - assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")); +#ifdef FIND_GENESIS + 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 - // possible options. - // This is fine at runtime as we'll fall back to using them as a oneshot if they don't support the - // 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 + vSeeds.emplace_back("dnsseed1.lbry.io"); // lbry.io + vSeeds.emplace_back("dnsseed2.lbry.io"); // lbry.io + vSeeds.emplace_back("dnsseed3.lbry.io"); // lbry.io - base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,0); - base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,5); - base58Prefixes[SECRET_KEY] = std::vector(1,128); + base58Prefixes[PUBKEY_ADDRESS] = std::vector(1, 0x55); + base58Prefixes[SCRIPT_ADDRESS] = std::vector(1, 0x7a); + base58Prefixes[SECRET_KEY] = std::vector(1, 0x1c); base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E}; base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4}; + vFixedSeeds = std::vector(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); + bech32_hrp = "bc"; vFixedSeeds = std::vector(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); + fMiningRequiresPeers = true; fDefaultConsistencyChecks = false; fRequireStandard = true; fMineBlocksOnDemand = false; checkpointData = { { - { 11111, uint256S("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")}, - { 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")}, + { 4000, uint256S("0xa6bbb48f5343eb9b0287c22f3ea8b29f36cf10794a37f8a925a894d6f4519913") }, } }; chainTxData = ChainTxData{ - // Data from rpc: getchaintxstats 4096 0000000000000000002e63058c023a9a1de233554f28c7b21380b6c9003f36a8 - /* nTime */ 1532884444, - /* nTxCount */ 331282217, - /* dTxRate */ 2.4 + 1467272478, 4146, 600.0 + /* // Data from rpc: getchaintxstats 4096 0000000000000000002e63058c023a9a1de233554f28c7b21380b6c9003f36a8 */ + /* /\* nTime *\/ 1532884444, */ + /* /\* nTxCount *\/ 331282217, */ + /* /\* dTxRate *\/ 2.4 */ }; /* disable fallback fee on mainnet */ @@ -187,16 +238,26 @@ public: class CTestNetParams : public CChainParams { public: CTestNetParams() { - strNetworkID = "test"; - consensus.nSubsidyHalvingInterval = 210000; + strNetworkID = "lbrycrdtest"; + consensus.nSubsidyLevelInterval = 1 << 5; + consensus.nMajorityEnforceBlockUpgrade = 51; + consensus.nMajorityRejectBlockOutdated = 75; + consensus.nMajorityWindow = 100; consensus.BIP16Exception = uint256S("0x00000000dd30457c001f4095d208cc1296b0eed002427aa599874af7a432b105"); consensus.BIP34Height = 21111; consensus.BIP34Hash = uint256S("0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8"); - consensus.BIP65Height = 581885; // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6 - consensus.BIP66Height = 330776; // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182 - consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks - consensus.nPowTargetSpacing = 10 * 60; + // FIXME: adjust heights + consensus.BIP65Height = 1200000; + consensus.BIP66Height = 1200000; + consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + 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.fPowNoRetargeting = false; consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains @@ -216,30 +277,32 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1493596800; // May 1st 2017 // 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. - consensus.defaultAssumeValid = uint256S("0x0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75"); //1354312 + consensus.defaultAssumeValid = uint256S("9812b0bcb7e889e58d999c897e9eaddb2dab98122ff1cfb238ebeef5351bd48c"); // 1 - pchMessageStart[0] = 0x0b; - pchMessageStart[1] = 0x11; - pchMessageStart[2] = 0x09; - pchMessageStart[3] = 0x07; - nDefaultPort = 18333; + pchMessageStart[0] = 0xfa; + pchMessageStart[1] = 0xe4; + pchMessageStart[2] = 0xaa; + pchMessageStart[3] = 0xe1; + nDefaultPort = 19246; nPruneAfterHeight = 1000; - genesis = CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 50 * COIN); + genesis = CreateGenesisBlock(1446058291, TESTNET_GENESIS_NONCE, 0x1f00ffff, 1, 400000000 * COIN); consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943")); - assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")); +#ifdef FIND_GENESIS + 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(); vSeeds.clear(); - // nodes with support for servicebits filtering should be at the top - vSeeds.emplace_back("testnet-seed.bitcoin.jonasschnelli.ch"); - 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 + vSeeds.emplace_back("testdnsseed1.lbry.io"); + vSeeds.emplace_back("testdnsseed2.lbry.io"); base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,111); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,196); @@ -251,14 +314,15 @@ public: vFixedSeeds = std::vector(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); + fMiningRequiresPeers = true; fDefaultConsistencyChecks = false; fRequireStandard = false; fMineBlocksOnDemand = false; - + fTestnetToBeDeprecatedFieldRPC = true; checkpointData = { { - {546, uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")}, + {0, uint256S(TESTNET_GENESIS_HASH)}, } }; @@ -280,18 +344,25 @@ public: class CRegTestParams : public CChainParams { public: CRegTestParams() { - strNetworkID = "regtest"; - consensus.nSubsidyHalvingInterval = 150; + strNetworkID = "lbrycrdreg"; + consensus.nSubsidyLevelInterval = 1 << 5; 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(); + // FIXME: update heights and add 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.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks - consensus.nPowTargetSpacing = 10 * 60; - consensus.fPowAllowMinDifficultyBlocks = true; - consensus.fPowNoRetargeting = true; + consensus.nPowTargetTimespan = 1;//14 * 24 * 60 * 60; // two weeks + consensus.nPowTargetSpacing = 1; + consensus.nOriginalClaimExpirationTime = 500; + 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.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016) consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; @@ -311,27 +382,34 @@ public: consensus.defaultAssumeValid = uint256S("0x00"); pchMessageStart[0] = 0xfa; - pchMessageStart[1] = 0xbf; - pchMessageStart[2] = 0xb5; - pchMessageStart[3] = 0xda; - nDefaultPort = 18444; + pchMessageStart[1] = 0xe4; + pchMessageStart[2] = 0xaa; + pchMessageStart[3] = 0xd1; + nDefaultPort = 29246; nPruneAfterHeight = 1000; - genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN); + genesis = CreateGenesisBlock(1446058291, REGTEST_GENESIS_NONCE, 0x207fffff, 1, 400000000 * COIN); consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")); - assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")); +#ifdef FIND_GENESIS + 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. vSeeds.clear(); //!< Regtest mode doesn't have any DNS seeds. + fMiningRequiresPeers = false; fDefaultConsistencyChecks = true; fRequireStandard = false; fMineBlocksOnDemand = true; + fTestnetToBeDeprecatedFieldRPC = false; checkpointData = { { - {0, uint256S("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")}, + {0, uint256S(REGTEST_GENESIS_HASH)}, } }; diff --git a/src/chainparams.h b/src/chainparams.h index 722e52ff4..ad8bcafc2 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -6,6 +6,7 @@ #ifndef BITCOIN_CHAINPARAMS_H #define BITCOIN_CHAINPARAMS_H +#include #include #include #include @@ -94,9 +95,11 @@ protected: std::string strNetworkID; CBlock genesis; std::vector vFixedSeeds; + bool fMiningRequiresPeers; bool fDefaultConsistencyChecks; bool fRequireStandard; bool fMineBlocksOnDemand; + bool fTestnetToBeDeprecatedFieldRPC; CCheckpointData checkpointData; ChainTxData chainTxData; bool m_fallback_fee_enabled; diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index e9e8ce03b..39defac66 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -11,8 +11,8 @@ #include -const std::string CBaseChainParams::MAIN = "main"; -const std::string CBaseChainParams::TESTNET = "test"; +const std::string CBaseChainParams::MAIN = "lbrycrd"; +const std::string CBaseChainParams::TESTNET = "lbrycrdtest"; const std::string CBaseChainParams::REGTEST = "regtest"; void SetupChainParamsBaseOptions() @@ -33,11 +33,11 @@ const CBaseChainParams& BaseParams() std::unique_ptr CreateBaseChainParams(const std::string& chain) { if (chain == CBaseChainParams::MAIN) - return MakeUnique("", 8332); + return MakeUnique("", 9245); else if (chain == CBaseChainParams::TESTNET) - return MakeUnique("testnet3", 18332); + return MakeUnique("testnet3", 19245); else if (chain == CBaseChainParams::REGTEST) - return MakeUnique("regtest", 18443); + return MakeUnique("regtest", 29245); else throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain)); } diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index 355df043d..0031c21c5 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -44,6 +44,12 @@ std::unique_ptr CreateBaseChainParams(const std::string& chain */ 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 * startup, except for unit tests. @@ -53,4 +59,16 @@ const CBaseChainParams& BaseParams(); /** Sets the params returned by Params() to those for the given network. */ 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 diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 4b982a471..91ad1df2c 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -8,1283 +8,11 @@ * IPv4 as well as onion addresses are wrapped inside an IPv6 address accordingly. */ static SeedSpec6 pnSeed6_main[] = { - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x02,0x84,0x64,0x2f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x01,0x61,0x04}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x27,0xae,0x74}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x2d,0x4f,0x0e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x35,0x10,0x85}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x65,0x8b,0xa6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xb2,0x4e,0x8b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xbd,0xb0,0x11}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xe4,0x40,0x47}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x08,0x12,0x26,0x7a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0d,0x73,0x60,0x3f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0e,0x02,0x7c,0x54}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0e,0x03,0xaa,0x01}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x5e,0x1c,0xfa}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x6f,0xac,0x6a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x7d,0xe0,0x54}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x98,0x00,0x6c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0xaf,0x00,0xde}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0xe5,0x10,0xea}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0xe9,0x06,0x46}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x8e,0x22,0xfd}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xab,0xcb,0x57}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xbc,0xc8,0xaa}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xd8,0x41,0x29}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xe3,0x45,0x92}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1b,0x21,0x0b,0xc1}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0x18,0x0b,0x8b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0x1c,0x0a,0x0d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0xa5,0x11,0xa4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0xb3,0xcc,0x8e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0xba,0x60,0xba}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0xd2,0xac,0x15}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0xd3,0x66,0x81}, 62734}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x22,0xd9,0x7a,0xb2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x23,0xe6,0x40,0x1d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x23,0xe7,0xe1,0x2a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x24,0x03,0xac,0x0d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x24,0xfb,0xa3,0x2a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x88,0x61,0xf6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x99,0x01,0x96}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x99,0x01,0x9d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xe4,0x5c,0x6e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xfc,0x0e,0x16}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x26,0x1b,0x65,0xe0}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x26,0x66,0x86,0x55}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x26,0x68,0xe1,0x1e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2b,0xe5,0x4c,0x26}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x28,0x84,0x39}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x2d,0x22,0x7a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x30,0xb1,0xde}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x13,0x22,0xec}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x1c,0x42,0xc4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x1c,0xcc,0x15}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x1c,0xcd,0xa1}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x1e,0x2a,0x90}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x8a,0x8b,0xc3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xa5,0xf5,0xdd}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xa6,0x81,0x9b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xa6,0xa0,0x34}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xa6,0xa0,0x38}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xbc,0x2c,0x52}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xbc,0x7e,0x4a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xe5,0xa5,0x91}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xe5,0xa8,0xc9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xe5,0xee,0xbb}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x36,0xcc,0xf6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x4a,0x80,0x8a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x5e,0xe0,0x63}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x61,0x60,0xc6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0xbb,0x24,0x30}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0xda,0x10,0x51}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0xdf,0x42,0xde}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0xfe,0x80,0x0f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x1f,0xaa,0x35}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x23,0x43,0x92}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x4c,0x60,0xe6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x52,0xb1,0x8e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x33,0x0f,0x03,0x2e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x33,0xaf,0x8d,0xf3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0x90,0x2f,0x99}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0xe8,0x26,0x7a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0x26,0xc0,0xa4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0x55,0x41,0x06}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0x5b,0xe3,0xbc}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3a,0xb4,0x24,0x0e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3b,0x6a,0xd0,0x44}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3c,0x46,0x49,0x1a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3d,0xa0,0xea,0x39}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x2b,0xc6,0x38}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x2d,0x00,0x0f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x6b,0xc8,0x1e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x85,0xc2,0x02}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x8a,0x03,0xe0}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x92,0x46,0xd8}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x40,0x4e,0xa3,0x0a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x40,0x78,0x6e,0x02}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x40,0x83,0xa0,0x1f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0x12,0xac,0x10}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0x55,0x4a,0xf2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0x6e,0x84,0x0a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0x72,0x21,0x5a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xb4,0x40,0x5f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xde,0xa4,0xbc}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0x0b,0x8b,0x43}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0x2b,0xbf,0x76}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0x3d,0x89,0x9d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0xc1,0xb8,0x0c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0xd2,0xe4,0xcb}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0xd7,0x0c,0x2b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0xfd,0x48,0x77}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0xc9,0xe4,0x06}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0xca,0x80,0x13}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0x1e,0xda,0xe2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0x3d,0x23,0xaf}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0x3d,0xab,0x16}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0x7d,0xc2,0x19}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x46,0x23,0x62,0x0c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x46,0x67,0xab,0x42}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x46,0xac,0xfc,0x1d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0x22,0x60,0x87}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0x44,0x30,0x95}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0x5d,0xa1,0xa2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xa2,0xc0,0x05}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x0b,0xae,0x47}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x32,0xf0,0x7c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x46,0x20,0xd7}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0xd3,0xc4,0xe8}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0xea,0x70,0x16}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0xfd,0xed,0x00}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x49,0xf1,0xc0,0x28}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0x0f,0xe6,0x70}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0x53,0x4f,0x34}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0x7e,0x0e,0x1b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4b,0x4c,0x89,0xa4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0x40,0xa6,0xe6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0xbf,0x4f,0x62}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x25,0xaa,0x6a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x46,0x6b,0x53}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x5f,0xe2,0xc2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x6f,0xac,0x86}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0xa3,0x88,0x88}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0xcb,0x0d,0x39}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0xef,0x25,0x0c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0xf0,0xa8,0x13}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0xf4,0xdb,0xa4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x1f,0x43,0x9c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x22,0x02,0x7e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x6c,0xbb,0xf6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x6d,0xa3,0x99}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4f,0x1c,0xcd,0x91}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4f,0x42,0x46,0x59}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4f,0x84,0xe6,0x90}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xd1,0xe0,0x4f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xd3,0xfc,0x68}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xe5,0x1c,0x3c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0x07,0x0d,0x54}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0x07,0x10,0xb6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0x12,0xe0,0x3e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0xab,0x1b,0x8a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0xbb,0x50,0xdd}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0xd9,0x70,0xe1}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0xf5,0x8d,0x06}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0x2b,0xab,0x5b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0x66,0x0a,0xfb}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0x76,0xea,0xb2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0x90,0xc5,0x5d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xa1,0x6d,0xbe}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc1,0x66,0xe4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc1,0x6d,0xc7}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc7,0x66,0x0a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xd4,0x82,0x5e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xd5,0xd0,0x10}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xd9,0x43,0x11}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xdd,0x6c,0x1b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xdd,0x85,0xae}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x37,0x82,0x1e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x4d,0x27,0x2e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x89,0x29,0x0a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x95,0x46,0x30}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x97,0xe9,0xda}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xa2,0x2b,0x9a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xa4,0x83,0xf3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xdd,0x0b,0x07}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xf3,0x80,0x0d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0x10,0x26,0xda}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0x26,0x03,0xf9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0x4b,0x1a,0xac}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xc8,0x6a,0x80}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xd4,0xfa,0xdb}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xd7,0x86,0xc3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xf5,0x1b,0xd1}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xfe,0x28,0x98}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xff,0xc1,0x1c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x0a,0x70,0xc2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x5d,0x02,0x4c}, 54382}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x5e,0xac,0x21}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x81,0x00,0x7e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x91,0xa8,0x9f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xaa,0xee,0x1a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xc3,0xe8,0xc5}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xd6,0x44,0x7a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xd6,0xeb,0x89}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xda,0x30,0x92}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xdc,0xa5,0xcd}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xe5,0x86,0x62}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xf1,0x31,0xf2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x19,0x20,0x4d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x29,0x59,0xaa}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x32,0x8f,0x2b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x3d,0x43,0xb7}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x89,0x1a,0xd2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0xb1,0xc2,0xd7}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0x9d,0xb1,0x3a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0xe0,0xa3,0x42}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0xec,0xc4,0xa9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0xf6,0x2e,0x84}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0x63,0x40,0x4c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x01,0x64,0x31}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x0a,0x9b,0x58}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x1b,0x3b,0xf6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xa3,0x84,0x49}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xb3,0xf0,0x83}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xcd,0x51,0x05}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xd4,0x4b,0x06}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xd9,0x82,0x93}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xe6,0x60,0x2a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xf8,0xac,0x0a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x2e,0x39,0x11}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0x6e,0x0b,0x65}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0xf0,0x25,0xa3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x41,0x04,0x15}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x41,0xc0,0x9f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x53,0xed,0xb9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x6e,0x7d,0x1a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x79,0xa0,0x3b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x87,0x00,0xbb}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x8f,0x6d,0x44}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xc3,0x2a,0x86}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xdd,0x46,0x89}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5c,0x23,0x84,0x05}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5c,0x2a,0x25,0x8d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5c,0x36,0x10,0x90}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5c,0x3e,0x22,0xb8}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5c,0xba,0xe7,0xf0}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0x7b,0x50,0x2f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0xaa,0x0d,0x0f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0xab,0xc9,0x44}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0xb3,0xc5,0x98}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0xbe,0xce,0x97}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0xbf,0x83,0xb1}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0xd0,0x84,0xd6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x68,0x61,0xf7}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x9c,0x23,0x08}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0xc7,0xad,0x71}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0x2a,0x02,0x71}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0x5e,0xe1,0x3d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0x9a,0xed,0x18}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0x9e,0x27,0x40}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xa3,0x47,0x7e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xa3,0x6a,0x8b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd0,0xa3,0xd6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd5,0x8f,0x0d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xe2,0x4d,0x6c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x03,0x4a,0x42}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x17,0x80,0x41}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x1b,0x08,0xf2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x1b,0x81,0x5e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x7e,0x64,0x94}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x61,0x4a,0x06,0x69}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x61,0x74,0xa0,0x66}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0x07,0x40,0xf9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0x0a,0x6a,0x31}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0x19,0xc5,0x7d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0x1d,0x07,0x67}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0x7f,0x82,0x11}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x63,0xe0,0xc0,0xc9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x65,0xbe,0xac,0xd1}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x23,0x97,0x4c}, 8334}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x4a,0xc1,0x7f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x50,0x85,0xbf}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x50,0xa8,0x39}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x63,0xa8,0x66}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xc2,0x2a,0x0a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xa8,0x65,0xcf}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xc8,0x43,0xa2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xcf,0x84,0x2a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xed,0x04,0xca}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0x9b,0x48,0x6c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xb7,0x25,0xa2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0xaf,0x03,0x12}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0xdc,0xc0,0x39}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0x3d,0x66,0x05}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xce,0xb1,0x15}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xed,0x6f,0x9c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x73,0x44,0x2f,0x52}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x74,0x58,0x4b,0x6e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x76,0x43,0xc9,0x28}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x77,0x1c,0x04,0xe6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x77,0x1c,0x82,0xd2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x78,0x1f,0x8f,0xa7}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x78,0xdc,0x0e,0x5c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x78,0xdc,0x0e,0x5d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7c,0x12,0x85,0xdc}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7e,0xcf,0x27,0x16}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x80,0x4d,0x25,0xd6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x80,0x7d,0x64,0x02}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x81,0x9e,0x4a,0xed}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x81,0xd5,0x20,0xb0}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x83,0x71,0x29,0x77}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x83,0x71,0x29,0x7d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x83,0x72,0x0a,0xe9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x83,0xbc,0x28,0xbf}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x83,0xbc,0x2a,0x24}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x86,0x00,0x70,0x5c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x86,0x03,0x1a,0xbe}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x87,0x17,0xc4,0x18}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x87,0x54,0xcf,0x04}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x88,0x3b,0x81,0x7d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x88,0x3d,0xef,0x07}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x89,0x75,0xa4,0x12}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8b,0x82,0x29,0x52}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8d,0x86,0x47,0xbc}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8d,0xd5,0x06,0x39}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8d,0xdf,0x52,0x8b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8e,0x00,0x82,0x31}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8e,0x00,0x82,0x35}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x76,0x8d,0xe8}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x94,0x42,0x3a,0x92}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x96,0x5f,0x82,0x11}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x96,0xbb,0x24,0xe9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x96,0xf9,0x4c,0x66}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x99,0x7d,0x81,0xbb}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x99,0x7d,0xe0,0x6b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9a,0x30,0xec,0xfa}, 8887}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9a,0x42,0xcf,0x7e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9b,0x8f,0x8c,0xba}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9d,0x83,0x8e,0xa4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9e,0x40,0x4f,0xb6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9e,0x55,0x5d,0xa3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9e,0x8c,0x80,0xef}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9e,0xae,0x83,0xab}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0x08,0x04,0x13}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0xd9,0x90,0x44}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0xd9,0x90,0xfc}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0xfd,0x2f,0xca}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0x9b,0x40,0xe2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xde,0x64,0x76}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xff,0xa8,0x1b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xff,0xa8,0x1e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa3,0x9e,0xe4,0x7d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa5,0xe3,0x60,0x26}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa9,0xe5,0xee,0x11}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xab,0x19,0xa5,0x91}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xab,0x21,0xb1,0x09}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xac,0x48,0xe4,0x5d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xac,0x60,0xa1,0xf4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xac,0x66,0xe4,0x96}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xac,0x76,0x88,0x62}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x2e,0x41,0x08}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xd4,0xc1,0x23}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xef,0x21,0x55}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xf3,0x40,0x30}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x73,0x81,0x25}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x0c,0x06,0x3b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x6b,0xb8,0x1d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x7b,0x0a,0xc0}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x7e,0xa7,0x0a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0xb9,0xeb,0xa3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0xdf,0x82,0xfe}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x00,0x47,0x88}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x0c,0x20,0x27}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x55,0x40,0xd4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x7c,0xa2,0xd1}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x80,0xc0,0x15}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x97,0x85,0x38}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xc1,0x60,0xc9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xf8,0xc8,0x7e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xfe,0x07,0x58}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb4,0xe9,0x6a,0xab}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb5,0xa6,0xa8,0xd2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb7,0x42,0xe3,0x46}, 12060}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb7,0x6f,0x6c,0x38}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0x46,0x21,0xbe}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0x69,0x46,0x64}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0x69,0x46,0x65}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x0c,0x07,0x26}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x15,0xd8,0x86}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x19,0x30,0xb8}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x19,0x30,0xd9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x19,0x3c,0xc7}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x1c,0x4c,0xb3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x23,0x8b,0x36}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x2c,0x4e,0xd0}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x2f,0x84,0x37}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x33,0x80,0x1b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x3b,0x64,0x6b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x43,0xaf,0x4b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x43,0xcc,0x4c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x43,0xcc,0x50}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x46,0x69,0x4a}, 8339}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x55,0x03,0x8c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x56,0x0f,0x17}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x56,0x0f,0x19}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x66,0x47,0x06}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x75,0x4a,0x15}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x79,0xad,0xdf}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x80,0x28,0x7a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x91,0x83,0xda}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x93,0xed,0xa9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xa2,0x80,0x53}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xa5,0x4c,0xdc}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xac,0xa5,0x82}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xb1,0x05,0x04}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xb7,0x83,0x4b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xba,0xd0,0xd0}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xd7,0xe0,0x16}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xe0,0x50,0x6c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xe1,0x10,0x04}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xf3,0x70,0xd6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xf4,0xc1,0x12}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xf8,0xa0,0x42}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xba,0x13,0x88,0x90}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x44,0x26,0xf3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x44,0xf0,0x59}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x86,0x06,0x54}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x86,0x4d,0x79}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x8a,0x01,0x2b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0xd9,0x09,0xa8}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbe,0x02,0x85,0x5b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbe,0xb8,0xc6,0x22}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbe,0xd3,0xcc,0x44}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x8b,0x23,0x8f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xa2,0x64,0x9c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xa2,0x65,0xfa}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xce,0xca,0x06}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xcf,0x0c,0xf4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xcf,0x0c,0xf5}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xe4,0x65,0x9d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0x70,0xc0,0x49}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0xaa,0xa6,0x0c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0x0f,0xe7,0xec}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0xa5,0x10,0x21}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0xb5,0x50,0x4d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0xba,0xa0,0xfd}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0xf7,0x0d,0x07}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0xf7,0x0d,0x20}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x00,0xcb,0x15}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x26,0xa8,0x72}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x2b,0x8d,0x1c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x5f,0xe1,0xf8}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x7b,0xe0,0x07}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x9a,0xeb,0x4f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0xa9,0x63,0x52}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0xc9,0x00,0x51}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc5,0x9b,0x06,0x2b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x2c,0xe7,0xa0}, 6333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x3a,0x66,0x23}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x89,0xca,0xaf}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x7f,0xe0,0x32}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xb6,0x81,0x1a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xbc,0xcc,0x66}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xbc,0xcc,0x9b}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xf4,0x31,0xe0}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xf9,0xe6,0x25}, 15738}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc8,0x53,0x7b,0x2e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc8,0x6d,0x43,0x47}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc8,0x7a,0x80,0xb9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xca,0x99,0xc7,0xb6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xca,0x9f,0x88,0x36}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xca,0xa8,0x10,0xe8}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcb,0x0b,0x47,0x01}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcb,0xa2,0x50,0xdb}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcb,0xb2,0x8f,0x0d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcc,0x0f,0x0b,0x04}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xce,0x7d,0xa9,0xa2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xce,0xae,0x37,0xa4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcf,0xb6,0x92,0x12}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0x5d,0x42,0xc6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0x62,0xc4,0xf9}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0x6b,0xe0,0xca}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0x6e,0x41,0x72}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0x76,0xeb,0xbe}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0x7a,0xd0,0x83}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0x7e,0x6e,0xc6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0x83,0xee,0x50}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x38,0x6c,0x51}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x49,0x96,0x84}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x4d,0xe0,0x91}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x55,0x5a,0xc2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x5c,0x65,0x1e}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x70,0x85,0x5c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0xe3,0x84,0xa7}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x0a,0x64,0xb6}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x39,0xf0,0x45}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x5b,0xcd,0x86}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x7d,0x43,0x6c}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x98,0xa1,0xaa}, 45893}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x9b,0x03,0xd8}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0xb4,0x46,0x8a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0xb9,0xe2,0xe1}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd8,0x47,0xcb,0x4f}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd8,0xc2,0xa4,0xd3}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd8,0xf0,0xa8,0xe2}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0x14,0x82,0x48}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0x17,0x09,0xb4}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0x40,0x2f,0x8a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0xa9,0x0e,0x5a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xda,0xf5,0x01,0xcd}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xdc,0x82,0x80,0x3a}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xdc,0x85,0x27,0x3d}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xde,0xef,0xc1,0x74}, 8333}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xde,0xef,0xc1,0x78}, 8333}, - {{0x20,0x01,0x00,0x00,0x41,0x37,0x9e,0x76,0x1c,0xbd,0x3b,0xc0,0xad,0xe7,0xbf,0x44}, 8333}, - {{0x20,0x01,0x00,0x00,0x41,0x37,0x9e,0x76,0x20,0x46,0x15,0x0d,0x8d,0x65,0x0d,0xe4}, 8333}, - {{0x20,0x01,0x00,0x00,0x41,0x37,0x9e,0x76,0x2c,0x99,0x3f,0x36,0xd0,0x03,0xf4,0x7a}, 8333}, - {{0x20,0x01,0x00,0x00,0x41,0x37,0x9e,0x76,0x34,0xb6,0x39,0x10,0xa3,0xdc,0x7b,0xfa}, 8333}, - {{0x20,0x01,0x00,0x00,0x41,0x37,0x9e,0x76,0x3c,0xec,0x02,0xb5,0x52,0x5b,0xfb,0x3c}, 8333}, - {{0x20,0x01,0x00,0x00,0x53,0xaa,0x06,0x4c,0x00,0xc5,0x23,0x5d,0xa1,0x0d,0x00,0xe0}, 8333}, - {{0x20,0x01,0x00,0x00,0x53,0xaa,0x06,0x4c,0x0c,0xbc,0x5a,0xce,0xa6,0x25,0x39,0xd1}, 8333}, - {{0x20,0x01,0x00,0x00,0x5e,0xf5,0x79,0xfb,0x38,0xe5,0x36,0xc1,0xd0,0xee,0x5d,0x98}, 8333}, - {{0x20,0x01,0x00,0x00,0x5e,0xf5,0x79,0xfb,0x3c,0x5c,0x0c,0x6c,0x39,0xcf,0x69,0xd3}, 8333}, - {{0x20,0x01,0x00,0x00,0x5e,0xf5,0x79,0xfb,0x08,0x96,0x0e,0xf4,0xba,0x63,0x8d,0x15}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xb8,0x10,0x6a,0x21,0x12,0xe0,0x6b,0xb8,0x81}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xb8,0x1c,0x99,0x16,0x55,0xe7,0x82,0x93,0x40}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xb8,0x20,0xcd,0x1c,0xd9,0x54,0xe6,0x5a,0x6e}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xb8,0x24,0x5e,0x02,0xb3,0xa3,0x00,0x31,0x7e}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xb8,0x28,0x14,0x21,0x5c,0x88,0xe3,0x4e,0xe0}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xb8,0x30,0xac,0x3a,0x51,0xb2,0xda,0x71,0x2d}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xb8,0x34,0xa6,0x0e,0xeb,0xc3,0xed,0x5b,0xe7}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xb8,0x0c,0x2f,0x16,0xd5,0x52,0x5a,0x10,0x7e}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xb8,0x0c,0xb1,0x25,0x57,0x43,0x1c,0xf3,0xe1}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xbd,0x10,0x56,0x29,0x0d,0xa6,0x71,0x3d,0x90}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xbd,0x18,0x65,0x14,0xfe,0xd0,0xa7,0x1f,0x72}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xbd,0x2c,0x3c,0x30,0x06,0xa4,0x86,0x93,0xc3}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xbd,0x2c,0x73,0x33,0x13,0xf2,0x1a,0x96,0xda}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xbd,0x30,0x50,0xfb,0xff,0xa2,0x50,0x33,0x86}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xbd,0x38,0x28,0x04,0x94,0xfd,0xaa,0x56,0xcd}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x6a,0xbd,0x04,0x54,0x18,0x7d,0x3e,0x75,0xb0,0x0b}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x78,0xcf,0x0c,0x2c,0x1d,0xcc,0xfa,0x42,0x41,0xa3}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x1c,0x4a,0x20,0xd4,0x4d,0xaa,0xeb,0x5a}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x1c,0xa7,0x16,0x12,0x9a,0x18,0x31,0xe5}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x24,0xc8,0x3a,0x0a,0xa6,0x8d,0xf7,0x99}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x28,0x37,0x32,0x4e,0xd0,0xcb,0x9f,0x45}, 22475}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x28,0xc1,0x36,0x1e,0xa6,0x9c,0xb0,0x99}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x30,0xfe,0x1c,0x89,0xd0,0xb4,0x4d,0x18}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x34,0x74,0x1d,0xf1,0xe7,0x32,0xe5,0xe3}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x34,0xa8,0x0f,0xb1,0x88,0xe3,0xfb,0x19}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x3c,0x19,0x3d,0x23,0xd0,0xb4,0xf8,0x31}, 18652}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x3c,0x45,0x23,0x42,0xd0,0xcb,0xd6,0xca}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x3c,0x5f,0x31,0x05,0xd0,0xb4,0x60,0xb6}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x08,0xa1,0x02,0xfb,0xd0,0xcb,0x1e,0x8f}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x00,0xa3,0x36,0xe0,0xe0,0x20,0x53,0xfa}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x90,0xd7,0x00,0xeb,0x3b,0x30,0xd0,0xa4,0x0a,0xa5}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x95,0x3c,0x10,0x4e,0x08,0xaf,0xb3,0xaa,0xf3,0x00}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x95,0x3c,0x14,0x34,0x07,0x1f,0xb8,0x50,0xba,0xb1}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x95,0x3c,0x14,0x4a,0x36,0xe8,0x51,0x9a,0xbb,0x69}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x95,0x3c,0x20,0xfc,0x26,0xef,0xed,0x26,0xc7,0x37}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x95,0x3c,0x04,0x54,0x01,0x20,0x88,0xe8,0x02,0xfb}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x95,0x3c,0x08,0x01,0x16,0x20,0xbc,0x22,0x95,0xbc}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x95,0x3c,0x08,0xa0,0x1f,0xdb,0xab,0x00,0x0b,0xc2}, 8333}, - {{0x20,0x01,0x00,0x00,0x9d,0x38,0x95,0x3c,0x0c,0xf6,0x3d,0x48,0x43,0x86,0x49,0x37}, 8333}, - {{0x20,0x01,0x13,0xd8,0x1c,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08}, 8333}, - {{0x20,0x01,0x16,0x20,0x09,0x23,0x00,0x00,0x75,0xbe,0xed,0x92,0x1a,0x01,0x06,0x41}, 8333}, - {{0x20,0x01,0x16,0x80,0x01,0x01,0x00,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x19,0x70,0x5a,0xe2,0x2b,0x00,0x30,0xbd,0x79,0x10,0x0c,0x84,0x7a,0x8f}, 8333}, - {{0x20,0x01,0x19,0x70,0x5d,0x56,0xaa,0x01,0x1e,0x75,0x08,0xff,0xfe,0xad,0xda,0x48}, 8333}, - {{0x20,0x01,0x19,0xf0,0x03,0x00,0x10,0x45,0x02,0x25,0x90,0xff,0xfe,0xc9,0x29,0xb3}, 8333}, - {{0x20,0x01,0x19,0xf0,0x00,0x05,0x1f,0x93,0x54,0x00,0x01,0xff,0xfe,0x7a,0xc6,0x5a}, 8333}, - {{0x20,0x01,0x19,0xf0,0x6c,0x01,0x04,0xbd,0x54,0x00,0x01,0xff,0xfe,0x76,0x4d,0xb6}, 8333}, - {{0x20,0x01,0x19,0xf0,0xac,0x01,0x02,0xfb,0x54,0x00,0x00,0xff,0xfe,0x5b,0xc3,0xff}, 8333}, - {{0x20,0x01,0x1a,0x48,0x00,0x07,0xaf,0x1a,0x75,0xf8,0x2c,0x47,0x32,0x85,0xd5,0x0e}, 8333}, - {{0x20,0x01,0x1a,0xf8,0x40,0x10,0xa0,0x94,0x33,0x33,0x00,0x00,0x00,0x00,0x8c,0x38}, 8333}, - {{0x20,0x01,0x1a,0xf8,0x40,0x70,0xa0,0x16,0x33,0x33,0x00,0x00,0x00,0x00,0x5a,0xfb}, 8333}, - {{0x20,0x01,0x1a,0xf8,0x47,0x00,0xa0,0x71,0x44,0x44,0x00,0x00,0x00,0x00,0xe2,0x6e}, 8333}, - {{0x20,0x01,0x02,0x00,0x00,0x00,0x88,0x01,0x50,0x54,0x00,0xff,0xfe,0xf2,0x01,0xd0}, 8333}, - {{0x20,0x01,0x41,0x28,0x61,0x35,0x20,0x10,0x02,0x1e,0x0b,0xff,0xfe,0xe8,0xa3,0xc0}, 8333}, - {{0x20,0x01,0x41,0xd0,0x10,0x00,0x1f,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x10,0x04,0x18,0xc7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x10,0x04,0x19,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 18555}, - {{0x20,0x01,0x41,0xd0,0x10,0x04,0x1f,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x10,0x08,0x2b,0xed,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0x45,0xd8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0x53,0x95,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0x85,0xd3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0x86,0x49,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0x8b,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0xa5,0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0xab,0x6b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0xd2,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0xf8,0x97,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x01,0xf9,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x02,0x34,0xb7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x02,0x49,0x75,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x02,0x5c,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x02,0x84,0xd4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x02,0xab,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x02,0xc3,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x03,0x03,0x19,0x3b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x03,0x03,0x25,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1a}, 8333}, - {{0x20,0x01,0x41,0xd0,0x03,0x03,0x41,0xdb,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 58333}, - {{0x20,0x01,0x41,0xd0,0x03,0x03,0x4c,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x03,0x03,0x05,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x03,0x03,0x67,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x03,0x03,0x68,0xcd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x06,0x02,0x17,0xa4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x06,0x02,0x18,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x06,0x02,0x03,0xb7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x06,0x02,0x08,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x06,0x02,0x0b,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x08,0x00,0x01,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x08,0x00,0x03,0xd3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0x10,0x1d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0x1b,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0x3f,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0x43,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0xbb,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0xbe,0xd3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0xc6,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0xca,0x2d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0xd4,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0x0d,0xdb,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x08,0xea,0x86,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x12,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x27,0xed,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x29,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8139}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x2b,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x40,0x5c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x42,0xdf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8312}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x4c,0x49,0x00,0x00,0x00,0x00,0x0a,0xca,0x79,0x29}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x69,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x69,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x6a,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x6c,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0x6c,0x7d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0xf2,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0a,0xf9,0xcd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0d,0x0d,0xc9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0e,0x11,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0e,0x01,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0e,0x12,0xaa,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0e,0x13,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xd0,0x00,0x0e,0x0e,0xc5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x41,0xf0,0x00,0x00,0x00,0x04,0x00,0x62,0x69,0x74,0x63,0x6f,0x69,0x6e}, 8333}, - {{0x20,0x01,0x04,0x70,0x00,0x18,0x0b,0xe4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0x1c,0x62,0xb1,0x70,0xbb,0xff,0x53,0xf1,0xed,0xbf,0x99,0xdf}, 42434}, - {{0x20,0x01,0x04,0x70,0x1f,0x06,0x15,0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0x1f,0x06,0x0c,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0x1f,0x07,0x08,0x03,0x02,0x0c,0x29,0xff,0xfe,0x2d,0x58,0x79}, 8333}, - {{0x20,0x01,0x04,0x70,0x1f,0x08,0x03,0xcc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0x1f,0x0a,0x18,0xdd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0x1f,0x15,0x11,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10}, 8333}, - {{0x20,0x01,0x04,0x70,0x1f,0x15,0x0c,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14}, 8333}, - {{0x20,0x01,0x04,0x70,0x1f,0x17,0x00,0xb5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10}, 8333}, - {{0x20,0x01,0x04,0x70,0x1f,0x1a,0x01,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0x1f,0x1b,0x05,0xa6,0x02,0x16,0x3e,0xff,0xfe,0x24,0x11,0x62}, 8333}, - {{0x20,0x01,0x04,0x70,0x00,0x28,0x03,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07}, 8333}, - {{0x20,0x01,0x04,0x70,0x00,0x41,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0x6c,0x80,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x04,0x70,0x6c,0x80,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x04,0x70,0x00,0x07,0x06,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0x00,0x07,0x0b,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0x00,0x08,0x0b,0xd3,0x4d,0x25,0xca,0x57,0xa5,0xb7,0xc6,0xc4}, 8333}, - {{0x20,0x01,0x04,0x70,0x00,0x0a,0x0c,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0xc1,0x44,0xca,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23}, 8333}, - {{0x20,0x01,0x04,0x70,0xc3,0xc4,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x02}, 8333}, - {{0x20,0x01,0x04,0x70,0xe6,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x48,0xf8,0x10,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xba}, 8333}, - {{0x20,0x01,0x48,0xf8,0x90,0x15,0x14,0x22,0x3d,0xc0,0xfc,0xf2,0x77,0x2f,0x57,0xbc}, 8333}, - {{0x20,0x01,0x4b,0xa0,0xba,0xbe,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x06,0x28,0x22,0xa0,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12}, 8333}, - {{0x20,0x01,0x06,0x38,0xa0,0x00,0x41,0x40,0x00,0x00,0x00,0x00,0xff,0xff,0x01,0x91}, 8333}, - {{0x20,0x01,0x06,0x38,0xa0,0x00,0x41,0x42,0x00,0x00,0x00,0x00,0xff,0x10,0xbe,0xd6}, 8333}, - {{0x20,0x01,0x06,0x7c,0x21,0xec,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a}, 8333}, - {{0x20,0x01,0x08,0xd8,0x09,0x0b,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x2f,0xc0}, 8333}, - {{0x20,0x01,0x08,0xd8,0x09,0x1c,0x92,0x00,0x00,0x00,0x00,0x00,0x00,0x5c,0xd4,0x25}, 8333}, - {{0x20,0x01,0x09,0x80,0x23,0x1b,0x00,0x01,0x8e,0x89,0xa5,0xff,0xfe,0xe3,0xf8,0xbe}, 8333}, - {{0x20,0x01,0x09,0x80,0xad,0xe8,0x00,0x01,0x14,0xfc,0xfd,0x6d,0x60,0x8c,0xf6,0x69}, 8333}, - {{0x20,0x01,0x09,0x81,0xbd,0xbd,0x00,0x01,0xc5,0x06,0x7d,0x38,0x4b,0x47,0xda,0x15}, 8333}, - {{0x20,0x01,0x09,0x82,0x27,0xf2,0x00,0x01,0x72,0x71,0xbc,0xff,0xfe,0x94,0xd5,0xbb}, 8333}, - {{0x20,0x01,0x09,0x84,0x26,0xb5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x09,0x84,0xae,0xc7,0x00,0x01,0xdc,0xb7,0x02,0x9a,0x7e,0xda,0xb9,0xa2}, 8333}, - {{0x20,0x01,0x09,0x85,0x79,0xaf,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35}, 8333}, - {{0x20,0x01,0x09,0x85,0xcb,0x69,0x00,0x00,0x02,0x0c,0x29,0xff,0xfe,0xaf,0xdd,0x5e}, 8333}, - {{0x20,0x01,0xb0,0x11,0x30,0x0d,0x18,0x70,0x9c,0x87,0xd4,0xff,0xfe,0x9c,0x2d,0x0f}, 8333}, - {{0x20,0x01,0xb0,0x30,0x24,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x8d}, 8333}, - {{0x20,0x01,0x0b,0xc8,0x31,0xd7,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x0b,0xc8,0x32,0x3c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x20,0x01,0x0b,0xc8,0x33,0xac,0x19,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26}, 8333}, - {{0x20,0x01,0x0b,0xc8,0x39,0x9f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x01,0x0b,0xc8,0x3d,0xc1,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x42}, 8333}, - {{0x20,0x01,0x0b,0xc8,0x44,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46,0x3b}, 8333}, - {{0x20,0x01,0x0b,0xc8,0x44,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1b,0x35}, 8333}, - {{0x20,0x01,0x0b,0xc8,0x47,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x23}, 8333}, - {{0x20,0x01,0x0d,0xa8,0x80,0x01,0x23,0x03,0x1c,0xf4,0x44,0x66,0x3f,0x1a,0x7e,0xdb}, 8333}, - {{0x20,0x01,0x0d,0xa8,0xd8,0x00,0x07,0x41,0x65,0x2d,0x52,0xdb,0x57,0x13,0x45,0x15}, 8333}, - {{0x20,0x02,0x17,0xe5,0x10,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0xe5,0x10,0xea}, 8333}, - {{0x20,0x02,0x1f,0x2b,0x8c,0xbe,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x2b,0x8c,0xbe}, 8333}, - {{0x20,0x02,0x2f,0x59,0x30,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x2f,0x59,0x30,0xf3}, 8333}, - {{0x20,0x02,0x2f,0x5a,0x56,0x2a,0x00,0x00,0x00,0x00,0x00,0x00,0x2f,0x5a,0x56,0x2a}, 8333}, - {{0x20,0x02,0x3e,0x92,0x46,0xd8,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x92,0x46,0xd8}, 8333}, - {{0x20,0x02,0x3f,0x62,0xe6,0xbb,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x62,0xe6,0xbb}, 8333}, - {{0x20,0x02,0x40,0x4e,0xa3,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x4e,0xa3,0x0a}, 8333}, - {{0x20,0x02,0x43,0xdb,0x96,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0xdb,0x96,0x16}, 8333}, - {{0x20,0x02,0x43,0xe5,0xa1,0xfa,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0xe5,0xa1,0xfa}, 8333}, - {{0x20,0x02,0x52,0x66,0x0a,0xfb,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0x66,0x0a,0xfb}, 8333}, - {{0x20,0x02,0x5d,0xbd,0x91,0xa9,0x00,0x00,0x00,0x00,0x00,0x00,0x5d,0xbd,0x91,0xa9}, 8333}, - {{0x20,0x02,0x62,0x7e,0x33,0x3d,0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x7e,0x33,0x3d}, 8333}, - {{0x20,0x02,0x6b,0x9b,0x48,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x6b,0x9b,0x48,0x6c}, 8333}, - {{0x20,0x02,0x6d,0xcb,0x7c,0xba,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0xcb,0x7c,0xba}, 8333}, - {{0x20,0x02,0x7c,0xf8,0xe3,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xf8,0xe3,0x3e}, 8333}, - {{0x20,0x02,0x8e,0x00,0x82,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x8e,0x00,0x82,0x31}, 8333}, - {{0x20,0x02,0x8e,0x00,0x82,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x8e,0x00,0x82,0x33}, 8333}, - {{0x20,0x02,0xb0,0x7e,0xa7,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x7e,0xa7,0x0a}, 8333}, - {{0x20,0x02,0xb2,0xc9,0xe6,0xfc,0x00,0x10,0x3d,0x5c,0xe3,0xad,0x08,0x13,0x9c,0x46}, 8333}, - {{0x20,0x02,0xb4,0xb2,0x36,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0xb4,0xb2,0x36,0x12}, 8333}, - {{0x20,0x02,0xb6,0x10,0x1c,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0xb6,0x10,0x1c,0xa2}, 8333}, - {{0x20,0x02,0xb6,0x10,0x1c,0xa3,0x00,0x00,0x00,0x00,0x00,0x00,0xb6,0x10,0x1c,0xa3}, 8333}, - {{0x20,0x02,0xb8,0x45,0x33,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x20,0x02,0xb9,0x46,0x69,0x4a,0x00,0x00,0x00,0x00,0x00,0x00,0xb9,0x46,0x69,0x4a}, 8339}, - {{0x20,0x02,0xb9,0x60,0x5e,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xb9,0x60,0x5e,0x18}, 8333}, - {{0x20,0x02,0xc2,0x3f,0x8f,0xc5,0x00,0x00,0x00,0x00,0x00,0x00,0xc2,0x3f,0x8f,0xc5}, 8333}, - {{0x20,0x02,0xc2,0xa5,0x10,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0xc2,0xa5,0x10,0x21}, 8333}, - {{0x20,0x02,0xc6,0x2c,0xe7,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0x2c,0xe7,0xa0}, 6333}, - {{0x20,0x02,0xca,0x99,0xc7,0xb6,0x00,0x00,0x00,0x00,0x00,0x00,0xca,0x99,0xc7,0xb6}, 8333}, - {{0x20,0x02,0xd0,0x35,0x27,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x35,0x27,0x34}, 8333}, - {{0x20,0x02,0xd0,0x6e,0x5d,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x6e,0x5d,0x1a}, 8333}, - {{0x20,0x02,0xd8,0xda,0xb9,0x49,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0xda,0xb9,0x49}, 8333}, - {{0x24,0x00,0x24,0x10,0xa9,0x60,0x48,0x00,0x18,0xbe,0xd6,0x24,0x70,0x18,0xcd,0x2f}, 8333}, - {{0x24,0x00,0x61,0x80,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x03,0xe1,0xb0,0x01}, 8333}, - {{0x24,0x00,0x61,0x80,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x5c,0xd2,0xa0,0x01}, 8333}, - {{0x24,0x00,0x61,0x80,0x00,0x00,0x00,0xd1,0x00,0x00,0x00,0x00,0x04,0xc6,0x80,0x01}, 8333}, - {{0x24,0x00,0x61,0x80,0x01,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x07,0x97,0xa0,0x01}, 8333}, - {{0x24,0x00,0x85,0x00,0x13,0x02,0x08,0x17,0x01,0x50,0x00,0x95,0x01,0x30,0x00,0x17}, 8333}, - {{0x24,0x01,0x18,0x00,0x78,0x00,0x01,0x06,0xbe,0x76,0x4e,0xff,0xfe,0x1c,0x18,0x79}, 8333}, - {{0x24,0x01,0x39,0x00,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x24,0x01,0xa4,0x00,0x32,0x00,0x56,0x00,0x3c,0x16,0x2d,0xeb,0xab,0xce,0x70,0xcd}, 8333}, - {{0x24,0x01,0xb1,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x01,0x00}, 8333}, - {{0x24,0x01,0xb1,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x01,0x02}, 8333}, - {{0x24,0x02,0x1f,0x00,0x81,0x00,0x02,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x24,0x03,0xbd,0x80,0xc0,0x00,0x00,0x01,0x01,0x03,0x02,0x02,0x02,0x16,0x01,0x82}, 8333}, - {{0x24,0x05,0x65,0x80,0xc5,0xc0,0x17,0x00,0x6c,0xd2,0xb7,0x2e,0x74,0x0e,0x43,0x11}, 8333}, - {{0x24,0x05,0x08,0x00,0x10,0x00,0x00,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0x20,0x01}, 8333}, - {{0x24,0x05,0x98,0x00,0xb5,0x60,0x09,0x6d,0x06,0x30,0xc2,0x8e,0xa7,0x9a,0xa1,0x82}, 8333}, - {{0x24,0x05,0xaa,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40}, 8333}, - {{0x24,0x09,0x00,0x10,0xca,0x20,0x1d,0xf0,0x02,0x24,0xe8,0xff,0xfe,0x1f,0x60,0xd9}, 8333}, - {{0x26,0x00,0x1f,0x16,0x06,0x25,0x0e,0x00,0x26,0x9a,0x34,0x52,0x2e,0xdf,0x10,0x11}, 8333}, - {{0x26,0x00,0x1f,0x16,0x06,0x25,0x0e,0x00,0x07,0xbc,0x58,0x79,0x44,0x63,0x15,0xdd}, 8333}, - {{0x26,0x00,0x1f,0x16,0x06,0x25,0x0e,0x00,0xa2,0x8b,0x5a,0x16,0x84,0x9c,0xfe,0x41}, 8333}, - {{0x26,0x00,0x1f,0x16,0x06,0x25,0x0e,0x00,0xa7,0x0f,0xe7,0x28,0xe8,0xe1,0x2c,0x2e}, 8333}, - {{0x26,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0xf0,0x3c,0x91,0xff,0xfe,0x0c,0x4d,0x74}, 8333}, - {{0x26,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0xf0,0x3c,0x91,0xff,0xfe,0x2b,0xbf,0x38}, 8333}, - {{0x26,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0xf0,0x3c,0x91,0xff,0xfe,0x91,0x3e,0x49}, 8333}, - {{0x26,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0xf0,0x3c,0x91,0xff,0xfe,0xb6,0x19,0xf2}, 8333}, - {{0x26,0x00,0x3c,0x01,0x00,0x00,0x00,0x00,0xf0,0x3c,0x91,0xff,0xfe,0x91,0x6a,0x29}, 8333}, - {{0x26,0x00,0x3c,0x01,0x00,0x00,0x00,0x00,0xf0,0x3c,0x91,0xff,0xfe,0xd8,0x85,0xa2}, 8333}, - {{0x26,0x00,0x3c,0x01,0x00,0x00,0x00,0x00,0xf0,0x3c,0x91,0xff,0xfe,0xd8,0xdb,0x38}, 8333}, - {{0x26,0x00,0x3c,0x03,0x00,0x00,0x00,0x00,0xf0,0x3c,0x91,0xff,0xfe,0x28,0x14,0x45}, 8333}, - {{0x26,0x01,0x01,0x47,0x43,0x00,0x0e,0x61,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0c}, 8333}, - {{0x26,0x01,0x01,0x47,0x43,0x00,0x0e,0x61,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x91}, 8333}, - {{0x26,0x01,0x01,0x86,0xc1,0x00,0x6b,0xcd,0x16,0xbd,0xce,0xa1,0x23,0x5d,0x1c,0x19}, 8333}, - {{0x26,0x01,0x01,0x8d,0x46,0x00,0x5f,0x32,0x20,0xe7,0xb3,0xff,0xfe,0xcf,0x0a,0x99}, 8333}, - {{0x26,0x01,0x02,0x40,0x46,0x01,0xec,0xee,0x30,0x9a,0xf9,0xde,0xb6,0x4d,0x87,0xdf}, 8333}, - {{0x26,0x01,0x02,0x40,0x81,0x00,0x25,0x6b,0x02,0x0c,0x29,0xff,0xfe,0x5e,0xd7,0x07}, 8333}, - {{0x26,0x01,0x06,0x46,0xc2,0x02,0x53,0x01,0x10,0x1b,0xa0,0x96,0xef,0xba,0xc1,0x0a}, 8333}, - {{0x26,0x01,0x08,0x07,0x80,0x00,0x95,0x08,0x99,0x93,0xd2,0xb3,0x00,0x1a,0x82,0x25}, 8333}, - {{0x26,0x01,0x00,0xc8,0x41,0x00,0x07,0x70,0x0c,0x37,0x80,0x7b,0x98,0xcc,0xbd,0x7e}, 8333}, - {{0x26,0x02,0x01,0x00,0x61,0x54,0xd6,0xe3,0x2c,0x91,0xd0,0xde,0xb0,0x32,0xb0,0xa4}, 8333}, - {{0x26,0x02,0x01,0x00,0x61,0x54,0xd6,0xe3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60}, 8333}, - {{0x26,0x02,0x00,0x61,0x78,0x6c,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x26,0x02,0xff,0x83,0x0f,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x75}, 8333}, - {{0x26,0x02,0xff,0x83,0x0f,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76}, 8333}, - {{0x26,0x03,0x30,0x05,0x30,0x00,0x50,0x00,0xbc,0x5a,0x72,0xac,0x36,0xe9,0x17,0x5e}, 8333}, - {{0x26,0x04,0x00,0x00,0x00,0xc1,0x01,0x00,0x6b,0xc1,0xf9,0x8a,0x97,0xf9,0x38,0x45}, 8333}, - {{0x26,0x04,0x2d,0x80,0xc8,0x08,0x85,0x7b,0x08,0xd6,0x9e,0x1c,0x71,0x31,0x4b,0xea}, 8333}, - {{0x26,0x04,0x40,0x80,0x10,0x08,0x00,0x00,0x96,0xde,0x80,0xff,0xfe,0x62,0xe6,0x50}, 8333}, - {{0x26,0x04,0x43,0x00,0x00,0x0a,0x01,0x04,0xb6,0x99,0xba,0xff,0xfe,0xaa,0x51,0x09}, 8333}, - {{0x26,0x04,0x55,0x00,0xc2,0x26,0x7f,0x00,0x2d,0x96,0xed,0x64,0xce,0x45,0x09,0xa6}, 8333}, - {{0x26,0x04,0x8d,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xad,0xf3,0x40,0x30}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xf8,0xe0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xf8,0xf0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xf9,0x00,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xf9,0x10,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xf9,0xc0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xf9,0xd0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xf9,0xe0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xfa,0x10,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xfa,0x20,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x22,0xfa,0x30,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x00,0x38,0xf0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x06,0x62,0xc0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x1a,0xc4,0xb0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x20,0x04,0x40,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x20,0x04,0x50,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x20,0x04,0x60,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x20,0x04,0xd0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x20,0x04,0xe0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x20,0x05,0x00,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x20,0x05,0x20,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x20,0x05,0x30,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x0c,0xd7,0x40,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x04,0x00,0x00,0xd1,0x00,0x00,0x00,0x00,0x07,0x29,0xb0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x08,0x00,0x00,0xa1,0x00,0x00,0x00,0x00,0x11,0xa9,0x80,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x08,0x00,0x00,0xa1,0x00,0x00,0x00,0x00,0x00,0x59,0x90,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x08,0x00,0x00,0xa1,0x00,0x00,0x00,0x00,0x0c,0xbb,0xf0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x08,0x00,0x00,0xa1,0x00,0x00,0x00,0x00,0x0e,0xe8,0xe0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x0c,0xad,0x00,0xd0,0x00,0x00,0x00,0x00,0x03,0x70,0xf0,0x01}, 8333}, - {{0x26,0x04,0xa8,0x80,0x0c,0xad,0x00,0xd0,0x00,0x00,0x00,0x00,0x0a,0x52,0x60,0x01}, 8333}, - {{0x26,0x05,0x4d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50}, 8333}, - {{0x26,0x05,0x98,0x80,0x00,0x00,0x01,0xcf,0x02,0x25,0x90,0xff,0xfe,0xc9,0x29,0xb3}, 8333}, - {{0x26,0x05,0x98,0x80,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x33}, 8333}, - {{0x26,0x05,0x98,0x80,0x02,0x01,0x00,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x4b,0x7c}, 8333}, - {{0x26,0x05,0xa0,0x00,0x4a,0x87,0x95,0x01,0xd6,0x13,0xfb,0xf8,0x1e,0x82,0x8d,0x3c}, 8333}, - {{0x26,0x05,0xa0,0x00,0xf3,0x43,0xb7,0x00,0x50,0x54,0x00,0xff,0xfe,0xa7,0x01,0x31}, 8333}, - {{0x26,0x05,0xa6,0x01,0x0a,0x41,0x1a,0x00,0x0a,0x00,0x27,0xff,0xfe,0xfc,0x47,0x59}, 8333}, - {{0x26,0x05,0xae,0x00,0x02,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x03}, 8333}, - {{0x26,0x05,0xc0,0x00,0x2a,0x0a,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02}, 8333}, - {{0x26,0x05,0xe0,0x00,0x1c,0x00,0x80,0xe8,0x98,0x4e,0xa6,0x97,0x97,0xa3,0x50,0xed}, 8333}, - {{0x26,0x05,0xe0,0x00,0x1c,0x0d,0x43,0x7b,0x50,0x54,0x00,0xff,0xfe,0x1b,0x29,0x13}, 8333}, - {{0x26,0x05,0xe0,0x00,0x90,0x93,0xa7,0x00,0x98,0x53,0x44,0x64,0x5f,0x78,0xc4,0x84}, 8333}, - {{0x26,0x05,0xf7,0x00,0x01,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x10,0x4e,0x43,0xbd}, 8333}, - {{0x26,0x05,0xf7,0x00,0x01,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x31,0x5b,0x54}, 8333}, - {{0x26,0x05,0xf7,0x00,0x01,0x00,0x0c,0x10,0x55,0x75,0x8e,0x73,0xb0,0x7c,0xbf,0x5a}, 8333}, - {{0x26,0x06,0x60,0x00,0xc1,0x49,0x88,0x30,0x50,0x54,0x00,0xff,0xfe,0x78,0x66,0xff}, 8333}, - {{0x26,0x07,0x1c,0x00,0x00,0x0a,0x00,0x06,0x3c,0x1c,0x1b,0x0d,0x0b,0xa4,0x8e,0xa9}, 8333}, - {{0x26,0x07,0x1c,0x00,0x00,0x0a,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00}, 8333}, - {{0x26,0x07,0x53,0x00,0x01,0x20,0x0a,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x26,0x07,0x53,0x00,0x02,0x03,0x2f,0xac,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x26,0x07,0x53,0x00,0x02,0x03,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x26,0x07,0x53,0x00,0x02,0x03,0x06,0xbc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 18333}, - {{0x26,0x07,0x53,0x00,0x02,0x03,0x00,0x8d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x26,0x07,0x53,0x00,0x00,0x60,0x10,0xaa,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x26,0x07,0x53,0x00,0x00,0x60,0x12,0x2a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x26,0x07,0x53,0x00,0x00,0x60,0x13,0xbb,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x26,0x07,0x53,0x00,0x00,0x60,0x3d,0xdf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x26,0x07,0x53,0x00,0x00,0x60,0x57,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 8333}, - {{0x26,0x07,0x53,0x00,0x00,0x60,0x07,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x26,0x07,0x53,0x00,0x00,0x60,0x09,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x26,0x07,0x53,0x00,0x00,0x60,0xcf,0xf1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 28633}, - {{0x26,0x07,0x92,0x80,0x00,0x0b,0x07,0x3b,0x02,0x50,0x56,0xff,0xfe,0x21,0xbf,0x32}, 8333}, - {{0x26,0x07,0xf1,0x78,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06}, 8333}, - {{0x26,0x07,0xf1,0xc0,0x08,0x23,0xaf,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xbb,0xd1}, 8333}, - {{0x26,0x07,0xf2,0xc0,0xf0,0x0e,0x03,0x00,0x02,0x01,0x2e,0xff,0xfe,0x67,0x91,0x30}, 8333}, - {{0x26,0x07,0xfa,0x18,0x00,0x00,0xbe,0xef,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x12}, 8333}, - {{0x26,0x07,0xff,0x28,0x00,0x01,0x00,0x07,0x00,0x00,0x00,0x00,0x17,0x6e,0xc4,0xa5}, 8333}, - {{0x26,0x07,0xff,0x28,0x00,0x01,0x00,0x07,0x00,0x00,0x00,0x00,0x65,0xaf,0x9a,0xfb}, 8333}, - {{0x26,0x20,0x00,0x71,0x40,0x00,0x00,0x00,0x01,0x92,0x00,0x30,0x01,0x20,0x01,0x10}, 8333}, - {{0x28,0x01,0x00,0x84,0x00,0x00,0x10,0x34,0x76,0xd4,0x35,0xff,0xfe,0x7f,0x50,0x33}, 8333}, - {{0x28,0x03,0x15,0x00,0x12,0x00,0xc4,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x28,0x04,0x01,0x4c,0x65,0x82,0x60,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x28,0x04,0x01,0x4d,0xba,0xa6,0x96,0x2c,0x04,0x86,0x47,0xf6,0xc1,0x61,0xa7,0x9d}, 8333}, - {{0x2a,0x00,0x13,0xa0,0x30,0x15,0x00,0x01,0x00,0x85,0x00,0x14,0x00,0x79,0x00,0x26}, 8333}, - {{0x2a,0x00,0x16,0xd8,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0x6a,0xc2,0x61}, 8333}, - {{0x2a,0x00,0x17,0x68,0x20,0x01,0x00,0x24,0x00,0x00,0x00,0x00,0x01,0x48,0x02,0x18}, 8333}, - {{0x2a,0x00,0x18,0x38,0x00,0x36,0x00,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0xed,0x85}, 8333}, - {{0x2a,0x00,0x1a,0x28,0x11,0x57,0x02,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x6a}, 8333}, - {{0x2a,0x00,0x1c,0x48,0x00,0x06,0x02,0x03,0x0a,0x60,0x6e,0xff,0xfe,0x44,0x80,0x86}, 8333}, - {{0x2a,0x00,0x1f,0x40,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x26}, 8333}, - {{0x2a,0x00,0x7c,0x80,0x00,0x00,0x00,0x5d,0x00,0x00,0x00,0x00,0x00,0x00,0x1d,0x0e}, 8333}, - {{0x2a,0x00,0x8a,0x60,0xe0,0x12,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21}, 8333}, - {{0x2a,0x00,0xab,0x00,0x06,0x03,0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03}, 8333}, - {{0x2a,0x00,0xbb,0xe0,0x00,0xcc,0x00,0x00,0x66,0x51,0x06,0xff,0xfe,0x0e,0x94,0x18}, 8333}, - {{0x2a,0x00,0x0c,0xa8,0x0a,0x1f,0x30,0x25,0x41,0x21,0x5c,0xa1,0x00,0x3b,0x44,0x69}, 8333}, - {{0x2a,0x00,0x0c,0xa8,0x0a,0x1f,0x90,0x91,0x94,0x5e,0x80,0xa3,0x83,0x0a,0x78,0xcf}, 8333}, - {{0x2a,0x01,0x02,0x38,0x43,0x3c,0x53,0x00,0x7a,0x61,0x3e,0x1a,0x27,0xf4,0x9d,0xc2}, 8333}, - {{0x2a,0x01,0x42,0x40,0x0a,0x21,0x98,0x3b,0x00,0x00,0x00,0x00,0xc0,0xa8,0x00,0x32}, 8333}, - {{0x2a,0x01,0x04,0x88,0x00,0x66,0x10,0x00,0x53,0xa9,0x21,0xb8,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x01,0x4d,0x60,0x00,0x03,0x00,0x01,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x0a,0x35,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x0b,0x03,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x0b,0x0d,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x0b,0x0f,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x20,0x13,0x91,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x20,0x70,0xa3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x20,0x93,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x21,0x23,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x30,0x71,0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x30,0x74,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3a,0x12,0x4f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3a,0x1d,0xcb,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3a,0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 21775}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3a,0x07,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x10,0x9e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x1a,0x9e,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x27,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 10731}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x2d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x2d,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x3d,0xa8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x41,0xe6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x05,0xc7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x3b,0x00,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x40,0x23,0x6a,0xca,0xfe,0x00,0x00,0x00,0x00,0x00,0x05}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x40,0x32,0x4e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x40,0x53,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x40,0x53,0x29,0x00,0x00,0x00,0x00,0x00,0x50,0x01,0x09}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x40,0x93,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x40,0x93,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x41,0x00,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x50,0x53,0xa4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x50,0x72,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x60,0x41,0xf0,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x33}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x60,0x44,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x60,0x60,0x92,0xd7,0xbd,0x0a,0x39,0x3e,0x52,0xb6,0x5d}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x60,0x60,0xaa,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x60,0x63,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x61,0x60,0x91,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x61,0x61,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x61,0x81,0x2e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x62,0x02,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x62,0x33,0xac,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x71,0x01,0xc3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x71,0x2b,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x71,0x32,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x71,0x04,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x71,0x0d,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x71,0x0d,0x4a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x71,0x0e,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x71,0x0e,0xcd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x72,0x18,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x73,0x16,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x90,0x50,0xb6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x90,0x51,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x23}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x91,0x02,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x92,0x21,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x01,0x92,0x62,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x1c,0x0c,0x77,0xaf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x00,0x10,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x00,0x44,0x2d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x01,0x11,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x01,0x04,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x01,0x53,0xcc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x01,0x80,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x37}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x01,0x80,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x02,0x32,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x11,0x03,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x11,0x0f,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x12,0x1e,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 15000}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x2e,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x2f,0xcf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x34,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x34,0x52,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x39,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8335}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x3c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x3c,0x82,0xfe,0xa1,0x00,0x00,0x00,0x00,0x06,0x66}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x06,0xcd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x08,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x02,0x21,0x0f,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x00,0xa0,0x61,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x0c,0x0c,0x42,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x0c,0x0c,0x56,0xa5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf8,0x0c,0x17,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x10,0xd4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x18,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x19,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x1c,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x25,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x25,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x25,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x26,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x2d,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x2d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x03,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x06,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0x00,0x2a,0x0d,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x01,0x04,0xf9,0xc0,0x10,0x12,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x01,0x04,0xf9,0xc0,0x10,0x17,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x01,0x5d,0x00,0x00,0x01,0x04,0xb6,0xd2,0xbf,0x9c,0xff,0xfe,0x45,0xb8,0x34}, 8333}, - {{0x2a,0x01,0x07,0x9c,0xce,0xbe,0x70,0xcc,0x1a,0x03,0x73,0xff,0xfe,0x48,0xe6,0x91}, 8333}, - {{0x2a,0x01,0x07,0xa0,0x00,0x02,0x13,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07}, 8333}, - {{0x2a,0x01,0x07,0xa7,0x00,0x02,0x12,0x18,0x0e,0xc4,0x7a,0xff,0xfe,0x83,0x83,0xc4}, 8333}, - {{0x2a,0x01,0x07,0xa7,0x00,0x02,0x12,0x88,0xea,0x39,0x35,0xff,0xfe,0xf0,0xc4,0x29}, 8333}, - {{0x2a,0x01,0x07,0xc8,0xaa,0xba,0x00,0x18,0x50,0x54,0x00,0xff,0xfe,0x2b,0xdf,0x20}, 8333}, - {{0x2a,0x01,0x07,0xc8,0xff,0xfa,0x05,0x0e,0x30,0x35,0x74,0x1b,0xbe,0x02,0xb5,0xde}, 8333}, - {{0x2a,0x01,0xbe,0x00,0x00,0x10,0x02,0x01,0x00,0x00,0x00,0x80,0xce,0xce,0x00,0x01}, 8333}, - {{0x2a,0x01,0xcb,0x00,0x05,0xbe,0xd5,0x00,0x02,0x27,0x0e,0xff,0xfe,0x28,0xc5,0x65}, 8333}, - {{0x2a,0x01,0xcb,0x00,0x00,0xb3,0xd3,0x00,0x92,0x76,0x8a,0x8c,0x74,0xbf,0x2a,0x88}, 8333}, - {{0x2a,0x01,0xcb,0x14,0x00,0xb8,0xa5,0x00,0xdd,0x9d,0x80,0xf5,0xd3,0x05,0x68,0xf9}, 8333}, - {{0x2a,0x01,0x0e,0x0a,0x00,0x20,0x91,0x20,0x7c,0x3f,0x56,0x43,0x99,0x78,0x18,0x25}, 8333}, - {{0x2a,0x01,0x0e,0x0a,0x00,0x0d,0x6e,0xa0,0x00,0x56,0xde,0xab,0x1b,0x2f,0x30,0x0b}, 8333}, - {{0x2a,0x01,0x0e,0x34,0xec,0x16,0x93,0xf0,0x72,0x5d,0xd8,0xd2,0xbb,0x90,0xea,0xbf}, 8333}, - {{0x2a,0x01,0x0e,0x34,0xee,0x33,0x16,0x40,0xc4,0x18,0x3c,0x3a,0x8f,0xf6,0x3e,0xab}, 8333}, - {{0x2a,0x01,0x0e,0x34,0xee,0xd7,0x66,0x70,0x28,0xc0,0x18,0x3c,0x77,0x83,0x7d,0xc3}, 8333}, - {{0x2a,0x01,0x0e,0x35,0x2f,0x7d,0xa0,0xb0,0x59,0xc2,0x3c,0x8a,0x95,0xa2,0xc4,0xd1}, 8333}, - {{0x2a,0x01,0x0e,0x35,0x87,0xba,0xd0,0xc0,0x75,0xa2,0x9f,0x39,0xef,0xcb,0xf5,0x9f}, 8333}, - {{0x2a,0x02,0x12,0x0b,0xc3,0xc5,0xce,0xf0,0xec,0x82,0xa4,0x3d,0x04,0xd6,0x0d,0xc2}, 8333}, - {{0x2a,0x02,0x12,0x0b,0xc3,0xd1,0xf2,0xd0,0xee,0xa8,0x6b,0xff,0xfe,0xfc,0x22,0x65}, 8333}, - {{0x2a,0x02,0x01,0x68,0x40,0x4c,0x00,0x00,0xee,0xa8,0x6b,0xff,0xfe,0xf3,0x7d,0x5c}, 8333}, - {{0x2a,0x02,0x01,0x80,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x05,0x17,0x10,0xb6}, 8333}, - {{0x2a,0x02,0x01,0x80,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x5b,0x8f,0x53,0x8c}, 8333}, - {{0x2a,0x02,0x01,0xb8,0x00,0x10,0x01,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x02,0x21,0x68,0x0d,0x05,0x2c,0x00,0x02,0x16,0x3e,0xff,0xfe,0xf7,0xa0,0x99}, 8333}, - {{0x2a,0x02,0x25,0x28,0x05,0x03,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14}, 8333}, - {{0x2a,0x02,0x25,0x28,0x00,0xfa,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x27,0x70,0x00,0x17,0x00,0x00,0x02,0x1a,0x4a,0xff,0xfe,0x7b,0x17,0x5f}, 8333}, - {{0x2a,0x02,0x27,0x70,0x00,0x05,0x00,0x00,0x02,0x1a,0x4a,0xff,0xfe,0x44,0x83,0x70}, 8333}, - {{0x2a,0x02,0x28,0x08,0x54,0x01,0x00,0x00,0x02,0x25,0x90,0xff,0xfe,0x4e,0xee,0x42}, 8333}, - {{0x2a,0x02,0x03,0x90,0x90,0x00,0x00,0x00,0x02,0x18,0x7d,0xff,0xfe,0x10,0xbe,0x33}, 8333}, - {{0x2a,0x02,0x07,0x50,0x00,0x07,0x0c,0x11,0x50,0x54,0x00,0xff,0xfe,0x43,0xeb,0x81}, 8333}, - {{0x2a,0x02,0x7a,0xa0,0x16,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x90,0xeb,0xa2}, 8333}, - {{0x2a,0x02,0x7b,0x40,0x3e,0x4d,0x9e,0xd9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x7b,0x40,0x50,0xd1,0xe0,0x4f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x7b,0x40,0x59,0x28,0x0f,0x9e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x7b,0x40,0x59,0x2f,0xa5,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x7b,0x40,0xb0,0xdf,0x82,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x7b,0x40,0xb0,0xdf,0x89,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x7b,0x40,0xb0,0xdf,0x8b,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x7b,0x40,0xb0,0xdf,0x8d,0x57,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x7b,0x40,0xd4,0x18,0x6f,0xcd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x81,0x08,0x23,0x40,0x1c,0x18,0x00,0x7a,0x23,0x1e,0x14,0x30,0x7f,0x12}, 8333}, - {{0x2a,0x02,0x81,0x08,0x9c,0x3f,0xdd,0x18,0x92,0x2b,0x34,0xff,0xfe,0x30,0xac,0x42}, 8333}, - {{0x2a,0x02,0x81,0x0d,0x8a,0x40,0x36,0xf8,0x9a,0xf2,0xb3,0xff,0xfe,0xe8,0x6d,0x7a}, 8333}, - {{0x2a,0x02,0x83,0x88,0xe3,0x01,0x71,0x80,0x02,0x01,0x2e,0xff,0xfe,0x82,0xb3,0xcc}, 8333}, - {{0x2a,0x02,0x09,0x08,0x02,0x13,0x54,0xa0,0x39,0xbf,0xd4,0xaa,0x60,0xb2,0xd9,0xc3}, 8333}, - {{0x2a,0x02,0x09,0x08,0x04,0xf0,0x7e,0x1c,0x50,0x54,0x00,0xff,0xfe,0xb7,0xce,0x4b}, 8333}, - {{0x2a,0x02,0x09,0x30,0x00,0x01,0x00,0x00,0x02,0x50,0x56,0xff,0xfe,0x8e,0x28,0x19}, 8333}, - {{0x2a,0x02,0x0a,0x80,0x00,0x00,0x20,0x52,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02}, 8333}, - {{0x2a,0x02,0xc2,0x05,0x00,0x00,0x51,0x45,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x05,0x20,0x08,0x02,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x05,0x20,0x10,0x62,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x05,0x20,0x16,0x43,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x05,0x20,0x17,0x21,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x05,0x20,0x18,0x17,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x05,0x20,0x18,0x82,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x05,0x30,0x02,0x27,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x05,0x30,0x02,0x65,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x00,0x00,0x38,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x07,0x46,0x99,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x09,0x02,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x10,0x77,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x12,0x48,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x14,0x41,0x99,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x14,0x56,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x14,0x99,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 18333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x15,0x37,0x99,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x15,0x39,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x15,0x59,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x15,0x66,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x16,0x23,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x16,0x93,0x75,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x17,0x19,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x17,0x37,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x17,0x44,0x86,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x17,0x47,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x17,0x58,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x17,0x73,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x17,0x81,0x75,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x17,0x89,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x18,0x14,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x18,0x30,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x18,0x32,0x75,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x18,0x37,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x18,0x47,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x18,0x74,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x19,0x10,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x19,0x14,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x19,0x20,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x19,0x02,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x20,0x19,0x35,0x92,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x30,0x01,0x93,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x30,0x02,0x12,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x30,0x02,0x41,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x30,0x02,0x56,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x30,0x02,0x71,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x30,0x02,0x72,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x30,0x02,0x76,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xc2,0x07,0x30,0x02,0x84,0x56,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0xce,0x80,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x0e,0x00,0xff,0xf0,0x01,0xb9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x02,0x0e,0x00,0xff,0xf0,0x01,0xb9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a}, 8333}, - {{0x2a,0x02,0x0e,0x00,0xff,0xf0,0x01,0xe2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x01,0x00,0xd0,0x00,0x00,0x00,0x00,0x00,0x69,0x30,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x03,0xba,0xb0,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x02,0x00,0xd0,0x00,0x00,0x00,0x00,0x08,0xce,0x40,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x01,0x16,0x50,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x01,0x2a,0x00,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x23,0xfb,0x60,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x04,0x09,0x10,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x44,0xb8,0x90,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x44,0xb8,0xa0,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x44,0xb8,0xe0,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x44,0xb8,0xf0,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x44,0xb9,0x00,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x44,0xb9,0x10,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x44,0xb9,0x20,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x44,0xb9,0x40,0x01}, 8333}, - {{0x2a,0x03,0xb0,0xc0,0x00,0x03,0x00,0xd0,0x00,0x00,0x00,0x00,0x5e,0x48,0xd0,0x01}, 8333}, - {{0x2a,0x03,0xee,0x40,0x00,0x00,0x02,0x94,0x02,0x50,0x56,0xff,0xfe,0x8d,0x4a,0xd7}, 8333}, - {{0x2a,0x04,0x21,0x80,0x00,0x01,0x00,0x0c,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x15}, 8333}, - {{0x2a,0x07,0x04,0x40,0x20,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x0c,0xa0,0x18,0x17}, 8333}, - {{0x2a,0x0a,0xc8,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xd6,0xbc,0x4a,0x3c,0x6d,0x03,0xa9,0x4e,0x1f,0x55}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xd6,0xec,0x32,0xc1,0x59,0x9c,0xd8,0x46,0xd5,0x48}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xd0,0x4b,0x2b,0xe5,0x74,0xc4,0xb0,0x1c,0x49,0xb1}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xd1,0x79,0x73,0x7d,0x9b,0x37,0xab,0x3b,0xc0,0x43}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xd2,0x3a,0x8f,0x2a,0xb7,0x71,0x8c,0xd3,0x67,0xdf}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xde,0xfc,0xb8,0x18,0xa5,0x0f,0x26,0x6e,0x99,0xec}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xdf,0x34,0xea,0x00,0x93,0xac,0x32,0x62,0x3d,0x37}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xdb,0x29,0x3c,0xb5,0x05,0x98,0x81,0xdb,0x7d,0xd4}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xdc,0x1e,0x17,0xcf,0x86,0x53,0xf6,0x3b,0xb7,0x51}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xdc,0x79,0xc1,0x8f,0x29,0x44,0xf2,0xdc,0x00,0xf6}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xdd,0xe8,0x28,0x36,0x77,0x7f,0x46,0x37,0x03,0x3d}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xe7,0x2c,0x05,0xb5,0x95,0x59,0xc5,0x00,0x6c,0x5a}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xe1,0x0f,0x31,0xe2,0xb5,0xc9,0xc2,0x17,0x78,0x5d}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xe2,0x48,0xa0,0x9f,0xe2,0x1a,0xca,0x30,0x6e,0xa4}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xe3,0x09,0x6b,0x3b,0x41,0x2d,0xd5,0xe5,0x9b,0x65}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xee,0xe7,0x24,0xcf,0xd9,0x86,0xd0,0x09,0x57,0xb0}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xef,0x3c,0x49,0x0b,0xc1,0x74,0xc2,0x92,0x86,0xe1}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xef,0x73,0x9c,0xc9,0x5f,0x44,0x2b,0xe7,0xec,0x96}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xef,0xa5,0x34,0x24,0x5e,0x50,0x8d,0x6f,0x15,0x6a}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xe9,0x17,0x9b,0x08,0xdc,0xbe,0x24,0xe3,0x01,0x6e}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xe9,0x79,0x89,0x41,0x5c,0x21,0x07,0xc4,0x8a,0xa9}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xea,0xb6,0xeb,0xd2,0x5a,0x58,0x00,0x16,0x61,0x0f}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xeb,0xe7,0x4c,0xbd,0x60,0xb0,0x77,0x2a,0xc9,0xd2}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xec,0x58,0xf9,0x46,0x23,0x0e,0xea,0xf2,0x9b,0x27}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xed,0x9a,0xa8,0x65,0x39,0x49,0x0e,0xc8,0x7c,0xed}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xed,0xef,0x28,0x1d,0xef,0x42,0x35,0xa7,0x98,0x92}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xee,0x0d,0x2c,0x85,0x41,0x08,0x29,0x94,0xdf,0xec}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xee,0x75,0x23,0x93,0x83,0xf1,0x6b,0x11,0xb5,0x84}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xf7,0x21,0x13,0xe2,0xe6,0x5e,0x12,0x93,0xa9,0xa4}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xf2,0x9b,0xff,0x28,0x09,0x12,0xa0,0x6d,0x68,0x0e}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xf3,0x34,0x88,0x19,0xb0,0x4d,0xcf,0xfa,0x2f,0x0a}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xf5,0x84,0x56,0x84,0x3b,0xab,0x01,0x6f,0x0a,0xc0}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xf6,0x70,0xdb,0x84,0x34,0x79,0x58,0xda,0x8b,0x66}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xfc,0x9b,0x2f,0xc4,0x14,0x8b,0xd8,0xb5,0xe0,0x28}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xfd,0x8e,0x09,0x64,0xda,0xd3,0xc6,0xaa,0x94,0x4a}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x06,0xc1,0xe7,0xaf,0x38,0x13,0x99,0x7e,0x9a,0x16}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x00,0xa5,0xf3,0xe1,0x60,0x00,0xd2,0xa9,0xfd,0x8a}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x01,0x9f,0x61,0x55,0x17,0x00,0xc2,0x86,0xe0,0x93}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x02,0x61,0x59,0x61,0x66,0xed,0xc7,0xda,0xcb,0x78}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x02,0xa6,0x52,0x02,0x0a,0x0b,0x55,0xdd,0x04,0xb7}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x02,0xc3,0x22,0x35,0xb2,0x60,0x64,0x6b,0xae,0x5b}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x02,0xe3,0x4c,0xc4,0x79,0xfd,0xc4,0x45,0x7b,0xe5}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x03,0x3c,0x08,0x6c,0x6b,0xa6,0x76,0xd4,0x89,0xb3}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x03,0x88,0x5c,0x5c,0xcd,0x79,0x80,0x8b,0x6a,0xe6}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x03,0xf4,0x58,0x9b,0x4c,0x04,0x2e,0xf6,0x29,0x43}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x03,0xf9,0x9c,0xf1,0x0c,0xb8,0x46,0xbf,0x3d,0x71}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x03,0xc2,0x1a,0x9d,0x5b,0xd3,0x31,0x41,0xb7,0x18}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x04,0x56,0xe1,0x55,0xd6,0xbc,0xda,0xb0,0xbd,0xdb}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x0f,0x47,0xe2,0x4c,0xab,0x4b,0x34,0xb4,0x93,0xb8}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x08,0xed,0x51,0x58,0x05,0xcb,0xe5,0x28,0x09,0x49}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x0c,0x6d,0x02,0x65,0xbe,0x59,0x3b,0xcb,0x68,0x21}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x0d,0xef,0x55,0x07,0xe2,0xcc,0x6f,0x3a,0xe7,0x42}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x16,0xa6,0xf8,0x28,0x19,0xe2,0x0e,0x9c,0xd8,0xc1}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x11,0x85,0x5d,0xea,0x21,0x08,0x53,0x8c,0x65,0xd6}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x12,0x95,0x07,0xac,0xca,0xcb,0x8b,0xce,0x9f,0x58}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x13,0xf0,0x58,0x06,0x5c,0x2c,0xb7,0x56,0x85,0xe5}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x14,0xf3,0x4c,0xdd,0xb5,0x58,0x3b,0x7a,0x87,0xf9}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x15,0xb8,0x88,0x54,0x43,0xc7,0xbe,0x1e,0xcd,0xf6}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x16,0x2a,0xf3,0x4f,0x5d,0xd7,0xf8,0x8e,0x87,0xe2}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x1b,0x28,0x39,0x47,0xf7,0xf9,0x07,0x5c,0x19,0x73}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x1c,0x82,0xde,0xec,0xba,0x1d,0x9e,0x7a,0xf5,0x97}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x1c,0xa5,0x01,0xa7,0xcf,0xbb,0x72,0xa9,0x9f,0xc8}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x26,0xf2,0x12,0x3c,0xf5,0x14,0x19,0x91,0x41,0x51}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x27,0xb6,0x8f,0x8b,0xf0,0x06,0x42,0x39,0xa5,0x80}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x22,0x28,0x04,0xea,0x09,0xa8,0x5b,0xfd,0xfd,0xe7}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x23,0xf4,0xc4,0xe5,0xd7,0xda,0xaa,0x1f,0x02,0xfc}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x26,0x2a,0x5b,0x90,0x85,0x8f,0x08,0xe5,0x10,0xb1}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2e,0xda,0x54,0x38,0xfa,0xfa,0x75,0x75,0x94,0x9d}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2f,0x49,0x9b,0xbc,0xe6,0x3a,0x9a,0x50,0xc6,0x66}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x28,0x09,0x61,0x65,0x34,0xcc,0xb9,0x62,0xdc,0xf5}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x29,0x0a,0x89,0x09,0x50,0xa7,0x62,0x08,0x13,0x62}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x29,0x83,0x29,0x6f,0xbb,0xac,0xaa,0x06,0x8d,0xbf}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2b,0x56,0xa8,0xba,0xd2,0xc4,0x4a,0x4a,0x07,0xd2}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2b,0x5d,0xc0,0x01,0x4f,0x5f,0xa4,0x6f,0x63,0x9f}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2b,0x5e,0xd4,0x8d,0x5a,0xe3,0xf2,0x61,0x3d,0x77}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2b,0x89,0xcc,0x31,0x39,0xe1,0xd2,0x77,0x5a,0x83}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2c,0x17,0xcd,0xf9,0xb9,0xfc,0x06,0x89,0x6d,0xaa}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2c,0x4e,0x5a,0x0a,0xd6,0xed,0x4c,0x72,0xfc,0x55}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2c,0x63,0x72,0x16,0xbd,0x1a,0x23,0xd3,0xb3,0xeb}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2d,0x04,0xa2,0x45,0xcb,0xc5,0x2b,0xf2,0x05,0x60}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x2e,0x7c,0xd9,0x21,0x3e,0x4a,0x31,0x4b,0x2e,0x42}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x37,0x20,0x5b,0x0a,0x9d,0xb3,0x3f,0x92,0x75,0x66}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x30,0x7b,0x87,0xc2,0x7e,0xd8,0xe9,0xbb,0x14,0xed}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x30,0xb0,0x34,0xf5,0x03,0xda,0x45,0x7c,0x07,0x31}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x31,0x6a,0xd6,0xb6,0xc2,0x18,0xcb,0x97,0x48,0x15}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x33,0x96,0x4a,0xd7,0x00,0xc0,0xe4,0x3a,0x52,0xda}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x34,0x39,0x2a,0x7a,0x53,0x4b,0x5d,0x28,0x53,0xdf}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x38,0x78,0xe8,0x90,0xcb,0x74,0x7b,0x7d,0xdd,0xc0}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x38,0x68,0x04,0x47,0x7f,0x1d,0xda,0x15,0xd2,0x36}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x38,0xc1,0xf2,0xd7,0x30,0xdd,0x5c,0x7f,0xb2,0x9e}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x3b,0x6a,0xad,0xbc,0xd5,0x41,0x30,0x8b,0xe0,0x5a}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x41,0x6d,0x7b,0x51,0xa9,0x07,0x1e,0x6b,0x60,0x66}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x42,0x58,0x16,0x65,0x14,0x68,0x65,0x9c,0xde,0x69}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x43,0x7f,0x1e,0xa0,0x8e,0xfb,0x8c,0xab,0x85,0xa4}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x43,0x71,0x2a,0x9c,0x0a,0x8d,0x16,0x6f,0x2e,0x72}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x45,0xa3,0x60,0xda,0x52,0xfa,0xca,0x05,0x94,0xdc}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x48,0x3e,0x36,0x19,0x51,0x47,0xca,0x8e,0x7e,0xea}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x4c,0xd5,0x26,0xb9,0x54,0x90,0x72,0xc9,0x7e,0xcb}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x4d,0xaf,0x88,0x1d,0xfc,0xd0,0x99,0x63,0xc0,0xbb}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x4d,0xe2,0x50,0x4e,0x13,0x11,0x2b,0x9b,0x62,0xd9}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x4e,0x3c,0xca,0xe4,0x3a,0x6c,0xe9,0x34,0x60,0x9e}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x4e,0x07,0x0a,0x5f,0x2b,0x41,0x13,0xe1,0xb3,0x5c}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x56,0x8c,0x3c,0xd6,0x38,0x8d,0xff,0x5f,0x2a,0x56}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x52,0x86,0x09,0x6e,0x04,0x0a,0x9d,0x2c,0x1a,0x9d}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x54,0xac,0x5c,0x52,0x2d,0x32,0xd9,0xee,0xd3,0xe1}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x5e,0x9f,0x1a,0x66,0x3b,0x63,0x4e,0x82,0x52,0x86}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x59,0x94,0x61,0x0f,0x81,0x8a,0x58,0x78,0xc1,0xa0}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x59,0x95,0x50,0xd6,0x2e,0xf7,0xd2,0xe6,0x3a,0x56}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x5a,0xd6,0x96,0x82,0x6a,0x91,0x4d,0x35,0x9d,0x4e}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x60,0xdf,0x3f,0x5b,0xb2,0x4d,0x84,0xdb,0xce,0xd8}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x61,0xd2,0x22,0x3f,0x22,0xe1,0xb0,0x01,0xdb,0x56}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x63,0x7f,0xce,0x1c,0x28,0x70,0x30,0xdd,0xb9,0x32}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x63,0xc0,0xa7,0x9b,0x34,0xfd,0x18,0x6a,0x6f,0x24}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x65,0x5c,0xcb,0x14,0x63,0x1c,0x0b,0x03,0x6d,0x70}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x65,0xfa,0xa1,0x96,0xf6,0x75,0x85,0xbc,0x33,0x26}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x6f,0x19,0xbd,0x64,0x4f,0xe9,0xea,0xe6,0x2a,0x7c}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x6f,0xf7,0x29,0x92,0x02,0x62,0x73,0xd3,0xd9,0xa8}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x68,0xb4,0x13,0x28,0xf0,0x71,0xe2,0xcb,0x06,0xf1}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x68,0xbd,0x95,0xca,0xd6,0x84,0x0d,0xf1,0x77,0x19}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x6c,0x62,0x5b,0x0d,0x91,0x66,0xd0,0xca,0x10,0x2d}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x6c,0x62,0xc5,0x19,0x94,0x5b,0xcd,0x20,0xd9,0x73}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x76,0xa6,0xaa,0x68,0x61,0x90,0xfc,0x8a,0x30,0x47}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x77,0xf5,0x9c,0x66,0x35,0xff,0xc8,0x0d,0x06,0xd4}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x71,0xcd,0x60,0x77,0x1e,0xee,0x78,0x42,0x33,0xe1}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x72,0xea,0x3a,0x77,0xe6,0xfc,0x6f,0x67,0x8a,0x3c}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x73,0x57,0x97,0x7f,0xfd,0x71,0x86,0xf4,0xb7,0xb7}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x74,0xe4,0x79,0xcc,0x23,0xf5,0x74,0xad,0xa5,0x79}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x75,0xa3,0xd9,0xb3,0xf8,0x35,0xbd,0xac,0xf2,0xab}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x78,0x8a,0x79,0x0e,0x19,0x97,0xa1,0xed,0xc7,0x14}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x79,0x4b,0x68,0x5e,0xb4,0x58,0xc9,0x0e,0xf7,0x22}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x79,0x9b,0x9f,0xaa,0xc2,0xdf,0xa2,0x2a,0x09,0xf4}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x79,0xf8,0x6f,0x87,0x89,0x96,0x28,0xd9,0xd6,0x3c}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x7a,0x4c,0x71,0x22,0xb9,0x53,0x89,0x19,0x12,0x43}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x7d,0x3f,0x6d,0xa4,0xb8,0x8e,0x5f,0xf9,0x5e,0x48}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x7d,0xea,0xa4,0xbf,0xd2,0x28,0x74,0x5f,0x95,0xc4}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x80,0x2e,0xce,0xc9,0xec,0xbf,0x47,0xa5,0x6e,0x8f}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x81,0x1f,0x33,0xf7,0x83,0x06,0x24,0xc7,0xe3,0xb8}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x82,0x7c,0x88,0xc1,0xba,0x47,0xf6,0x41,0x94,0xbd}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x82,0x5e,0x44,0x97,0x2b,0xb4,0x20,0xdc,0xc9,0xcb}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x85,0xc9,0xb0,0xc1,0x2c,0x88,0x88,0xfb,0xbe,0xfc}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x8a,0xdc,0xd4,0xb3,0xf4,0x47,0x8a,0x3c,0x67,0x87}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x8c,0xbd,0xbe,0xca,0x5a,0xe6,0x19,0x6c,0x41,0x56}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x91,0x90,0x89,0xb8,0xc4,0x74,0x24,0xba,0xa9,0x35}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x93,0xd0,0x32,0x45,0xa4,0x9a,0x18,0xc6,0x2a,0x67}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x98,0x7f,0x05,0xa0,0x51,0x9f,0xa2,0x3c,0xdf,0x23}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x99,0xc2,0x95,0x03,0xda,0x05,0xf3,0x4b,0x4d,0xb3}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x9b,0x8d,0x4a,0xe3,0xb4,0x7e,0x28,0x29,0xd0,0x77}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xa7,0xd8,0xfa,0xdd,0xd3,0x63,0x60,0xd9,0xe1,0xbd}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xa0,0x84,0xcb,0x7b,0xeb,0xe2,0x8c,0xbf,0x73,0xd8}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xa1,0x1d,0xe8,0xbb,0x02,0xdf,0xff,0xd4,0x3a,0x1f}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xa2,0x64,0x1d,0x40,0x49,0x57,0x27,0xed,0x6f,0x99}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xa5,0x03,0xcd,0xbf,0x60,0x8c,0xd8,0xe8,0xb6,0xbd}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xa5,0x43,0xde,0xb2,0xd5,0xa6,0x35,0xa6,0x19,0x9a}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xa6,0x73,0x84,0x9a,0x0b,0x2f,0x3e,0x01,0x28,0x31}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xaf,0x4a,0x68,0xec,0xad,0xce,0xdb,0x6f,0x7b,0x73}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xaf,0x73,0x2d,0x48,0xc9,0xc4,0x76,0x65,0x9f,0xc2}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xaa,0xb7,0x04,0x8c,0x87,0xc6,0x38,0x3b,0x0a,0xf6}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xab,0xb1,0xeb,0x86,0xa4,0x4b,0xaf,0xcb,0x84,0x17}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xad,0x11,0x6f,0xf5,0x46,0x78,0xa0,0xa2,0x71,0x95}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xb6,0xe1,0xcf,0xd0,0x58,0x02,0x66,0x54,0x0b,0xfe}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xb1,0xbd,0x5b,0x30,0x31,0xce,0x31,0x90,0x3e,0x8d}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xb1,0x9e,0x5b,0x5c,0xd8,0xd0,0xdd,0x64,0x11,0xad}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xb2,0x66,0xca,0xcb,0x2d,0xa8,0xc4,0xb6,0x88,0x14}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xb8,0x03,0xce,0x85,0xec,0x64,0x57,0xd3,0x6c,0x38}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xb8,0xd7,0x4d,0xd1,0x39,0x41,0x0e,0x47,0x51,0xdf}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xb9,0xb0,0xa6,0x00,0x1a,0x4a,0x41,0x8f,0x88,0xb4}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xbb,0x57,0x4d,0xce,0xa0,0x53,0x4d,0x8f,0xcd,0x4f}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xbc,0x9b,0xd4,0x08,0x44,0xe7,0x4d,0x2d,0xc3,0x1f}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xc0,0xdc,0xd7,0x19,0x2f,0x48,0xf6,0xc2,0x73,0xb5}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xc2,0x9b,0xfa,0xb8,0xbb,0xf8,0x41,0x5b,0x92,0x63}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xc2,0xfb,0xae,0x8e,0xc7,0xac,0x11,0x2f,0xc7,0x02}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xc4,0x42,0x01,0x09,0xe1,0xc1,0x89,0xeb,0x80,0x20}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xc6,0x29,0x70,0x15,0x68,0xf9,0x60,0x34,0x64,0xf0}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xce,0xf6,0xda,0x2a,0x7f,0x69,0x90,0xad,0x89,0xe4}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xcb,0x9b,0xa0,0x84,0x5a,0x86,0x90,0x78,0x4f,0x82}, 8333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xcc,0x13,0x59,0xde,0x4a,0xbb,0x9b,0x4e,0x2b,0x35}, 8333} + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8a,0x44,0xc6,0x8e}, 9246}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8a,0xc5,0xe0,0xfc}, 9246} }; static SeedSpec6 pnSeed6_test[] = { - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x99,0xcb,0x26,0x31,0xba,0x48,0x51,0x31,0x39,0x0d}, 18333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x44,0xf4,0xf4,0xf0,0xbf,0xf7,0x7e,0x6d,0xc4,0xe8}, 18333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x6a,0x8b,0xd2,0x78,0x3f,0x7a,0xf8,0x92,0x8f,0x80}, 18333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xe6,0x4e,0xa4,0x47,0x4e,0x2a,0xfe,0xe8,0x95,0xcc}, 18333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x9f,0xae,0x9f,0x59,0x0b,0x3f,0x31,0x3a,0x8a,0x5f}, 18333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x47,0xb1,0xe4,0x55,0xd1,0xb0,0x14,0x3f,0xb6,0xdb}, 18333}, - {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xa0,0x60,0x9e,0x46,0x54,0xdb,0x61,0x3b,0xb2,0x6f}, 18333} + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0xcb,0x9a,0xdb}, 19246} }; #endif // BITCOIN_CHAINPARAMSSEEDS_H diff --git a/src/claimtrie.cpp b/src/claimtrie.cpp new file mode 100644 index 000000000..8b15b7065 --- /dev/null +++ b/src/claimtrie.cpp @@ -0,0 +1,2552 @@ +#include +#include +#include + +#include +#include + +#include + +static const std::string rootClaimName = ""; +static const std::string rootClaimHash = "0000000000000000000000000000000000000000000000000000000000000001"; + +std::vector heightToVch(int n) +{ + std::vector vchHeight; + vchHeight.resize(8); + vchHeight[0] = 0; + vchHeight[1] = 0; + vchHeight[2] = 0; + vchHeight[3] = 0; + vchHeight[4] = n >> 24; + vchHeight[5] = n >> 16; + vchHeight[6] = n >> 8; + vchHeight[7] = n; + return vchHeight; +} + +uint256 getValueHash(COutPoint outPoint, int nHeightOfLastTakeover) +{ + CHash256 txHasher; + txHasher.Write(outPoint.hash.begin(), outPoint.hash.size()); + std::vector vchtxHash(txHasher.OUTPUT_SIZE); + txHasher.Finalize(&(vchtxHash[0])); + + CHash256 nOutHasher; + std::stringstream ss; + ss << outPoint.n; + std::string snOut = ss.str(); + nOutHasher.Write((unsigned char*) snOut.data(), snOut.size()); + std::vector vchnOutHash(nOutHasher.OUTPUT_SIZE); + nOutHasher.Finalize(&(vchnOutHash[0])); + + CHash256 takeoverHasher; + std::vector vchTakeoverHeightToHash = heightToVch(nHeightOfLastTakeover); + takeoverHasher.Write(vchTakeoverHeightToHash.data(), vchTakeoverHeightToHash.size()); + std::vector vchTakeoverHash(takeoverHasher.OUTPUT_SIZE); + takeoverHasher.Finalize(&(vchTakeoverHash[0])); + + CHash256 hasher; + hasher.Write(vchtxHash.data(), vchtxHash.size()); + hasher.Write(vchnOutHash.data(), vchnOutHash.size()); + hasher.Write(vchTakeoverHash.data(), vchTakeoverHash.size()); + std::vector vchHash(hasher.OUTPUT_SIZE); + hasher.Finalize(&(vchHash[0])); + + uint256 valueHash(vchHash); + return valueHash; +} + +bool CClaimTrieNode::insertClaim(CClaimValue claim) +{ + claims.push_back(claim); + return true; +} + +bool CClaimTrieNode::removeClaim(const COutPoint& outPoint, CClaimValue& claim) +{ + std::vector::iterator itClaims; + for (itClaims = claims.begin(); itClaims != claims.end(); ++itClaims) + { + if (itClaims->outPoint == outPoint) + { + std::swap(claim, *itClaims); + break; + } + } + if (itClaims != claims.end()) + { + claims.erase(itClaims); + } + else + { + LogPrintf("CClaimTrieNode::%s() : asked to remove a claim that doesn't exist\n", __func__); + LogPrintf("CClaimTrieNode::%s() : claims that do exist:\n", __func__); + for (unsigned int i = 0; i < claims.size(); i++) + { + LogPrintf("\ttxhash: %s, nOut: %d:\n", claims[i].outPoint.hash.ToString(), claims[i].outPoint.n); + } + return false; + } + return true; +} + +bool CClaimTrieNode::getBestClaim(CClaimValue& claim) const +{ + if (claims.empty()) + return false; + + claim = claims.front(); + return true; +} + +bool CClaimTrieNode::haveClaim(const COutPoint& outPoint) const +{ + for (std::vector::const_iterator itclaim = claims.begin(); itclaim != claims.end(); ++itclaim) + { + if (itclaim->outPoint == outPoint) + return true; + } + return false; +} + +void CClaimTrieNode::reorderClaims(supportMapEntryType& supports) +{ + std::vector::iterator itclaim; + + for (itclaim = claims.begin(); itclaim != claims.end(); ++itclaim) + itclaim->nEffectiveAmount = itclaim->nAmount; + + for (supportMapEntryType::iterator itsupport = supports.begin(); itsupport != supports.end(); ++itsupport) + { + for (itclaim = claims.begin(); itclaim != claims.end(); ++itclaim) + { + if (itsupport->supportedClaimId == itclaim->claimId) + { + itclaim->nEffectiveAmount += itsupport->nAmount; + break; + } + } + } + + std::make_heap(claims.begin(), claims.end()); +} + +uint256 CClaimTrie::getMerkleHash() +{ + return root.hash; +} + +bool CClaimTrie::empty() const +{ + return root.empty(); +} + +template bool CClaimTrie::keyTypeEmpty(char keyType, K& /* throwaway */) const +{ + boost::scoped_ptr pcursor(const_cast(&db)->NewIterator()); + pcursor->SeekToFirst(); + + while (pcursor->Valid()) + { + std::pair key; + if (!pcursor->GetKey(key)) + break; + + if (key.first == keyType) + return false; + + pcursor->Next(); + } + return true; +} + +bool CClaimTrie::queueEmpty() const +{ + for (claimQueueType::const_iterator itRow = dirtyQueueRows.begin(); itRow != dirtyQueueRows.end(); ++itRow) + { + if (!itRow->second.empty()) + return false; + } + int throwaway; + return keyTypeEmpty(CLAIM_QUEUE_ROW, throwaway); +} + +bool CClaimTrie::expirationQueueEmpty() const +{ + for (expirationQueueType::const_iterator itRow = dirtyExpirationQueueRows.begin(); itRow != dirtyExpirationQueueRows.end(); ++itRow) + { + if (!itRow->second.empty()) + return false; + } + int throwaway; + return keyTypeEmpty(EXP_QUEUE_ROW, throwaway); +} + +bool CClaimTrie::supportEmpty() const +{ + for (supportMapType::const_iterator itNode = dirtySupportNodes.begin(); itNode != dirtySupportNodes.end(); ++itNode) + { + if (!itNode->second.empty()) + return false; + } + std::string throwaway; + return keyTypeEmpty(SUPPORT, throwaway); +} + +bool CClaimTrie::supportQueueEmpty() const +{ + for (supportQueueType::const_iterator itRow = dirtySupportQueueRows.begin(); itRow != dirtySupportQueueRows.end(); ++itRow) + { + if (!itRow->second.empty()) + return false; + } + int throwaway; + return keyTypeEmpty(SUPPORT_QUEUE_ROW, throwaway); +} + +void CClaimTrie::setExpirationTime(int t) +{ + nExpirationTime = t; + LogPrintf("%s: Expiration time is now %d\n", __func__, nExpirationTime); +} + +void CClaimTrie::clear() +{ + clear(&root); +} + +void CClaimTrie::clear(CClaimTrieNode* current) +{ + for (nodeMapType::const_iterator itchildren = current->children.begin(); itchildren != current->children.end(); ++itchildren) + { + clear(itchildren->second); + delete itchildren->second; + } + current->children.clear(); +} + +bool CClaimTrie::haveClaim(const std::string& name, const COutPoint& outPoint) const +{ + const CClaimTrieNode* current = &root; + for (std::string::const_iterator itname = name.begin(); itname != name.end(); ++itname) + { + nodeMapType::const_iterator itchildren = current->children.find(*itname); + if (itchildren == current->children.end()) + return false; + current = itchildren->second; + } + return current->haveClaim(outPoint); +} + +bool CClaimTrie::haveSupport(const std::string& name, const COutPoint& outPoint) const +{ + supportMapEntryType node; + if (!getSupportNode(name, node)) + return false; + + for (supportMapEntryType::const_iterator itnode = node.begin(); itnode != node.end(); ++itnode) + { + if (itnode->outPoint == outPoint) + return true; + } + return false; +} + +bool CClaimTrie::haveClaimInQueue(const std::string& name, const COutPoint& outPoint, int& nValidAtHeight) const +{ + queueNameRowType nameRow; + if (!getQueueNameRow(name, nameRow)) + { + return false; + } + queueNameRowType::const_iterator itNameRow; + for (itNameRow = nameRow.begin(); itNameRow != nameRow.end(); ++itNameRow) + { + if (itNameRow->outPoint == outPoint) + { + nValidAtHeight = itNameRow->nHeight; + break; + } + } + if (itNameRow == nameRow.end()) + { + return false; + } + claimQueueRowType row; + if (getQueueRow(nValidAtHeight, row)) + { + for (claimQueueRowType::const_iterator itRow = row.begin(); itRow != row.end(); ++itRow) + { + if (itRow->first == name && itRow->second.outPoint == outPoint) + { + if (itRow->second.nValidAtHeight != nValidAtHeight) + { + LogPrintf("%s: An inconsistency was found in the claim queue. Please report this to the developers:\nDifferent nValidAtHeight between named queue and height queue\n: name: %s, txid: %s, nOut: %d, nValidAtHeight in named queue: %d, nValidAtHeight in height queue: %d current height: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, nValidAtHeight, itRow->second.nValidAtHeight, nCurrentHeight); + } + return true; + } + } + } + LogPrintf("%s: An inconsistency was found in the claim queue. Please report this to the developers:\nFound in named queue but not in height queue: name: %s, txid: %s, nOut: %d, nValidAtHeight: %d, current height: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, nValidAtHeight, nCurrentHeight); + return false; +} + +bool CClaimTrie::haveSupportInQueue(const std::string& name, const COutPoint& outPoint, int& nValidAtHeight) const +{ + queueNameRowType nameRow; + if (!getSupportQueueNameRow(name, nameRow)) + return false; + + queueNameRowType::const_iterator itNameRow; + for (itNameRow = nameRow.begin(); itNameRow != nameRow.end(); ++itNameRow) + { + if (itNameRow->outPoint == outPoint) + { + nValidAtHeight = itNameRow->nHeight; + break; + } + } + if (itNameRow == nameRow.end()) + return false; + + supportQueueRowType row; + if (getSupportQueueRow(nValidAtHeight, row)) + { + for (supportQueueRowType::const_iterator itRow = row.begin(); itRow != row.end(); ++itRow) + { + if (itRow->first == name && itRow->second.outPoint == outPoint) + { + if (itRow->second.nValidAtHeight != nValidAtHeight) + { + LogPrintf("%s: An inconsistency was found in the support queue. Please report this to the developers:\nDifferent nValidAtHeight between named queue and height queue\n: name: %s, txid: %s, nOut: %d, nValidAtHeight in named queue: %d, nValidAtHeight in height queue: %d current height: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, nValidAtHeight, itRow->second.nValidAtHeight, nCurrentHeight); + } + return true; + } + } + } + LogPrintf("%s: An inconsistency was found in the claim queue. Please report this to the developers:\nFound in named queue but not in height queue: name: %s, txid: %s, nOut: %d, nValidAtHeight: %d, current height: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, nValidAtHeight, nCurrentHeight); + return false; +} + +unsigned int CClaimTrie::getTotalNamesInTrie() const +{ + if (empty()) + return 0; + const CClaimTrieNode* current = &root; + return getTotalNamesRecursive(current); +} + +unsigned int CClaimTrie::getTotalNamesRecursive(const CClaimTrieNode* current) const +{ + unsigned int names_in_subtrie = 0; + if (!(current->claims.empty())) + names_in_subtrie += 1; + for (nodeMapType::const_iterator it = current->children.begin(); it != current->children.end(); ++it) + { + names_in_subtrie += getTotalNamesRecursive(it->second); + } + return names_in_subtrie; +} + +unsigned int CClaimTrie::getTotalClaimsInTrie() const +{ + if (empty()) + return 0; + const CClaimTrieNode* current = &root; + return getTotalClaimsRecursive(current); +} + +unsigned int CClaimTrie::getTotalClaimsRecursive(const CClaimTrieNode* current) const +{ + unsigned int claims_in_subtrie = current->claims.size(); + for (nodeMapType::const_iterator it = current->children.begin(); it != current->children.end(); ++it) + { + claims_in_subtrie += getTotalClaimsRecursive(it->second); + } + return claims_in_subtrie; +} + +CAmount CClaimTrie::getTotalValueOfClaimsInTrie(bool fControllingOnly) const +{ + if (empty()) + return 0; + const CClaimTrieNode* current = &root; + return getTotalValueOfClaimsRecursive(current, fControllingOnly); +} + +CAmount CClaimTrie::getTotalValueOfClaimsRecursive(const CClaimTrieNode* current, bool fControllingOnly) const +{ + CAmount value_in_subtrie = 0; + for (std::vector::const_iterator itclaim = current->claims.begin(); itclaim != current->claims.end(); ++itclaim) + { + value_in_subtrie += itclaim->nAmount; + if (fControllingOnly) + break; + } + for (nodeMapType::const_iterator itchild = current->children.begin(); itchild != current->children.end(); ++itchild) + { + value_in_subtrie += getTotalValueOfClaimsRecursive(itchild->second, fControllingOnly); + } + return value_in_subtrie; +} + +const CClaimTrieNode* CClaimTrie::getNodeForName(const std::string& name) const +{ + auto current = const_cast(&root); + for (std::string::const_iterator itname = name.begin(); itname != name.end(); ++itname) + { + nodeMapType::const_iterator itchildren = current->children.find(*itname); + if (itchildren == current->children.end()) + return nullptr; + current = itchildren->second; + } + return current; +} + +bool CClaimTrie::getInfoForName(const std::string& name, CClaimValue& claim) const +{ + const CClaimTrieNode* current = getNodeForName(name); + return current ? current->getBestClaim(claim) : false; +} + +bool CClaimTrie::getLastTakeoverForName(const std::string& name, int& lastTakeoverHeight) const +{ + const CClaimTrieNode* current = getNodeForName(name); + if (current && !current->claims.empty()) + { + lastTakeoverHeight = current->nHeightOfLastTakeover; + return true; + } + return false; +} + +std::vector CClaimTrie::getClaimsForName(const std::string& name) const +{ + static const std::vector empty{}; + const CClaimTrieNode* current = getNodeForName(name); + return current == nullptr ? empty : current->claims; +} + +bool CClaimTrie::checkConsistency() const +{ + return empty() ? true : recursiveCheckConsistency(&root); +} + +bool CClaimTrie::recursiveCheckConsistency(const CClaimTrieNode* node) const +{ + std::vector vchToHash; + + for (nodeMapType::const_iterator it = node->children.begin(); it != node->children.end(); ++it) + { + if (!recursiveCheckConsistency(it->second)) + return false; + + vchToHash.push_back(it->first); + vchToHash.insert(vchToHash.end(), it->second->hash.begin(), it->second->hash.end()); + } + + CClaimValue claim; + if (node->getBestClaim(claim)) // hasClaim + { + uint256 valueHash = getValueHash(claim.outPoint, node->nHeightOfLastTakeover); + vchToHash.insert(vchToHash.end(), valueHash.begin(), valueHash.end()); + } + + CHash256 hasher; + std::vector vchHash(hasher.OUTPUT_SIZE); + hasher.Write(vchToHash.data(), vchToHash.size()); + hasher.Finalize(&(vchHash[0])); + uint256 calculatedHash(vchHash); + return calculatedHash == node->hash; +} + +void CClaimTrie::addToClaimIndex(const std::string& name, const CClaimValue& claim) +{ + CClaimIndexElement element = { name, claim }; + db.Write(std::make_pair(CLAIM_BY_ID, claim.claimId), element); +} + +void CClaimTrie::removeFromClaimIndex(const CClaimValue& claim) +{ + db.Erase(std::make_pair(CLAIM_BY_ID, claim.claimId)); +} + +bool CClaimTrie::getClaimById(const uint160 claimId, std::string& name, CClaimValue& claim) const +{ + CClaimIndexElement element; + if (db.Read(std::make_pair(CLAIM_BY_ID, claimId), element)) + { + if (element.claim.claimId == claimId) + { + name = element.name; + claim = element.claim; + return true; + } + + LogPrintf("%s: ClaimIndex[%s] returned unmatched claimId %s when looking for %s\n", + __func__, claimId.GetHex(), element.claim.claimId.GetHex(), name); + } + return false; +} + +bool CClaimTrie::getQueueRow(int nHeight, claimQueueRowType& row) const +{ + claimQueueType::const_iterator itQueueRow = dirtyQueueRows.find(nHeight); + if (itQueueRow != dirtyQueueRows.end()) + { + row = itQueueRow->second; + return true; + } + return db.Read(std::make_pair(CLAIM_QUEUE_ROW, nHeight), row); +} + +bool CClaimTrie::getQueueNameRow(const std::string& name, queueNameRowType& row) const +{ + queueNameType::const_iterator itQueueNameRow = dirtyQueueNameRows.find(name); + if (itQueueNameRow != dirtyQueueNameRows.end()) + { + row = itQueueNameRow->second; + return true; + } + return db.Read(std::make_pair(CLAIM_QUEUE_NAME_ROW, name), row); +} + +bool CClaimTrie::getExpirationQueueRow(int nHeight, expirationQueueRowType& row) const +{ + expirationQueueType::const_iterator itQueueRow = dirtyExpirationQueueRows.find(nHeight); + if (itQueueRow != dirtyExpirationQueueRows.end()) + { + row = itQueueRow->second; + return true; + } + return db.Read(std::make_pair(EXP_QUEUE_ROW, nHeight), row); +} + +void CClaimTrie::updateQueueRow(int nHeight, claimQueueRowType& row) +{ + claimQueueType::iterator itQueueRow = dirtyQueueRows.find(nHeight); + if (itQueueRow == dirtyQueueRows.end()) + { + claimQueueRowType newRow; + std::pair ret; + ret = dirtyQueueRows.insert(std::pair(nHeight, newRow)); + assert(ret.second); + itQueueRow = ret.first; + } + itQueueRow->second.swap(row); +} + +void CClaimTrie::updateQueueNameRow(const std::string& name, queueNameRowType& row) +{ + queueNameType::iterator itQueueRow = dirtyQueueNameRows.find(name); + if (itQueueRow == dirtyQueueNameRows.end()) + { + queueNameRowType newRow; + std::pair ret; + ret = dirtyQueueNameRows.insert(std::pair(name, newRow)); + assert(ret.second); + itQueueRow = ret.first; + } + itQueueRow->second.swap(row); +} + +void CClaimTrie::updateExpirationRow(int nHeight, expirationQueueRowType& row) +{ + expirationQueueType::iterator itQueueRow = dirtyExpirationQueueRows.find(nHeight); + if (itQueueRow == dirtyExpirationQueueRows.end()) + { + expirationQueueRowType newRow; + std::pair ret; + ret = dirtyExpirationQueueRows.insert(std::pair(nHeight, newRow)); + assert(ret.second); + itQueueRow = ret.first; + } + itQueueRow->second.swap(row); +} + +void CClaimTrie::updateSupportMap(const std::string& name, supportMapEntryType& node) +{ + supportMapType::iterator itNode = dirtySupportNodes.find(name); + if (itNode == dirtySupportNodes.end()) + { + supportMapEntryType newNode; + std::pair ret; + ret = dirtySupportNodes.insert(std::pair(name, newNode)); + assert(ret.second); + itNode = ret.first; + } + itNode->second.swap(node); +} + +void CClaimTrie::updateSupportQueue(int nHeight, supportQueueRowType& row) +{ + supportQueueType::iterator itQueueRow = dirtySupportQueueRows.find(nHeight); + if (itQueueRow == dirtySupportQueueRows.end()) + { + supportQueueRowType newRow; + std::pair ret; + ret = dirtySupportQueueRows.insert(std::pair(nHeight, newRow)); + assert(ret.second); + itQueueRow = ret.first; + } + itQueueRow->second.swap(row); +} + +void CClaimTrie::updateSupportNameQueue(const std::string& name, queueNameRowType& row) +{ + queueNameType::iterator itQueueRow = dirtySupportQueueNameRows.find(name); + if (itQueueRow == dirtySupportQueueNameRows.end()) + { + queueNameRowType newRow; + std::pair ret; + ret = dirtySupportQueueNameRows.insert(std::pair(name, newRow)); + assert(ret.second); + itQueueRow = ret.first; + } + itQueueRow->second.swap(row); +} + +void CClaimTrie::updateSupportExpirationQueue(int nHeight, expirationQueueRowType& row) +{ + expirationQueueType::iterator itQueueRow = dirtySupportExpirationQueueRows.find(nHeight); + if (itQueueRow == dirtySupportExpirationQueueRows.end()) + { + expirationQueueRowType newRow; + std::pair ret; + ret = dirtySupportExpirationQueueRows.insert(std::pair(nHeight, newRow)); + assert(ret.second); + itQueueRow = ret.first; + } + itQueueRow->second.swap(row); +} + +bool CClaimTrie::getSupportNode(std::string name, supportMapEntryType& node) const +{ + supportMapType::const_iterator itNode = dirtySupportNodes.find(name); + if (itNode != dirtySupportNodes.end()) + { + node = itNode->second; + return true; + } + return db.Read(std::make_pair(SUPPORT, name), node); +} + +bool CClaimTrie::getSupportQueueRow(int nHeight, supportQueueRowType& row) const +{ + supportQueueType::const_iterator itQueueRow = dirtySupportQueueRows.find(nHeight); + if (itQueueRow != dirtySupportQueueRows.end()) + { + row = itQueueRow->second; + return true; + } + return db.Read(std::make_pair(SUPPORT_QUEUE_ROW, nHeight), row); +} + +bool CClaimTrie::getSupportQueueNameRow(const std::string& name, queueNameRowType& row) const +{ + queueNameType::const_iterator itQueueNameRow = dirtySupportQueueNameRows.find(name); + if (itQueueNameRow != dirtySupportQueueNameRows.end()) + { + row = itQueueNameRow->second; + return true; + } + return db.Read(std::make_pair(SUPPORT_QUEUE_NAME_ROW, name), row); +} + +bool CClaimTrie::getSupportExpirationQueueRow(int nHeight, expirationQueueRowType& row) const +{ + expirationQueueType::const_iterator itQueueRow = dirtySupportExpirationQueueRows.find(nHeight); + if (itQueueRow != dirtySupportExpirationQueueRows.end()) + { + row = itQueueRow->second; + return true; + } + return db.Read(std::make_pair(SUPPORT_EXP_QUEUE_ROW, nHeight), row); +} + +bool CClaimTrie::update(nodeCacheType& cache, hashMapType& hashes, std::map& takeoverHeights, const uint256& hashBlockIn, claimQueueType& queueCache, queueNameType& queueNameCache, expirationQueueType& expirationQueueCache, int nNewHeight, supportMapType& supportCache, supportQueueType& supportQueueCache, queueNameType& supportQueueNameCache, expirationQueueType& supportExpirationQueueCache) +{ + for (nodeCacheType::iterator itcache = cache.begin(); itcache != cache.end(); ++itcache) + { + if (!updateName(itcache->first, itcache->second)) + { + LogPrintf("%s: Failed to update name for: %s\n", __func__, itcache->first); + return false; + } + } + for (hashMapType::iterator ithash = hashes.begin(); ithash != hashes.end(); ++ithash) + { + if (!updateHash(ithash->first, ithash->second)) + { + LogPrintf("%s: Failed to update hash for: %s\n", __func__, ithash->first); + return false; + } + } + for (std::map::iterator itheight = takeoverHeights.begin(); itheight != takeoverHeights.end(); ++itheight) + { + if (!updateTakeoverHeight(itheight->first, itheight->second)) + { + LogPrintf("%s: Failed to update takeover height for: %s\n", __func__, itheight->first); + return false; + } + } + for (claimQueueType::iterator itQueueCacheRow = queueCache.begin(); itQueueCacheRow != queueCache.end(); ++itQueueCacheRow) + { + updateQueueRow(itQueueCacheRow->first, itQueueCacheRow->second); + } + for (queueNameType::iterator itQueueNameCacheRow = queueNameCache.begin(); itQueueNameCacheRow != queueNameCache.end(); ++itQueueNameCacheRow) + { + updateQueueNameRow(itQueueNameCacheRow->first, itQueueNameCacheRow->second); + } + for (expirationQueueType::iterator itExpirationRow = expirationQueueCache.begin(); itExpirationRow != expirationQueueCache.end(); ++itExpirationRow) + { + updateExpirationRow(itExpirationRow->first, itExpirationRow->second); + } + for (supportMapType::iterator itSupportCache = supportCache.begin(); itSupportCache != supportCache.end(); ++itSupportCache) + { + updateSupportMap(itSupportCache->first, itSupportCache->second); + } + for (supportQueueType::iterator itSupportQueue = supportQueueCache.begin(); itSupportQueue != supportQueueCache.end(); ++itSupportQueue) + { + updateSupportQueue(itSupportQueue->first, itSupportQueue->second); + } + for (queueNameType::iterator itSupportNameQueue = supportQueueNameCache.begin(); itSupportNameQueue != supportQueueNameCache.end(); ++itSupportNameQueue) + { + updateSupportNameQueue(itSupportNameQueue->first, itSupportNameQueue->second); + } + for (expirationQueueType::iterator itSupportExpirationQueue = supportExpirationQueueCache.begin(); itSupportExpirationQueue != supportExpirationQueueCache.end(); ++itSupportExpirationQueue) + { + updateSupportExpirationQueue(itSupportExpirationQueue->first, itSupportExpirationQueue->second); + } + hashBlock = hashBlockIn; + nCurrentHeight = nNewHeight; + return true; +} + +void CClaimTrie::markNodeDirty(const std::string &name, CClaimTrieNode* node) +{ + std::pair ret; + ret = dirtyNodes.insert(std::pair(name, node)); + if (ret.second == false) + ret.first->second = node; +} + +bool CClaimTrie::updateName(const std::string &name, CClaimTrieNode* updatedNode) +{ + CClaimTrieNode* current = &root; + for (std::string::const_iterator itname = name.begin(); itname != name.end(); ++itname) + { + nodeMapType::iterator itchild = current->children.find(*itname); + if (itchild == current->children.end()) + { + if (itname + 1 != name.end()) + return false; + + CClaimTrieNode* newNode = new CClaimTrieNode(); + current->children[*itname] = newNode; + current = newNode; + } + else + { + current = itchild->second; + } + } + assert(current != nullptr); + current->claims.swap(updatedNode->claims); + markNodeDirty(name, current); + for (nodeMapType::iterator itchild = current->children.begin(); itchild != current->children.end();) + { + nodeMapType::iterator itupdatechild = updatedNode->children.find(itchild->first); + if (itupdatechild == updatedNode->children.end()) + { + // This character has apparently been deleted, so delete + // all descendents from this child. + std::stringstream nextName; + nextName << name << itchild->first; + if (!recursiveNullify(itchild->second, nextName.str())) + return false; + current->children.erase(itchild++); + } + else + { + ++itchild; + } + } + return true; +} + +bool CClaimTrie::recursiveNullify(CClaimTrieNode* node, const std::string& name) +{ + assert(node != nullptr); + for (nodeMapType::iterator itchild = node->children.begin(); itchild != node->children.end(); ++itchild) + { + std::stringstream nextName; + nextName << name << itchild->first; + if (!recursiveNullify(itchild->second, nextName.str())) + return false; + } + node->children.clear(); + markNodeDirty(name, nullptr); + delete node; + + return true; +} + +bool CClaimTrie::updateHash(const std::string& name, uint256& hash) +{ + CClaimTrieNode* current = &root; + for (std::string::const_iterator itname = name.begin(); itname != name.end(); ++itname) + { + nodeMapType::iterator itchild = current->children.find(*itname); + if (itchild == current->children.end()) + return false; + current = itchild->second; + } + assert(current != nullptr); + assert(!hash.IsNull()); + current->hash = hash; + markNodeDirty(name, current); + return true; +} + +bool CClaimTrie::updateTakeoverHeight(const std::string& name, int nTakeoverHeight) +{ + CClaimTrieNode* current = &root; + for (std::string::const_iterator itname = name.begin(); itname != name.end(); ++itname) + { + nodeMapType::iterator itchild = current->children.find(*itname); + if (itchild == current->children.end()) + return false; + current = itchild->second; + } + assert(current != nullptr); + current->nHeightOfLastTakeover = nTakeoverHeight; + markNodeDirty(name, current); + return true; +} + +void CClaimTrie::BatchWriteNode(CDBBatch& batch, const std::string& name, const CClaimTrieNode* pNode) const +{ + if (pNode) + batch.Write(std::make_pair(TRIE_NODE, name), *pNode); + else + batch.Erase(std::make_pair(TRIE_NODE, name)); +} + +void CClaimTrie::BatchWriteQueueRows(CDBBatch& batch) +{ + for (claimQueueType::iterator itQueue = dirtyQueueRows.begin(); itQueue != dirtyQueueRows.end(); ++itQueue) + { + if (itQueue->second.empty()) + { + batch.Erase(std::make_pair(CLAIM_QUEUE_ROW, itQueue->first)); + } + else + { + batch.Write(std::make_pair(CLAIM_QUEUE_ROW, itQueue->first), itQueue->second); + } + } +} + +void CClaimTrie::BatchWriteQueueNameRows(CDBBatch& batch) +{ + for (queueNameType::iterator itQueue = dirtyQueueNameRows.begin(); itQueue != dirtyQueueNameRows.end(); ++itQueue) + { + if (itQueue->second.empty()) + { + batch.Erase(std::make_pair(CLAIM_QUEUE_NAME_ROW, itQueue->first)); + } + else + { + batch.Write(std::make_pair(CLAIM_QUEUE_NAME_ROW, itQueue->first), itQueue->second); + } + } +} + +void CClaimTrie::BatchWriteExpirationQueueRows(CDBBatch& batch) +{ + for (expirationQueueType::iterator itQueue = dirtyExpirationQueueRows.begin(); itQueue != dirtyExpirationQueueRows.end(); ++itQueue) + { + if (itQueue->second.empty()) + { + batch.Erase(std::make_pair(EXP_QUEUE_ROW, itQueue->first)); + } + else + { + batch.Write(std::make_pair(EXP_QUEUE_ROW, itQueue->first), itQueue->second); + } + } +} + +void CClaimTrie::BatchWriteSupportNodes(CDBBatch& batch) +{ + for (supportMapType::iterator itSupport = dirtySupportNodes.begin(); itSupport != dirtySupportNodes.end(); ++itSupport) + { + if (itSupport->second.empty()) + { + batch.Erase(std::make_pair(SUPPORT, itSupport->first)); + } + else + { + batch.Write(std::make_pair(SUPPORT, itSupport->first), itSupport->second); + } + } +} + +void CClaimTrie::BatchWriteSupportQueueRows(CDBBatch& batch) +{ + for (supportQueueType::iterator itQueue = dirtySupportQueueRows.begin(); itQueue != dirtySupportQueueRows.end(); ++itQueue) + { + if (itQueue->second.empty()) + { + batch.Erase(std::make_pair(SUPPORT_QUEUE_ROW, itQueue->first)); + } + else + { + batch.Write(std::make_pair(SUPPORT_QUEUE_ROW, itQueue->first), itQueue->second); + } + } +} + +void CClaimTrie::BatchWriteSupportQueueNameRows(CDBBatch& batch) +{ + for (queueNameType::iterator itQueue = dirtySupportQueueNameRows.begin(); itQueue != dirtySupportQueueNameRows.end(); ++itQueue) + { + if (itQueue->second.empty()) + { + batch.Erase(std::make_pair(SUPPORT_QUEUE_NAME_ROW, itQueue->first)); + } + else + { + batch.Write(std::make_pair(SUPPORT_QUEUE_NAME_ROW, itQueue->first), itQueue->second); + } + } +} + +void CClaimTrie::BatchWriteSupportExpirationQueueRows(CDBBatch& batch) +{ + for (expirationQueueType::iterator itQueue = dirtySupportExpirationQueueRows.begin(); itQueue != dirtySupportExpirationQueueRows.end(); ++itQueue) + { + if (itQueue->second.empty()) + { + batch.Erase(std::make_pair(SUPPORT_EXP_QUEUE_ROW, itQueue->first)); + } + else + { + batch.Write(std::make_pair(SUPPORT_EXP_QUEUE_ROW, itQueue->first), itQueue->second); + } + } +} + +bool CClaimTrie::WriteToDisk() +{ + CDBBatch batch(db); + for (nodeCacheType::iterator itcache = dirtyNodes.begin(); itcache != dirtyNodes.end(); ++itcache) + BatchWriteNode(batch, itcache->first, itcache->second); + dirtyNodes.clear(); + BatchWriteQueueRows(batch); + dirtyQueueRows.clear(); + BatchWriteQueueNameRows(batch); + dirtyQueueNameRows.clear(); + BatchWriteExpirationQueueRows(batch); + dirtyExpirationQueueRows.clear(); + BatchWriteSupportNodes(batch); + dirtySupportNodes.clear(); + BatchWriteSupportQueueRows(batch); + dirtySupportQueueRows.clear(); + BatchWriteSupportQueueNameRows(batch); + dirtySupportQueueNameRows.clear(); + BatchWriteSupportExpirationQueueRows(batch); + dirtySupportExpirationQueueRows.clear(); + batch.Write(HASH_BLOCK, hashBlock); + batch.Write(CURRENT_HEIGHT, nCurrentHeight); + return db.WriteBatch(batch); +} + +bool CClaimTrie::InsertFromDisk(const std::string& name, CClaimTrieNode* node) +{ + if (name.empty()) + { + root = *node; + return true; + } + CClaimTrieNode* current = &root; + for (std::string::const_iterator itname = name.begin(); itname + 1 != name.end(); ++itname) + { + nodeMapType::iterator itchild = current->children.find(*itname); + if (itchild == current->children.end()) + return false; + current = itchild->second; + } + current->children[name[name.size() - 1]] = node; + return true; +} + +bool CClaimTrie::ReadFromDisk(bool check) +{ + if (!db.Read(HASH_BLOCK, hashBlock)) + LogPrintf("%s: Couldn't read the best block's hash\n", __func__); + if (!db.Read(CURRENT_HEIGHT, nCurrentHeight)) + LogPrintf("%s: Couldn't read the current height\n", __func__); + setExpirationTime(Params().GetConsensus().GetExpirationTime(nCurrentHeight-1)); + + boost::scoped_ptr pcursor(db.NewIterator()); + + pcursor->SeekToFirst(); + while (pcursor->Valid()) + { + std::pair key; + if (pcursor->GetKey(key)) + { + if (key.first == TRIE_NODE) + { + CClaimTrieNode* node = new CClaimTrieNode(); + if (pcursor->GetValue(*node)) + { + if (!InsertFromDisk(key.second, node)) + { + return error("%s(): error restoring claim trie from disk", __func__); + } + } + else + { + return error("%s(): error reading claim trie from disk", __func__); + } + } + } + pcursor->Next(); + } + + if (check) + { + LogPrintf("Checking Claim trie consistency..."); + if (checkConsistency()) + { + LogPrintf("consistent\n"); + return true; + } + LogPrintf("inconsistent!\n"); + return false; + } + return true; +} + +bool CClaimTrieCacheBase::recursiveComputeMerkleHash(CClaimTrieNode* tnCurrent, const std::string& sPos, bool forceCompute) const +{ + if ((sPos == rootClaimName) && tnCurrent->empty()) + { + cacheHashes[rootClaimName] = uint256S(rootClaimHash); + return true; + } + std::vector vchToHash; + nodeCacheType::iterator cachedNode; + + for (nodeMapType::iterator it = tnCurrent->children.begin(); it != tnCurrent->children.end(); ++it) + { + std::stringstream ss; + ss << sPos << it->first; + const std::string& sNextPos = ss.str(); + if ((dirtyHashes.count(sNextPos) != 0) || forceCompute) + { + // the child might be in the cache, so look for it there + cachedNode = cache.find(sNextPos); + if (cachedNode != cache.end()) + recursiveComputeMerkleHash(cachedNode->second, sNextPos, forceCompute); + else + recursiveComputeMerkleHash(it->second, sNextPos, forceCompute); + } + vchToHash.push_back(sNextPos[sNextPos.size() - 1]); + + hashMapType::iterator ithash = cacheHashes.find(sNextPos); + if (ithash != cacheHashes.end()) + { + assert(!ithash->second.IsNull()); // fast call if it's not actually null (as the first byte will bail) + vchToHash.insert(vchToHash.end(), ithash->second.begin(), ithash->second.end()); + } + else + { + assert(!it->second->hash.IsNull()); + vchToHash.insert(vchToHash.end(), it->second->hash.begin(), it->second->hash.end()); + } + } + + CClaimValue claim; + if (tnCurrent->getBestClaim(claim)) // hasClaim + { + int nHeightOfLastTakeover; + assert(getLastTakeoverForName(sPos, nHeightOfLastTakeover)); + uint256 valueHash = getValueHash(claim.outPoint, nHeightOfLastTakeover); + vchToHash.insert(vchToHash.end(), valueHash.begin(), valueHash.end()); + } + + CHash256 hasher; + hasher.Write(vchToHash.data(), vchToHash.size()); + std::vector vchHash(hasher.OUTPUT_SIZE); + hasher.Finalize(&(vchHash[0])); + cacheHashes[sPos] = uint256(vchHash); + dirtyHashes.erase(sPos); + + return true; +} + +uint256 CClaimTrieCacheBase::getMerkleHash(bool forceCompute) const +{ + if (empty()) + { + static const uint256 one(uint256S(rootClaimHash)); + return one; + } + if (forceCompute || dirty()) + { + CClaimTrieNode* root = getRoot(); + recursiveComputeMerkleHash(root, rootClaimName, forceCompute); + dirtyHashes.clear(); + } + hashMapType::iterator ithash = cacheHashes.find(rootClaimName); + return ((ithash != cacheHashes.end()) ? ithash->second : base->root.hash); +} + +bool CClaimTrieCacheBase::empty() const +{ + return base->empty() && cache.empty(); +} + +// "position" has already been normalized if needed +CClaimTrieNode* CClaimTrieCacheBase::addNodeToCache(const std::string& position, CClaimTrieNode* original) const +{ + // create a copy of the node in the cache, if new node, create empty node + CClaimTrieNode* cacheCopy = (original ? new CClaimTrieNode(*original) : new CClaimTrieNode()); + cache[position] = cacheCopy; + + // check to see if there is the original node in block_originals, + // if not, add it to block_originals cache + nodeCacheType::const_iterator itOriginals = block_originals.find(position); + if (block_originals.end() == itOriginals) + block_originals[position] = (original ? new CClaimTrieNode(*original) : new CClaimTrieNode()); + + return cacheCopy; +} + +bool CClaimTrieCacheBase::getOriginalInfoForName(const std::string& name, CClaimValue& claim) const +{ + nodeCacheType::const_iterator itOriginalCache = block_originals.find(name); + return ((itOriginalCache == block_originals.end()) ? base->getInfoForName(name, claim) : + itOriginalCache->second->getBestClaim(claim)); +} + +bool CClaimTrieCacheBase::insertClaimIntoTrie(const std::string& name, CClaimValue claim, bool fCheckTakeover) const +{ + CClaimTrieNode* currentNode = getRoot(); + nodeCacheType::iterator cachedNode; + for (std::string::const_iterator itCur = name.begin(); itCur != name.end(); ++itCur) + { + const std::string sCurrentSubstring(name.begin(), itCur); + const std::string sNextSubstring(name.begin(), itCur + 1); + + cachedNode = cache.find(sNextSubstring); + if (cachedNode != cache.end()) + { + currentNode = cachedNode->second; + continue; + } + nodeMapType::iterator childNode = currentNode->children.find(*itCur); + if (childNode != currentNode->children.end()) + { + currentNode = childNode->second; + continue; + } + + // This next substring doesn't exist in the cache and the next + // character doesn't exist in current node's children, so check + // if the current node is in the cache, and if it's not, copy + // it and stick it in the cache, and then create a new node as + // its child and stick that in the cache. We have to have both + // this node and its child in the cache so that the current + // node's child map will contain the next letter, which will be + // used to find the child in the cache. This is necessary in + // order to calculate the merkle hash. + cachedNode = cache.find(sCurrentSubstring); + if (cachedNode != cache.end()) + { + assert(cachedNode->second == currentNode); + } + else + { + currentNode = addNodeToCache(sCurrentSubstring, currentNode); + } + CClaimTrieNode* newNode = addNodeToCache(sNextSubstring, nullptr); + currentNode->children[*itCur] = newNode; + currentNode = newNode; + } + + cachedNode = cache.find(name); + if (cachedNode != cache.end()) + { + assert(cachedNode->second == currentNode); + } + else + { + currentNode = addNodeToCache(name, currentNode); + } + bool fChanged = false; + if (currentNode->claims.empty()) + { + fChanged = true; + currentNode->insertClaim(claim); + } + else + { + CClaimValue currentTop = currentNode->claims.front(); + currentNode->insertClaim(claim); + supportMapEntryType node; + getSupportsForName(name, node); + currentNode->reorderClaims(node); + if (currentTop != currentNode->claims.front()) + fChanged = true; + } + + if (fChanged) + { + for (std::string::const_iterator itCur = name.begin(); itCur != name.end(); ++itCur) + { + std::string sub(name.begin(), itCur); + dirtyHashes.insert(sub); + } + dirtyHashes.insert(name); + if (fCheckTakeover) + namesToCheckForTakeover.insert(name); + } + return true; +} + +bool CClaimTrieCacheBase::removeClaimFromTrie(const std::string& name, const COutPoint& outPoint, CClaimValue& claim, bool fCheckTakeover) const +{ + CClaimTrieNode* currentNode = getRoot(); + nodeCacheType::iterator cachedNode; + assert(currentNode != nullptr); // If there is no root in either the trie or the cache, how can there be any names to remove? + for (std::string::const_iterator itCur = name.begin(); itCur != name.end(); ++itCur) + { + std::string sCurrentSubstring(name.begin(), itCur); + std::string sNextSubstring(name.begin(), itCur + 1); + + cachedNode = cache.find(sNextSubstring); + if (cachedNode != cache.end()) + { + currentNode = cachedNode->second; + continue; + } + nodeMapType::iterator childNode = currentNode->children.find(*itCur); + if (childNode != currentNode->children.end()) + { + currentNode = childNode->second; + continue; + } + LogPrintf("%s: The name %s does not exist in the trie\n", __func__, name.c_str()); + return false; + } + + cachedNode = cache.find(name); + if (cachedNode != cache.end()) + assert(cachedNode->second == currentNode); + else + currentNode = addNodeToCache(name, currentNode); + + assert(currentNode != nullptr); + if (currentNode->claims.empty()) + { + LogPrintf("%s: Asked to remove claim from node without claims\n", __func__); + return false; + } + + bool success = currentNode->removeClaim(outPoint, claim); + if (!currentNode->claims.empty()) + { + supportMapEntryType node; + getSupportsForName(name, node); + currentNode->reorderClaims(node); + } + + if (!success) + { + LogPrintf("%s: Removing a claim was unsuccessful. name = %s, txhash = %s, nOut = %d\n", + __func__, name.c_str(), outPoint.hash.GetHex(), outPoint.n); + return false; + } + + for (std::string::const_iterator itCur = name.begin(); itCur != name.end(); ++itCur) + { + std::string sub(name.begin(), itCur); + dirtyHashes.insert(sub); + } + dirtyHashes.insert(name); + if (fCheckTakeover) + namesToCheckForTakeover.insert(name); + + return recursivePruneName(getRoot(), 0, name); +} + +// sName has already been normalized if needed +bool CClaimTrieCacheBase::recursivePruneName(CClaimTrieNode* tnCurrent, unsigned int nPos, const std::string& sName, bool* pfNullified) const +{ + // Recursively prune leaf node(s) without any claims in it and store + // the modified nodes in the cache + + bool fNullified = false; + std::string sCurrentSubstring = sName.substr(0, nPos); + if (nPos < sName.size()) + { + std::string sNextSubstring = sName.substr(0, nPos + 1); + unsigned char cNext = sName.at(nPos); + CClaimTrieNode* tnNext = nullptr; + nodeCacheType::iterator cachedNode = cache.find(sNextSubstring); + if (cachedNode != cache.end()) + { + tnNext = cachedNode->second; + } + else + { + nodeMapType::iterator childNode = tnCurrent->children.find(cNext); + if (childNode != tnCurrent->children.end()) + tnNext = childNode->second; + } + if (tnNext == nullptr) + return false; + bool fChildNullified = false; + if (!recursivePruneName(tnNext, nPos + 1, sName, &fChildNullified)) + return false; + if (fChildNullified) + { + // If the child nullified itself, the child should already be + // out of the cache, and the character must now be removed + // from the current node's map of child nodes to ensure that + // it isn't found when calculating the merkle hash. But + // tnCurrent isn't necessarily in the cache. If it's not, it + // has to be added to the cache, so nothing is changed in the + // trie. If the current node is added to the cache, however, + // that does not imply that the parent node must be altered to + // reflect that its child is now in the cache, since it + // already has a character in its child map which will be used + // when calculating the merkle root. + + // First, find out if this node is in the cache. + cachedNode = cache.find(sCurrentSubstring); + if (cachedNode == cache.end()) + { + // it isn't, so make a copy, stick it in the cache, + // and make it the new current node + tnCurrent = addNodeToCache(sCurrentSubstring, tnCurrent); + } + // erase the character from the current node, which is + // now guaranteed to be in the cache + nodeMapType::iterator childNode = tnCurrent->children.find(cNext); + if (childNode != tnCurrent->children.end()) + tnCurrent->children.erase(childNode); + else + return false; + } + } + if (!sCurrentSubstring.empty() && tnCurrent->empty()) + { + // If the current node is in the cache, remove it from there + nodeCacheType::iterator cachedNode = cache.find(sCurrentSubstring); + if (cachedNode != cache.end()) + { + assert(tnCurrent == cachedNode->second); + delete tnCurrent; + cache.erase(cachedNode); + } + fNullified = true; + } + if (pfNullified) + *pfNullified = fNullified; + return true; +} + +claimQueueType::iterator CClaimTrieCacheBase::getQueueCacheRow(int nHeight, bool createIfNotExists) const +{ + claimQueueType::iterator itQueueRow = claimQueueCache.find(nHeight); + if (itQueueRow == claimQueueCache.end()) + { + // Have to make a new row it put in the cache, if createIfNotExists is true + claimQueueRowType queueRow; + // If the row exists in the base, copy its claims into the new row. + bool exists = base->getQueueRow(nHeight, queueRow); + if (!exists && !createIfNotExists) + return itQueueRow; + // Stick the new row in the cache + std::pair ret; + ret = claimQueueCache.insert(std::pair(nHeight, queueRow)); + assert(ret.second); + itQueueRow = ret.first; + } + return itQueueRow; +} + +queueNameType::iterator CClaimTrieCacheBase::getQueueCacheNameRow(const std::string& name, bool createIfNotExists) const +{ + queueNameType::iterator itQueueNameRow = claimQueueNameCache.find(name); + if (itQueueNameRow == claimQueueNameCache.end()) + { + // Have to make a new name row and put it in the cache, if createIfNotExists is true + queueNameRowType queueNameRow; + // If the row exists in the base, copy its claims into the new row. + bool exists = base->getQueueNameRow(name, queueNameRow); + if (!exists && !createIfNotExists) + return itQueueNameRow; + // Stick the new row in the cache + std::pair ret; + ret = claimQueueNameCache.insert(std::pair(name, queueNameRow)); + assert(ret.second); + itQueueNameRow = ret.first; + } + return itQueueNameRow; +} + +bool CClaimTrieCacheBase::addClaim(const std::string& name, const COutPoint& outPoint, uint160 claimId, CAmount nAmount, int nHeight) const +{ + LogPrintf("%s: name: %s, txhash: %s, nOut: %d, claimId: %s, nAmount: %u, nHeight: %d, nCurrentHeight: %lu\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, claimId.GetHex(), nAmount, nHeight, nCurrentHeight); + assert(nHeight == nCurrentHeight); + + int delayForClaim = getDelayForName(name, claimId); + CClaimValue claim(outPoint, claimId, nAmount, nHeight, nHeight + delayForClaim); + addClaimToQueues(name, claim); + CClaimIndexElement element = { name, claim }; + claimsToAdd.push_back(element); + return true; +} + +bool CClaimTrieCacheBase::undoSpendClaim(const std::string& name, const COutPoint& outPoint, uint160 claimId, CAmount nAmount, int nHeight, int nValidAtHeight) const +{ + LogPrintf("%s: name: %s, txhash: %s, nOut: %d, claimId: %s, nAmount: %d, nHeight: %d, nValidAtHeight: %d, nCurrentHeight: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, claimId.GetHex(), nAmount, nHeight, nValidAtHeight, nCurrentHeight); + CClaimValue claim(outPoint, claimId, nAmount, nHeight, nValidAtHeight); + if (nValidAtHeight < nCurrentHeight) + { + nameOutPointType entry(adjustNameForValidHeight(name, nValidAtHeight), claim.outPoint); + addToExpirationQueue(claim.nHeight + base->nExpirationTime, entry); + CClaimIndexElement element = {name, claim}; + claimsToAdd.push_back(element); + return insertClaimIntoTrie(name, claim, false); + } + addClaimToQueues(name, claim); + CClaimIndexElement element = { name, claim }; + claimsToAdd.push_back(element); + return true; +} + +void CClaimTrieCacheBase::addClaimToQueues(const std::string& name, CClaimValue& claim) const +{ + // name is not normalized and we always keep the original name data in the queues and index + claimQueueEntryType entry(name, claim); + claimQueueType::iterator itQueueRow = getQueueCacheRow(claim.nValidAtHeight, true); + queueNameType::iterator itQueueNameRow = getQueueCacheNameRow(name, true); + itQueueRow->second.push_back(entry); + itQueueNameRow->second.push_back(outPointHeightType(claim.outPoint, claim.nValidAtHeight)); + + nameOutPointType expireEntry(name, claim.outPoint); + addToExpirationQueue(claim.nHeight + base->nExpirationTime, expireEntry); +} + +std::string CClaimTrieCacheBase::adjustNameForValidHeight(const std::string& name, int validHeight) const { + return name; +} + +bool CClaimTrieCacheBase::removeClaimFromQueue(const std::string& name, const COutPoint& outPoint, CClaimValue& claim) const +{ + queueNameType::iterator itQueueNameRow = getQueueCacheNameRow(name, false); + if (itQueueNameRow == claimQueueNameCache.end()) + return false; + + queueNameRowType::iterator itQueueName; + for (itQueueName = itQueueNameRow->second.begin(); itQueueName != itQueueNameRow->second.end(); ++itQueueName) + { + if (itQueueName->outPoint == outPoint) + break; + } + if (itQueueName == itQueueNameRow->second.end()) + return false; + + claimQueueType::iterator itQueueRow = getQueueCacheRow(itQueueName->nHeight, false); + if (itQueueRow != claimQueueCache.end()) + { + claimQueueRowType::iterator itQueue; + // compare normalized names for the UPDATE_OP; we allow you to change the case on an update after the fork + for (itQueue = itQueueRow->second.begin(); itQueue != itQueueRow->second.end(); ++itQueue) + { + if (itQueue->second.outPoint == outPoint && name == itQueue->first) + break; + } + if (itQueue != itQueueRow->second.end()) + { + claim = itQueue->second; + itQueueNameRow->second.erase(itQueueName); + itQueueRow->second.erase(itQueue); + return true; + } + } + LogPrintf("%s: An inconsistency was found in the claim queue. Please report this to the developers:\nFound in named queue but not in height queue: name: %s, txid: %s, nOut: %d, nValidAtHeight: %d, current height: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, itQueueName->nHeight, nCurrentHeight); + return false; +} + +bool CClaimTrieCacheBase::undoAddClaim(const std::string& name, const COutPoint& outPoint, int nHeight) const +{ + int throwaway; + return removeClaim(name, outPoint, nHeight, throwaway, false); +} + +bool CClaimTrieCacheBase::spendClaim(const std::string& name, const COutPoint& outPoint, int nHeight, int& nValidAtHeight) const +{ + return removeClaim(name, outPoint, nHeight, nValidAtHeight, true); +} + +bool CClaimTrieCacheBase::removeClaim(const std::string& name, const COutPoint& outPoint, int nHeight, int& nValidAtHeight, bool fCheckTakeover) const +{ + LogPrintf("%s: name: %s, txhash: %s, nOut: %s, nHeight: %s, nCurrentHeight: %s\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, nHeight, nCurrentHeight); + bool removed = false; + CClaimValue claim; + nValidAtHeight = nHeight + getDelayForName(name); + std::string adjusted = adjustNameForValidHeight(name, nValidAtHeight); + + if (removeClaimFromQueue(adjusted, outPoint, claim)) + // assert(claim.nValidAtHeight == nValidAtHeight); probably better to leak than to crash + removed = true; + + if (removed == false && removeClaimFromTrie(name, outPoint, claim, fCheckTakeover)) + removed = true; + + if (removed == true) + { + int expirationHeight = claim.nHeight + base->nExpirationTime; + removeFromExpirationQueue(adjusted, outPoint, expirationHeight); + claimsToDelete.insert(claim); + nValidAtHeight = claim.nValidAtHeight; + } + return removed; +} + +void CClaimTrieCacheBase::addToExpirationQueue(int nExpirationHeight, nameOutPointType& entry) const +{ + expirationQueueType::iterator itQueueRow = getExpirationQueueCacheRow(nExpirationHeight, true); + itQueueRow->second.push_back(entry); +} + +void CClaimTrieCacheBase::removeFromExpirationQueue(const std::string& name, const COutPoint& outPoint, int expirationHeight) const +{ + expirationQueueType::iterator itQueueRow = getExpirationQueueCacheRow(expirationHeight, false); + expirationQueueRowType::iterator itQueue; + if (itQueueRow != expirationQueueCache.end()) + { + for (itQueue = itQueueRow->second.begin(); itQueue != itQueueRow->second.end(); ++itQueue) + { + if (outPoint == itQueue->outPoint && name == itQueue->name) + break; + } + + if (itQueue != itQueueRow->second.end()) + itQueueRow->second.erase(itQueue); + } +} + +expirationQueueType::iterator CClaimTrieCacheBase::getExpirationQueueCacheRow(int nHeight, bool createIfNotExists) const +{ + expirationQueueType::iterator itQueueRow = expirationQueueCache.find(nHeight); + if (itQueueRow == expirationQueueCache.end()) + { + // Have to make a new row it put in the cache, if createIfNotExists is true + expirationQueueRowType queueRow; + // If the row exists in the base, copy its claims into the new row. + bool exists = base->getExpirationQueueRow(nHeight, queueRow); + if (!exists && !createIfNotExists) + return itQueueRow; + // Stick the new row in the cache + std::pair ret; + ret = expirationQueueCache.insert(std::pair(nHeight, queueRow)); + assert(ret.second); + itQueueRow = ret.first; + } + return itQueueRow; +} + +// "name" is already normalized if needed +bool CClaimTrieCacheBase::reorderTrieNode(const std::string& name, bool fCheckTakeover) const +{ + assert(base); + nodeCacheType::iterator cachedNode; + cachedNode = cache.find(name); + if (cachedNode == cache.end()) + { + CClaimTrieNode* currentNode = getRoot(); + for (std::string::const_iterator itCur = name.begin(); itCur != name.end(); ++itCur) + { + std::string sCurrentSubstring(name.begin(), itCur); + std::string sNextSubstring(name.begin(), itCur + 1); + + cachedNode = cache.find(sNextSubstring); + if (cachedNode != cache.end()) + { + currentNode = cachedNode->second; + continue; + } + nodeMapType::iterator childNode = currentNode->children.find(*itCur); + if (childNode != currentNode->children.end()) + { + currentNode = childNode->second; + continue; + } + // The node doesn't exist, so it can't be reordered. + return true; + } + + currentNode = new CClaimTrieNode(*currentNode); + std::pair ret; + ret = cache.insert(std::pair(name, currentNode)); + assert(ret.second); + cachedNode = ret.first; + } + bool fChanged = false; + if (cachedNode->second->claims.empty()) + { + // Nothing in there to reorder + return true; + } + else + { + CClaimValue currentTop = cachedNode->second->claims.front(); + supportMapEntryType node; + getSupportsForName(name, node); + cachedNode->second->reorderClaims(node); + if (cachedNode->second->claims.front() != currentTop) + fChanged = true; + } + if (fChanged) + { + for (std::string::const_iterator itCur = name.begin(); itCur != name.end(); ++itCur) + { + std::string sub(name.begin(), itCur); + dirtyHashes.insert(sub); + } + dirtyHashes.insert(name); + if (fCheckTakeover) + namesToCheckForTakeover.insert(name); + } + return true; +} + +// name has already been normalized if needed +bool CClaimTrieCacheBase::getSupportsForName(const std::string& name, supportMapEntryType& supports) const +{ + const supportMapType::iterator cachedNode = supportCache.find(name); + if (cachedNode != supportCache.end()) + { + supports = cachedNode->second; + return true; + } + + return base->getSupportNode(name, supports); +} + +bool CClaimTrieCacheBase::insertSupportIntoMap(const std::string& name, CSupportValue support, bool fCheckTakeover) const +{ + supportMapType::iterator cachedNode; + // If this node is already in the cache, use that + cachedNode = supportCache.find(name); + // If not, copy the one from base if it exists, and use that + if (cachedNode == supportCache.end()) + { + supportMapEntryType node; + base->getSupportNode(name, node); + std::pair ret; + ret = supportCache.insert(std::pair(name, node)); + assert(ret.second); + cachedNode = ret.first; + } + cachedNode->second.push_back(support); + // See if this changed the biggest bid + return reorderTrieNode(name, fCheckTakeover); +} + +bool CClaimTrieCacheBase::removeSupportFromMap(const std::string& name, const COutPoint& outPoint, CSupportValue& support, bool fCheckTakeover) const +{ + supportMapType::iterator cachedNode; + cachedNode = supportCache.find(name); + if (cachedNode == supportCache.end()) + { + supportMapEntryType node; + if (!base->getSupportNode(name, node)) // clearly, this support does not exist + return false; + + std::pair ret; + ret = supportCache.insert(std::pair(name, node)); + assert(ret.second); + cachedNode = ret.first; + } + supportMapEntryType::iterator itSupport; + for (itSupport = cachedNode->second.begin(); itSupport != cachedNode->second.end(); ++itSupport) + { + if (itSupport->outPoint == outPoint) + break; + } + if (itSupport != cachedNode->second.end()) + { + std::swap(support, *itSupport); + cachedNode->second.erase(itSupport); + return reorderTrieNode(name, fCheckTakeover); + } + + LogPrintf("CClaimTrieCacheBase::%s() : asked to remove a support that doesn't exist\n", __func__); + return false; +} + +supportQueueType::iterator CClaimTrieCacheBase::getSupportQueueCacheRow(int nHeight, bool createIfNotExists) const +{ + supportQueueType::iterator itQueueRow = supportQueueCache.find(nHeight); + if (itQueueRow == supportQueueCache.end()) + { + supportQueueRowType queueRow; + bool exists = base->getSupportQueueRow(nHeight, queueRow); + if (!exists) + if (!createIfNotExists) + return itQueueRow; + // Stick the new row in the cache + std::pair ret; + ret = supportQueueCache.insert(std::pair(nHeight, queueRow)); + assert(ret.second); + itQueueRow = ret.first; + } + return itQueueRow; +} + +queueNameType::iterator CClaimTrieCacheBase::getSupportQueueCacheNameRow(const std::string& name, bool createIfNotExists) const +{ + queueNameType::iterator itQueueNameRow = supportQueueNameCache.find(name); + if (itQueueNameRow == supportQueueNameCache.end()) + { + queueNameRowType queueNameRow; + bool exists = base->getSupportQueueNameRow(name, queueNameRow); + if (!exists && !createIfNotExists) + return itQueueNameRow; + // Stick the new row in the name cache + std::pair ret; + ret = supportQueueNameCache.insert(std::pair(name, queueNameRow)); + assert(ret.second); + itQueueNameRow = ret.first; + } + return itQueueNameRow; +} + +bool CClaimTrieCacheBase::addSupportToQueues(const std::string& name, CSupportValue& support) const +{ + LogPrintf("%s: nValidAtHeight: %d\n", __func__, support.nValidAtHeight); + supportQueueEntryType entry(name, support); + supportQueueType::iterator itQueueRow = getSupportQueueCacheRow(support.nValidAtHeight, true); + queueNameType::iterator itQueueNameRow = getSupportQueueCacheNameRow(name, true); + itQueueRow->second.push_back(entry); + itQueueNameRow->second.push_back(outPointHeightType(support.outPoint, support.nValidAtHeight)); + nameOutPointType expireEntry(name, support.outPoint); + addSupportToExpirationQueue(support.nHeight + base->nExpirationTime, expireEntry); + return true; +} + +bool CClaimTrieCacheBase::removeSupportFromQueue(const std::string& name, const COutPoint& outPoint, CSupportValue& support) const +{ + queueNameType::iterator itQueueNameRow = getSupportQueueCacheNameRow(name, false); + if (itQueueNameRow == supportQueueNameCache.end()) + return false; + + queueNameRowType::iterator itQueueName; + for (itQueueName = itQueueNameRow->second.begin(); itQueueName != itQueueNameRow->second.end(); ++itQueueName) + { + if (itQueueName->outPoint == outPoint) + break; + } + if (itQueueName == itQueueNameRow->second.end()) + return false; + + supportQueueType::iterator itQueueRow = getSupportQueueCacheRow(itQueueName->nHeight, false); + if (itQueueRow != supportQueueCache.end()) + { + supportQueueRowType::iterator itQueue; + for (itQueue = itQueueRow->second.begin(); itQueue != itQueueRow->second.end(); ++itQueue) + { + CSupportValue& support = itQueue->second; + if (support.outPoint == outPoint && name == itQueue->first) + break; + } + if (itQueue != itQueueRow->second.end()) + { + std::swap(support, itQueue->second); + itQueueNameRow->second.erase(itQueueName); + itQueueRow->second.erase(itQueue); + return true; + } + } + LogPrintf("%s: An inconsistency was found in the claim queue. Please report this to the developers:\nFound in named support queue but not in height support queue: name: %s, txid: %s, nOut: %d, nValidAtHeight: %d, current height: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, itQueueName->nHeight, nCurrentHeight); + return false; +} + +bool CClaimTrieCacheBase::addSupport(const std::string& name, const COutPoint& outPoint, CAmount nAmount, uint160 supportedClaimId, int nHeight) const +{ + LogPrintf("%s: name: %s, txhash: %s, nOut: %d, nAmount: %d, supportedClaimId: %s, nHeight: %d, nCurrentHeight: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, nAmount, supportedClaimId.GetHex(), nHeight, nCurrentHeight); + assert(nHeight == nCurrentHeight); + + int delayForSupport = getDelayForName(name, supportedClaimId); + CSupportValue support(outPoint, supportedClaimId, nAmount, nHeight, nHeight + delayForSupport); + return addSupportToQueues(name, support); +} + +bool CClaimTrieCacheBase::undoSpendSupport(const std::string& name, const COutPoint& outPoint, uint160 supportedClaimId, CAmount nAmount, int nHeight, int nValidAtHeight) const +{ + LogPrintf("%s: name: %s, txhash: %s, nOut: %d, nAmount: %d, supportedClaimId: %s, nHeight: %d, nCurrentHeight: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, nAmount, supportedClaimId.GetHex(), nHeight, nCurrentHeight); + CSupportValue support(outPoint, supportedClaimId, nAmount, nHeight, nValidAtHeight); + if (nValidAtHeight < nCurrentHeight) + { + nameOutPointType entry(adjustNameForValidHeight(name, nValidAtHeight), support.outPoint); + addSupportToExpirationQueue(support.nHeight + base->nExpirationTime, entry); + return insertSupportIntoMap(name, support, false); + } + + return addSupportToQueues(name, support); +} + +bool CClaimTrieCacheBase::removeSupport(const std::string& name, const COutPoint& outPoint, int nHeight, int& nValidAtHeight, bool fCheckTakeover) const +{ + bool removed = false; + CSupportValue support; + nValidAtHeight = nHeight + getDelayForName(name); + std::string adjusted = adjustNameForValidHeight(name, nValidAtHeight); + + if (removeSupportFromQueue(adjusted, outPoint, support)) + removed = true; + if (removed == false && removeSupportFromMap(name, outPoint, support, fCheckTakeover)) + removed = true; + if (removed) + { + int expirationHeight = nHeight + base->nExpirationTime; + removeSupportFromExpirationQueue(adjusted, outPoint, expirationHeight); + nValidAtHeight = support.nValidAtHeight; // might not actually match original computation if it got incorporated early + } + return removed; +} + +void CClaimTrieCacheBase::addSupportToExpirationQueue(int nExpirationHeight, nameOutPointType& entry) const +{ + expirationQueueType::iterator itQueueRow = getSupportExpirationQueueCacheRow(nExpirationHeight, true); + itQueueRow->second.push_back(entry); +} + +void CClaimTrieCacheBase::removeSupportFromExpirationQueue(const std::string& name, const COutPoint& outPoint, int expirationHeight) const +{ + expirationQueueType::iterator itQueueRow = getSupportExpirationQueueCacheRow(expirationHeight, false); + expirationQueueRowType::iterator itQueue; + if (itQueueRow != supportExpirationQueueCache.end()) + { + for (itQueue = itQueueRow->second.begin(); itQueue != itQueueRow->second.end(); ++itQueue) + { + if (outPoint == itQueue->outPoint && name == itQueue->name) + break; + } + } + if (itQueue != itQueueRow->second.end()) + itQueueRow->second.erase(itQueue); +} + +expirationQueueType::iterator CClaimTrieCacheBase::getSupportExpirationQueueCacheRow(int nHeight, bool createIfNotExists) const +{ + expirationQueueType::iterator itQueueRow = supportExpirationQueueCache.find(nHeight); + if (itQueueRow == supportExpirationQueueCache.end()) + { + // Have to make a new row it put in the cache, if createIfNotExists is true + expirationQueueRowType queueRow; + // If the row exists in the base, copy its claims into the new row. + bool exists = base->getSupportExpirationQueueRow(nHeight, queueRow); + if (!exists && !createIfNotExists) + return itQueueRow; + // Stick the new row in the cache + std::pair ret; + ret = supportExpirationQueueCache.insert(std::pair(nHeight, queueRow)); + assert(ret.second); + itQueueRow = ret.first; + } + return itQueueRow; +} + +bool CClaimTrieCacheBase::undoAddSupport(const std::string& name, const COutPoint& outPoint, int nHeight) const +{ + LogPrintf("%s: name: %s, txhash: %s, nOut: %d, nHeight: %d, nCurrentHeight: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, nHeight, nCurrentHeight); + int throwaway; + return removeSupport(name, outPoint, nHeight, throwaway, false); +} + +bool CClaimTrieCacheBase::spendSupport(const std::string& name, const COutPoint& outPoint, int nHeight, int& nValidAtHeight) const +{ + LogPrintf("%s: name: %s, txhash: %s, nOut: %d, nHeight: %d, nCurrentHeight: %d\n", __func__, name, outPoint.hash.GetHex(), outPoint.n, nHeight, nCurrentHeight); + return removeSupport(name, outPoint, nHeight, nValidAtHeight, true); +} + +bool CClaimTrieCacheBase::incrementBlock(insertUndoType& insertUndo, claimQueueRowType& expireUndo, + insertUndoType& insertSupportUndo, supportQueueRowType& expireSupportUndo, + std::vector >& takeoverHeightUndo) +{ + // we don't actually modify the claimTrie here; that happens in flush + claimQueueType::iterator itQueueRow = getQueueCacheRow(nCurrentHeight, false); + if (itQueueRow != claimQueueCache.end()) + { + // for each claim activating right now + for (claimQueueRowType::iterator itEntry = itQueueRow->second.begin(); itEntry != itQueueRow->second.end(); ++itEntry) + { + bool found = false; + queueNameType::iterator itQueueNameRow = getQueueCacheNameRow(itEntry->first, false); + if (itQueueNameRow != claimQueueNameCache.end()) + { + for (queueNameRowType::iterator itQueueName = itQueueNameRow->second.begin(); itQueueName != itQueueNameRow->second.end(); ++itQueueName) + { + if (itQueueName->outPoint == itEntry->second.outPoint && itQueueName->nHeight == nCurrentHeight) + { + found = true; + itQueueNameRow->second.erase(itQueueName); + break; + } + } + } + if (!found) + { + LogPrintf("%s: An inconsistency was found in the claim queue. Please report this to the developers:\nFound in height queue but not in named queue: name: %s, txid: %s, nOut: %d, nValidAtHeight: %d, current height: %d\n", __func__, itEntry->first, itEntry->second.outPoint.hash.GetHex(), itEntry->second.outPoint.n, itEntry->second.nValidAtHeight, nCurrentHeight); + if (itQueueNameRow != claimQueueNameCache.end()) + { + LogPrintf("Claims found for that name:\n"); + for (queueNameRowType::iterator itQueueName = itQueueNameRow->second.begin(); itQueueName != itQueueNameRow->second.end(); ++itQueueName) + { + LogPrintf("\ttxid: %s, nOut: %d, nValidAtHeight: %d\n", itQueueName->outPoint.hash.GetHex(), itQueueName->outPoint.n, itQueueName->nHeight); + } + } + else + { + LogPrintf("No claims found for that name\n"); + } + } + assert(found); + + // error triggered by claimtriecache_normalization: + // it will cause a double remove when rolling back -- something we don't handle correctly + // (same problem exists for the insertSupportUndo below) + //for (insertUndoType::reverse_iterator itInsertUndo = insertUndo.rbegin(); itInsertUndo != insertUndo.rend(); ++itInsertUndo) + // if (itInsertUndo->name == itEntry->first && itInsertUndo->outPoint == itEntry->second.outPoint) + // throw std::runtime_error("not expected"); + + insertClaimIntoTrie(itEntry->first, itEntry->second, true); + insertUndo.push_back(nameOutPointHeightType(itEntry->first, itEntry->second.outPoint, itEntry->second.nValidAtHeight)); + } + itQueueRow->second.clear(); + } + expirationQueueType::iterator itExpirationRow = getExpirationQueueCacheRow(nCurrentHeight, false); + if (itExpirationRow != expirationQueueCache.end()) + { + // for every claim expiring right now + for (expirationQueueRowType::iterator itEntry = itExpirationRow->second.begin(); itEntry != itExpirationRow->second.end(); ++itEntry) + { + CClaimValue claim; + assert(removeClaimFromTrie(itEntry->name, itEntry->outPoint, claim, true)); + claimsToDelete.insert(claim); + expireUndo.push_back(std::make_pair(itEntry->name, claim)); + LogPrintf("Expiring claim %s: %s, nHeight: %d, nValidAtHeight: %d\n", + claim.claimId.GetHex(), itEntry->name, claim.nHeight, claim.nValidAtHeight); + } + itExpirationRow->second.clear(); + } + supportQueueType::iterator itSupportRow = getSupportQueueCacheRow(nCurrentHeight, false); + if (itSupportRow != supportQueueCache.end()) + { + for (supportQueueRowType::iterator itSupport = itSupportRow->second.begin(); itSupport != itSupportRow->second.end(); ++itSupport) + { + bool found = false; + queueNameType::iterator itSupportNameRow = getSupportQueueCacheNameRow(itSupport->first, false); + if (itSupportNameRow != supportQueueNameCache.end()) + { + for (queueNameRowType::iterator itSupportName = itSupportNameRow->second.begin(); itSupportName != itSupportNameRow->second.end(); ++itSupportName) + { + if (itSupportName->outPoint == itSupport->second.outPoint && itSupportName->nHeight == itSupport->second.nValidAtHeight) + { + found = true; + itSupportNameRow->second.erase(itSupportName); + break; + } + } + } + if (!found) + { + LogPrintf("%s: An inconsistency was found in the support queue. Please report this to the developers:\nFound in height queue but not in named queue: %s, txid: %s, nOut: %d, nValidAtHeight: %d, current height: %d\n", __func__, itSupport->first, itSupport->second.outPoint.hash.GetHex(), itSupport->second.outPoint.n, itSupport->second.nValidAtHeight, nCurrentHeight); + if (itSupportNameRow != supportQueueNameCache.end()) + { + LogPrintf("Supports found for that name:\n"); + for (queueNameRowType::iterator itSupportName = itSupportNameRow->second.begin(); itSupportName != itSupportNameRow->second.end(); ++itSupportName) + { + LogPrintf("\ttxid: %s, nOut: %d, nValidAtHeight: %d\n", itSupportName->outPoint.hash.GetHex(), itSupportName->outPoint.n, itSupportName->nHeight); + } + } + else + { + LogPrintf("No support found for that name\n"); + } + } + insertSupportIntoMap(itSupport->first, itSupport->second, true); + insertSupportUndo.push_back(nameOutPointHeightType(itSupport->first, itSupport->second.outPoint, itSupport->second.nValidAtHeight)); + } + itSupportRow->second.clear(); + } + expirationQueueType::iterator itSupportExpirationRow = getSupportExpirationQueueCacheRow(nCurrentHeight, false); + if (itSupportExpirationRow != supportExpirationQueueCache.end()) + { + for (expirationQueueRowType::iterator itEntry = itSupportExpirationRow->second.begin(); itEntry != itSupportExpirationRow->second.end(); ++itEntry) + { + CSupportValue support; + assert(removeSupportFromMap(itEntry->name, itEntry->outPoint, support, true)); + expireSupportUndo.push_back(std::make_pair(itEntry->name, support)); + LogPrintf("Expiring support %s: %s, nHeight: %d, nValidAtHeight: %d\n", + support.supportedClaimId.GetHex(), itEntry->name, support.nHeight, support.nValidAtHeight); + } + itSupportExpirationRow->second.clear(); + } + + checkNamesForTakeover(insertUndo, insertSupportUndo, takeoverHeightUndo); + + for (nodeCacheType::const_iterator itOriginals = block_originals.begin(); itOriginals != block_originals.end(); ++itOriginals) + delete itOriginals->second; + block_originals.clear(); + + for (nodeCacheType::const_iterator itCache = cache.begin(); itCache != cache.end(); ++itCache) + block_originals[itCache->first] = new CClaimTrieNode(*itCache->second); + + nCurrentHeight++; + + return true; +} + +void CClaimTrieCacheBase::checkNamesForTakeover(insertUndoType& insertUndo, insertUndoType& insertSupportUndo, + std::vector >& takeoverHeightUndo) const { + // check each potentially taken over name to see if a takeover occurred. + // if it did, then check the claim and support insertion queues for + // the names that have been taken over, immediately insert all claim and + // supports for those names, and stick them in the insertUndo or + // insertSupportUndo vectors, with the nValidAtHeight they had prior to + // this block. + // Run through all names that have been taken over + for (std::set::iterator itNamesToCheck = namesToCheckForTakeover.begin(); itNamesToCheck != namesToCheckForTakeover.end(); ++itNamesToCheck) + { + const std::string& nameToCheck = *itNamesToCheck; + // Check if a takeover has occurred + nodeCacheType::iterator itCachedNode = cache.find(nameToCheck); + // many possibilities + // if this node is new, don't put it into the undo -- there will be nothing to restore, after all + // if all of this node's claims were deleted, it should be put into the undo -- there could be + // claims in the queue for that name and the takeover height should be the current height + // if the node is not in the cache, or getbestclaim fails, that means all of its claims were + // deleted + // if getOriginalInfoForName returns false, that means it's new and shouldn't go into the undo + // if both exist, and the current best claim is not the same as or the parent to the new best + // claim, then ownership has changed and the current height of last takeover should go into + // the queue + CClaimValue claimInCache; + CClaimValue claimInTrie; + bool haveClaimInCache; + bool haveClaimInTrie; + if (itCachedNode == cache.end()) + { + haveClaimInCache = false; + } + else + { + haveClaimInCache = itCachedNode->second->getBestClaim(claimInCache); + } + haveClaimInTrie = getOriginalInfoForName(nameToCheck, claimInTrie); + bool takeoverHappened = false; + if (!haveClaimInTrie) + { + takeoverHappened = true; + } + else if (!haveClaimInCache) + { + takeoverHappened = true; + } + else if (claimInCache != claimInTrie) + { + if (claimInCache.claimId != claimInTrie.claimId) + { + takeoverHappened = true; + } + } + if (takeoverHappened) + { + // Get all pending claims for that name and activate them all in the case that our winner is defunct. + queueNameType::iterator itQueueNameRow = getQueueCacheNameRow(nameToCheck, false); + if (itQueueNameRow != claimQueueNameCache.end()) + { + // for each of those claims + for (queueNameRowType::iterator itQueueName = itQueueNameRow->second.begin(); itQueueName != itQueueNameRow->second.end(); ++itQueueName) + { + bool found = false; + // find the matching claim data from the other cache (indexed by height) + claimQueueType::iterator itQueueRow = getQueueCacheRow(itQueueName->nHeight, false); + claimQueueRowType::iterator itQueue; + if (itQueueRow != claimQueueCache.end()) + { + for (itQueue = itQueueRow->second.begin(); itQueue != itQueueRow->second.end(); ++itQueue) + { + if (nameToCheck == itQueue->first && itQueue->second.outPoint == itQueueName->outPoint && itQueue->second.nValidAtHeight == itQueueName->nHeight) { + found = true; + break; + } + } + } + if (found) + { + // Insert them into the queue undo with their previous nValidAtHeight + insertUndo.push_back(nameOutPointHeightType(itQueue->first, itQueue->second.outPoint, itQueue->second.nValidAtHeight)); + // Insert them into the name trie with the new nValidAtHeight + itQueue->second.nValidAtHeight = nCurrentHeight; + insertClaimIntoTrie(itQueue->first, itQueue->second, false); + // Delete them from the height-based queue + itQueueRow->second.erase(itQueue); + } + else + { + LogPrintf("%s(): An inconsistency was found in the claim queue. Please report this to the developers:\nClaim found in name queue but not in height based queue:\nname: %s, txid: %s, nOut: %d, nValidAtHeight in name based queue: %d, current height: %d\n", __func__, nameToCheck, itQueueName->outPoint.hash.GetHex(), itQueueName->outPoint.n, itQueueName->nHeight, nCurrentHeight); + } + assert(found); // if this fails, you may have ended up with a duplicate in itQueueNameRow->second + } + // remove all claims from the queue for that name + itQueueNameRow->second.clear(); + } + // + // Then, get all supports in the queue for that name + queueNameType::iterator itSupportQueueNameRow = getSupportQueueCacheNameRow(nameToCheck, false); + if (itSupportQueueNameRow != supportQueueNameCache.end()) + { + for (queueNameRowType::iterator itSupportQueueName = itSupportQueueNameRow->second.begin(); itSupportQueueName != itSupportQueueNameRow->second.end(); ++itSupportQueueName) + { + // Pull those supports out of the height-based queue + supportQueueType::iterator itSupportQueueRow = getSupportQueueCacheRow(itSupportQueueName->nHeight, false); + if (itSupportQueueRow != supportQueueCache.end()) + { + supportQueueRowType::iterator itSupportQueue; + for (itSupportQueue = itSupportQueueRow->second.begin(); itSupportQueue != itSupportQueueRow->second.end(); ++itSupportQueue) + { + if (nameToCheck == itSupportQueue->first && itSupportQueue->second.outPoint == itSupportQueueName->outPoint && itSupportQueue->second.nValidAtHeight == itSupportQueueName->nHeight) { + break; + } + } + if (itSupportQueue != itSupportQueueRow->second.end()) + { + // Insert them into the support queue undo with the previous nValidAtHeight + insertSupportUndo.push_back(nameOutPointHeightType(itSupportQueue->first, itSupportQueue->second.outPoint, itSupportQueue->second.nValidAtHeight)); + // Insert them into the support map with the new nValidAtHeight + itSupportQueue->second.nValidAtHeight = nCurrentHeight; + insertSupportIntoMap(itSupportQueue->first, itSupportQueue->second, false); + // Delete them from the height-based queue + itSupportQueueRow->second.erase(itSupportQueue); + } + else + { + // here be problems TODO: show error, assert false + } + } + else + { + // here be problems + } + } + // remove all supports from the queue for that name + itSupportQueueNameRow->second.clear(); + } + + // save the old last height so that it can be restored if the block is undone + if (haveClaimInTrie) + { + int nHeightOfLastTakeover; + assert(getLastTakeoverForName(nameToCheck, nHeightOfLastTakeover)); + takeoverHeightUndo.push_back(std::make_pair(nameToCheck, nHeightOfLastTakeover)); + } + itCachedNode = cache.find(nameToCheck); + if (itCachedNode != cache.end()) + { + cacheTakeoverHeights[nameToCheck] = nCurrentHeight; + } + } + } + namesToCheckForTakeover.clear(); +} + +bool CClaimTrieCacheBase::decrementBlock(insertUndoType& insertUndo, claimQueueRowType& expireUndo, + insertUndoType& insertSupportUndo, supportQueueRowType& expireSupportUndo, + std::vector >& takeoverHeightUndo) +{ + nCurrentHeight--; + + if (expireSupportUndo.begin() != expireSupportUndo.end()) + { + expirationQueueType::iterator itSupportExpireRow = getSupportExpirationQueueCacheRow(nCurrentHeight, true); + for (supportQueueRowType::reverse_iterator itSupportExpireUndo = expireSupportUndo.rbegin(); itSupportExpireUndo != expireSupportUndo.rend(); ++itSupportExpireUndo) + { + insertSupportIntoMap(itSupportExpireUndo->first, itSupportExpireUndo->second, false); + if (nCurrentHeight == itSupportExpireUndo->second.nHeight + base->nExpirationTime) + itSupportExpireRow->second.push_back(nameOutPointType(itSupportExpireUndo->first, itSupportExpireUndo->second.outPoint)); + } + } + + for (insertUndoType::reverse_iterator itSupportUndo = insertSupportUndo.rbegin(); itSupportUndo != insertSupportUndo.rend(); ++itSupportUndo) + { + CSupportValue support; + assert(removeSupportFromMap(itSupportUndo->name, itSupportUndo->outPoint, support, false)); + if (itSupportUndo->nHeight >= 0) + { + // support.nValidHeight may have been changed if this was inserted before activation height + // due to a triggered takeover, change it back to original nValidAtHeight + support.nValidAtHeight = itSupportUndo->nHeight; + supportQueueType::iterator itSupportRow = getSupportQueueCacheRow(itSupportUndo->nHeight, true); + queueNameType::iterator itSupportNameRow = getSupportQueueCacheNameRow(itSupportUndo->name, true); + itSupportRow->second.push_back(std::make_pair(itSupportUndo->name, support)); + itSupportNameRow->second.push_back(outPointHeightType(support.outPoint, support.nValidAtHeight)); + } + } + + if (!expireUndo.empty()) + { + expirationQueueType::iterator itExpireRow = getExpirationQueueCacheRow(nCurrentHeight, true); + for (claimQueueRowType::reverse_iterator itExpireUndo = expireUndo.rbegin(); itExpireUndo != expireUndo.rend(); ++itExpireUndo) + { + insertClaimIntoTrie(itExpireUndo->first, itExpireUndo->second, false); + CClaimIndexElement element = { itExpireUndo->first, itExpireUndo->second }; + claimsToAdd.push_back(element); + // Check if it expired at this height rather than being a rename/normalization + if (nCurrentHeight == itExpireUndo->second.nHeight + base->nExpirationTime) + itExpireRow->second.push_back(nameOutPointType(itExpireUndo->first, itExpireUndo->second.outPoint)); + } + } + + for (insertUndoType::reverse_iterator itInsertUndo = insertUndo.rbegin(); itInsertUndo != insertUndo.rend(); ++itInsertUndo) + { + CClaimValue claim; + assert(removeClaimFromTrie(itInsertUndo->name, itInsertUndo->outPoint, claim, false)); + if (itInsertUndo->nHeight >= 0) // aka it became valid at this height rather than being a rename/normalization + { + // valid height may have been changed if this was inserted because the winning claim was abandoned; reset it here: + claim.nValidAtHeight = itInsertUndo->nHeight; + claimQueueType::iterator itQueueRow = getQueueCacheRow(itInsertUndo->nHeight, true); + itQueueRow->second.push_back(std::make_pair(itInsertUndo->name, claim)); + queueNameType::iterator itQueueNameRow = getQueueCacheNameRow(itInsertUndo->name, true); + itQueueNameRow->second.push_back(outPointHeightType(itInsertUndo->outPoint, claim.nValidAtHeight)); + } + else + { + // no present way to delete claim from the index by name (but we read after the deletion anyway) + claimsToDelete.insert(claim); + } + } + + for (std::vector >::reverse_iterator itTakeoverHeightUndo = takeoverHeightUndo.rbegin(); itTakeoverHeightUndo != takeoverHeightUndo.rend(); ++itTakeoverHeightUndo) + { + cacheTakeoverHeights[itTakeoverHeightUndo->first] = itTakeoverHeightUndo->second; + } + + return true; +} + +bool CClaimTrieCacheBase::finalizeDecrement() const +{ + for (nodeCacheType::iterator itOriginals = block_originals.begin(); itOriginals != block_originals.end(); ++itOriginals) + delete itOriginals->second; + block_originals.clear(); + + for (nodeCacheType::const_iterator itCache = cache.begin(); itCache != cache.end(); ++itCache) + block_originals[itCache->first] = new CClaimTrieNode(*itCache->second); + + return true; +} + +bool CClaimTrieCacheBase::getLastTakeoverForName(const std::string& name, int& nLastTakeoverForName) const +{ + if (!fRequireTakeoverHeights) + { + nLastTakeoverForName = 0; + return true; + } + std::map::iterator itHeights = cacheTakeoverHeights.find(name); + if (itHeights == cacheTakeoverHeights.end()) + { + return base->getLastTakeoverForName(name, nLastTakeoverForName); + } + nLastTakeoverForName = itHeights->second; + return true; +} + +int CClaimTrieCacheBase::getNumBlocksOfContinuousOwnership(const std::string& name) const +{ + const CClaimTrieNode* node = getNodeForName(name); + if (!node || node->claims.empty()) + return 0; + int nLastTakeoverHeight; + assert(getLastTakeoverForName(name, nLastTakeoverHeight)); + return nCurrentHeight - nLastTakeoverHeight; +} + +const CClaimTrieNode* CClaimTrieCacheBase::getNodeForName(const std::string& name) const +{ + /* CClaimTrieNode* node = nullptr; */ + /* nodeCacheType::const_iterator itCache = cache.find(name); */ + /* if (itCache != cache.end()) */ + /* node = itCache->second; */ + /* return (node ? node : base->getNodeForName(name)); */ + const CClaimTrieNode* node = nullptr; + nodeCacheType::const_iterator itCache = cache.find(name); + if (itCache != cache.end()) { + node = itCache->second; + } + if (!node) { + node = base->getNodeForName(name); + } + return node; +} + +// "name" is already normalized if needed +int CClaimTrieCacheBase::getDelayForName(const std::string& name) const +{ + if (!fRequireTakeoverHeights) + return 0; + + int nBlocksOfContinuousOwnership = getNumBlocksOfContinuousOwnership(name); + return std::min(nBlocksOfContinuousOwnership / base->nProportionalDelayFactor, 4032); +} + +int CClaimTrieCacheBase::getDelayForName(const std::string& name, const uint160& claimId) const +{ + CClaimValue currentClaim; + int delayForClaim; + if (getOriginalInfoForName(name, currentClaim) && currentClaim.claimId == claimId) + delayForClaim = 0; + else + delayForClaim = getDelayForName(name); + return delayForClaim; +} + +uint256 CClaimTrieCacheBase::getBestBlock() +{ + if (hashBlock.IsNull() && base != nullptr) + hashBlock = base->hashBlock; + return hashBlock; +} + +void CClaimTrieCacheBase::setBestBlock(const uint256& hashBlockIn) +{ + hashBlock = hashBlockIn; +} + +bool CClaimTrieCacheBase::clear() const +{ + for (nodeCacheType::iterator itcache = cache.begin(); itcache != cache.end(); ++itcache) + delete itcache->second; + cache.clear(); + + for (nodeCacheType::iterator itOriginals = block_originals.begin(); itOriginals != block_originals.end(); ++itOriginals) + delete itOriginals->second; + block_originals.clear(); + + dirtyHashes.clear(); + cacheHashes.clear(); + claimQueueCache.clear(); + claimQueueNameCache.clear(); + expirationQueueCache.clear(); + supportCache.clear(); + supportQueueCache.clear(); + supportQueueNameCache.clear(); + supportExpirationQueueCache.clear(); + namesToCheckForTakeover.clear(); + cacheTakeoverHeights.clear(); + return true; +} + +bool CClaimTrieCacheBase::flush() +{ + if (dirty()) + getMerkleHash(); + + if (!claimsToDelete.empty()) { + for (claimIndexClaimListType::iterator it = claimsToDelete.begin(); it != claimsToDelete.end(); ++it) + base->removeFromClaimIndex(*it); + claimsToDelete.clear(); + } + if (!claimsToAdd.empty()) { + for (claimIndexElementListType::iterator it = claimsToAdd.begin(); it != claimsToAdd.end(); ++it) + base->addToClaimIndex(it->name, it->claim); + claimsToAdd.clear(); + } + + bool success = base->update(cache, cacheHashes, cacheTakeoverHeights, getBestBlock(), claimQueueCache, claimQueueNameCache, expirationQueueCache, nCurrentHeight, supportCache, supportQueueCache, supportQueueNameCache, supportExpirationQueueCache); + return (success ? clear() : success); +} + +uint256 CClaimTrieCacheBase::getLeafHashForProof(const std::string& currentPosition, const CClaimTrieNode* currentNode) const +{ + hashMapType::iterator cachedHash = cacheHashes.find(currentPosition); + return cachedHash == cacheHashes.end() ? currentNode->hash : cachedHash->second; +} + +void CClaimTrieCacheBase::recursiveIterateTrie(std::string& name, const CClaimTrieNode* current, CNodeCallback& callback) const +{ + callback.visit(name, current); + + nodeCacheType::const_iterator cachedNode; + for (nodeMapType::const_iterator it = current->children.begin(); it != current->children.end(); ++it) { + name.push_back(it->first); + cachedNode = cache.find(name); + if (cachedNode != cache.end()) + recursiveIterateTrie(name, cachedNode->second, callback); + else + recursiveIterateTrie(name, it->second, callback); + name.erase(name.end() - 1); + } +} + +bool CClaimTrieCacheBase::iterateTrie(CNodeCallback& callback) const +{ + try + { + std::string name; + recursiveIterateTrie(name, getRoot(), callback); + assert(name.empty()); + } + catch (const CNodeCallback::CRecursionInterruptionException& ex) + { + return ex.success; + } + return true; +} + +claimsForNameType CClaimTrieCacheBase::getClaimsForName(const std::string& name) const +{ + int nLastTakeoverHeight = 0; + std::vector claims; + if (const CClaimTrieNode* node = getNodeForName(name)) + { + claims = node->claims; + getLastTakeoverForName(name, nLastTakeoverHeight); + } + supportMapEntryType supports; + getSupportsForName(name, supports); + return claimsForNameType(claims, supports, nLastTakeoverHeight, name); +} + +CAmount CClaimTrieCacheBase::getEffectiveAmountForClaim(const std::string& name, const uint160& claimId, std::vector* supports) const +{ + return getEffectiveAmountForClaim(getClaimsForName(name), claimId, supports); +} + +CAmount CClaimTrieCacheBase::getEffectiveAmountForClaim(const claimsForNameType& claims, const uint160& claimId, std::vector* supports) const +{ + CAmount effectiveAmount = 0; + for (std::vector::const_iterator it = claims.claims.begin(); it != claims.claims.end(); ++it) + { + if (it->claimId == claimId && it->nValidAtHeight < nCurrentHeight) + { + effectiveAmount += it->nAmount; + for (std::vector::const_iterator it = claims.supports.begin(); it != claims.supports.end(); ++it) + { + if (it->supportedClaimId == claimId && it->nValidAtHeight < nCurrentHeight) + { + effectiveAmount += it->nAmount; + if (supports) + supports->push_back(*it); + } + } + break; + } + } + return effectiveAmount; +} + +bool CClaimTrieCacheBase::getInfoForName(const std::string& name, CClaimValue& claim) const +{ + if (dirty()) + getMerkleHash(); + + CClaimTrieNode* current = getRoot(); + nodeCacheType::const_iterator cachedNode; + + for (std::string::const_iterator itName = name.begin(); current; ++itName) + { + std::string currentPosition(name.begin(), itName); + cachedNode = cache.find(currentPosition); + if (cachedNode != cache.end()) + current = cachedNode->second; + + if (itName == name.end()) + return current->getBestClaim(claim); + + nodeMapType::const_iterator itChildren = current->children.find(*itName); + if (itChildren != current->children.end()) + current = itChildren->second; + } + return false; +} + +bool CClaimTrieCacheBase::getProofForName(const std::string& name, CClaimTrieProof& proof) const +{ + if (dirty()) + getMerkleHash(); + + std::vector nodes; + CClaimTrieNode* current = getRoot(); + nodeCacheType::const_iterator cachedNode; + bool fNameHasValue = false; + COutPoint outPoint; + int nHeightOfLastTakeover = 0; + for (std::string::const_iterator itName = name.begin(); current; ++itName) + { + std::string currentPosition(name.begin(), itName); + cachedNode = cache.find(currentPosition); + if (cachedNode != cache.end()) + current = cachedNode->second; + CClaimValue claim; + bool fNodeHasValue = current->getBestClaim(claim); + uint256 valueHash; + if (fNodeHasValue) + { + int nHeightOfLastTakeover; + if (!getLastTakeoverForName(currentPosition, nHeightOfLastTakeover)) + return false; + valueHash = getValueHash(claim.outPoint, nHeightOfLastTakeover); + } + std::vector > children; + CClaimTrieNode* nextCurrent = nullptr; + for (nodeMapType::const_iterator itChildren = current->children.begin(); itChildren != current->children.end(); ++itChildren) + { + std::stringstream ss; + ss << itChildren->first; + const std::string& curStr = ss.str(); + if (itName == name.end() || curStr[0] != *itName) // Leaf node + { + uint256 childHash = getLeafHashForProof(currentPosition + curStr, itChildren->second); + children.push_back(std::make_pair(curStr[0], childHash)); + } + else // Full node + { + nextCurrent = itChildren->second; + uint256 childHash; + children.push_back(std::make_pair(curStr[0], childHash)); + } + } + if (currentPosition == name) + { + fNameHasValue = fNodeHasValue; + if (fNameHasValue) + { + outPoint = claim.outPoint; + if (!getLastTakeoverForName(name, nHeightOfLastTakeover)) + return false; + } + valueHash.SetNull(); + } + nodes.emplace_back(std::move(children), fNodeHasValue, valueHash); + current = nextCurrent; + } + proof = CClaimTrieProof(std::move(nodes), fNameHasValue, outPoint, nHeightOfLastTakeover); + return true; +} diff --git a/src/claimtrie.h b/src/claimtrie.h new file mode 100644 index 000000000..65e8fc3e6 --- /dev/null +++ b/src/claimtrie.h @@ -0,0 +1,826 @@ +#ifndef BITCOIN_CLAIMTRIE_H +#define BITCOIN_CLAIMTRIE_H + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +// 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 + 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 + 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 supportMapEntryType; +typedef std::map 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 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 + 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 + 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 + 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 + inline void SerializationOp(Stream& s, Operation ser_action) + { + READWRITE(name); + READWRITE(outPoint); + } +}; + +class CClaimIndexElement +{ + public: + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action) { + READWRITE(name); + READWRITE(claim); + } + + std::string name; + CClaimValue claim; +}; + +typedef std::pair claimQueueEntryType; + +typedef std::pair supportQueueEntryType; + +typedef std::map supportMapType; + +typedef std::vector queueNameRowType; +typedef std::map queueNameType; + +typedef std::vector insertUndoType; + +typedef std::vector expirationQueueRowType; +typedef std::map expirationQueueType; + +typedef std::vector claimQueueRowType; +typedef std::map claimQueueType; + +typedef std::vector supportQueueRowType; +typedef std::map supportQueueType; + +typedef std::map nodeCacheType; + +typedef std::map hashMapType; + +typedef std::set claimIndexClaimListType; +typedef std::vector claimIndexElementListType; + +struct claimsForNameType +{ + std::vector claims; + std::vector supports; + int nLastTakeoverHeight; + std::string name; + + claimsForNameType(std::vector claims, std::vector 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", 100, 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 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& 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 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 > 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 > children; + bool hasValue; + uint256 valHash; +}; + +class CClaimTrieProof +{ +public: + CClaimTrieProof() {}; + CClaimTrieProof(std::vector 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 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 >& takeoverHeightUndo); + virtual bool decrementBlock(insertUndoType& insertUndo, + claimQueueRowType& expireUndo, + insertUndoType& insertSupportUndo, + supportQueueRowType& expireSupportUndo, + std::vector >& 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* supports = nullptr) const; + CAmount getEffectiveAmountForClaim(const claimsForNameType& claims, const uint160& claimId, + std::vector* 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 >& 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 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 namesToCheckForTakeover; + mutable std::map 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 >& takeoverHeightUndo); + virtual bool decrementBlock(insertUndoType& insertUndo, + claimQueueRowType& expireUndo, + insertUndoType& insertSupportUndo, + supportQueueRowType& expireSupportUndo, + std::vector >& 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 >& takeoverHeightUndo) const; +}; + +typedef CClaimTrieCacheNormalizationFork CClaimTrieCache; + +#endif // BITCOIN_CLAIMTRIE_H diff --git a/src/claimtrieforks.cpp b/src/claimtrieforks.cpp new file mode 100644 index 000000000..102eec72a --- /dev/null +++ b/src/claimtrieforks.cpp @@ -0,0 +1,300 @@ +#include "claimtrie.h" + +#include +#include +#include +#include +#include +#include + +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 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 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 pcursor(const_cast(&base->db)->NewIterator()); + pcursor->SeekToFirst(); + while (pcursor->Valid()) + { + std::pair 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(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& claims, const std::vector& 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 >& takeoverHeightUndo) const { + + struct CNameChangeDetector: public CNodeCallback { + std::vector 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::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 >& 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 >& 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); +} diff --git a/src/clientversion.cpp b/src/clientversion.cpp index 5d9eaea6d..76d689caa 100644 --- a/src/clientversion.cpp +++ b/src/clientversion.cpp @@ -12,7 +12,7 @@ * for both bitcoind and bitcoin-qt, to make it harder for attackers to * target servers or GUI users specifically. */ -const std::string CLIENT_NAME("Satoshi"); +const std::string CLIENT_NAME("LBRY"); /** * Client version number diff --git a/src/coins.h b/src/coins.h index 41a422f48..79e85cdcb 100644 --- a/src/coins.h +++ b/src/coins.h @@ -39,8 +39,8 @@ public: uint32_t nHeight : 31; //! 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(const CTxOut& outIn, int nHeightIn, bool fCoinBaseIn) : out(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) {} void Clear() { out.SetNull(); diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h index 788fa4e55..5a4cd9365 100644 --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -10,9 +10,9 @@ #include /** 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) */ -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) */ static const int64_t MAX_BLOCK_SIGOPS_COST = 80000; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ diff --git a/src/consensus/params.h b/src/consensus/params.h index 6c3a201f4..9779b5ff5 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -48,7 +48,11 @@ struct BIP9Deployment { */ struct Params { 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 */ uint256 BIP16Exception; /** Block height and hash at which BIP34 becomes active */ @@ -70,8 +74,22 @@ struct Params { uint256 powLimit; bool fPowAllowMinDifficultyBlocks; bool fPowNoRetargeting; + int nAllowMinDiffMinHeight; + int nAllowMinDiffMaxHeight; + int nNormalizedNameForkHeight; int64_t nPowTargetSpacing; 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; } uint256 nMinimumChainWork; uint256 defaultAssumeValid; diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index be73d0a2f..d80da5d1b 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -9,6 +9,8 @@ #include