From fd76b3c3ff1d0f8ee76a0a88d76632476385070e Mon Sep 17 00:00:00 2001 From: SwimmingTiger Date: Fri, 27 Mar 2020 16:39:20 +0800 Subject: [PATCH] remove SuperBitcoin, fix build issue for BCH/BSV --- CMakeLists.txt | 8 +- README.md | 1 - docker/btcpool/base-image/Dockerfile.sbtc | 81 ------------------- docker/btcpool/base-image/README.md | 3 - docker/btcpool/deploy/README.md | 9 --- docker/super-bitcoin/v0.16.2/Dockerfile | 66 --------------- docker/super-bitcoin/v0.16.2/README.md | 67 --------------- docker/super-bitcoin/v0.16.2/crontab.txt | 4 - .../super-bitcoin/v0.16.2/logrotate-bitcoind | 6 -- .../v0.16.2/opsgenie-monitor-bitcoind.sh | 47 ----------- docker/super-bitcoin/v0.16.2/run | 14 ---- docker/super-bitcoin/v0.16.2/run_testnet3 | 14 ---- .../v0.16.2/sources-aliyun.com.list | 10 --- docs/Eth/INSTALL-ETHPool.md | 52 +----------- docs/INSTALL-BTCPool.md | 39 +-------- docs/NiceHash-Configurations.md | 2 +- src/bitcoin/BitcoinUtils.cc | 16 +--- src/bitcoin/BitcoinUtils.h | 14 +--- src/bitcoin/JobMakerBitcoin.cc | 2 +- src/bitcoin/StratumBitcoin.h | 1 - tools/sharelog_to_parquet/StratumBitcoin.hpp | 1 - 21 files changed, 12 insertions(+), 445 deletions(-) delete mode 100644 docker/btcpool/base-image/Dockerfile.sbtc delete mode 100644 docker/super-bitcoin/v0.16.2/Dockerfile delete mode 100644 docker/super-bitcoin/v0.16.2/README.md delete mode 100644 docker/super-bitcoin/v0.16.2/crontab.txt delete mode 100644 docker/super-bitcoin/v0.16.2/logrotate-bitcoind delete mode 100755 docker/super-bitcoin/v0.16.2/opsgenie-monitor-bitcoind.sh delete mode 100644 docker/super-bitcoin/v0.16.2/run delete mode 100644 docker/super-bitcoin/v0.16.2/run_testnet3 delete mode 100644 docker/super-bitcoin/v0.16.2/sources-aliyun.com.list diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f8e99f08..7fd231694 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ endif() # # Chain Type # -set(SUPPORTED_CHAIN_TYPES "BTC|BCH|BSV|UBTC|SBTC|LTC|ZEC") +set(SUPPORTED_CHAIN_TYPES "BTC|BCH|BSV|UBTC|LTC|ZEC") if(NOT CHAIN_TYPE) message(FATAL_ERROR "Chain type not defined! (-DCHAIN_TYPE=${SUPPORTED_CHAIN_TYPES})") endif() @@ -91,12 +91,6 @@ elseif(CHAIN_TYPE STREQUAL "UBTC") set(POOL__DEB_PACKNAME_POSTFIX "${POOL__DEB_PACKNAME_POSTFIX}-unitedbitcoin") set(POOL__DEFAULT_INSTALL_PREFIX "/work/btcpool.ubtc") -# SuperBitcoin -elseif(CHAIN_TYPE STREQUAL "SBTC") - set(CHAIN_NAME "Super Bitcoin") - set(POOL__DEB_PACKNAME_POSTFIX "${POOL__DEB_PACKNAME_POSTFIX}-superbitcoin") - set(POOL__DEFAULT_INSTALL_PREFIX "/work/btcpool.sbtc") - # Litecoin elseif(CHAIN_TYPE STREQUAL "LTC") set(CHAIN_NAME "Litecoin") diff --git a/README.md b/README.md index 194a1b9e4..d48fce8d3 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ The pool backend support these blockchains at current: * [Bitcoin](https://bitcoin.org/) * [BitcoinCash](https://bitcoincash.org/) * [UnitedBitcoin](https://ub.com/) - * ~~[SuperBitcoin](http://supersmartbitcoin.com/)~~ (outdated and unmaintained) * Scrypt * [Litecoin](https://litecoin.org/) * ETHash / Daggerhashimoto diff --git a/docker/btcpool/base-image/Dockerfile.sbtc b/docker/btcpool/base-image/Dockerfile.sbtc deleted file mode 100644 index 59a88afb3..000000000 --- a/docker/btcpool/base-image/Dockerfile.sbtc +++ /dev/null @@ -1,81 +0,0 @@ -# -# Dockerfile -# -# @author hanjiang.yu@bitmain.com -# @copyright btc.com -# @since 2018-12-01 -# -# -FROM ubuntu:18.04 -LABEL maintainer="Hanjiang Yu " - -ARG APT_MIRROR_URL -ARG BUILD_JOBS=1 - -COPY update_apt_sources.sh /tmp -RUN /tmp/update_apt_sources.sh - -# Install build dependencies -RUN apt-get update && apt-get install -y \ - autoconf \ - automake \ - autotools-dev \ - bsdmainutils \ - build-essential \ - cmake \ - curl \ - git \ - libboost-all-dev \ - libconfig++-dev \ - libcurl4-openssl-dev \ - libgmp-dev \ - libgoogle-glog-dev \ - libhiredis-dev \ - libmysqlclient-dev \ - libprotobuf-dev \ - libssl-dev \ - libtool \ - libzmq3-dev \ - libzookeeper-mt-dev \ - openssl \ - pkg-config \ - protobuf-compiler \ - wget \ - yasm \ - zlib1g-dev \ - && apt-get autoremove && apt-get clean q&& rm -rf /var/lib/apt/lists/* - -# Build libevent static library -RUN cd /tmp && \ - wget https://github.com/libevent/libevent/releases/download/release-2.1.10-stable/libevent-2.1.10-stable.tar.gz && \ - [ $(sha256sum libevent-2.1.10-stable.tar.gz | cut -d " " -f 1) = "e864af41a336bb11dab1a23f32993afe963c1f69618bd9292b89ecf6904845b0" ] && \ - tar zxf libevent-2.1.10-stable.tar.gz && \ - cd libevent-2.1.10-stable && \ - ./autogen.sh && \ - ./configure --disable-shared && \ - make -j${BUILD_JOBS} && \ - make install && \ - rm -rf /tmp/* - -# Build librdkafka static library -RUN cd /tmp && wget https://github.com/edenhill/librdkafka/archive/0.9.1.tar.gz && \ - [ $(sha256sum 0.9.1.tar.gz | cut -d " " -f 1) = "5ad57e0c9a4ec8121e19f13f05bacc41556489dfe8f46ff509af567fdee98d82" ] && \ - tar zxvf 0.9.1.tar.gz && cd librdkafka-0.9.1 && \ - ./configure && make -j${BUILD_JOBS} && make install && rm -rf /tmp/* - -# Remove dynamic libraries of librdkafka -# In this way, the constructed deb package will -# not have dependencies that not from software sources. -RUN cd /usr/local/lib && \ - find . | grep 'rdkafka' | grep '.so' | xargs rm - -# Build blockchain -RUN mkdir /work && git clone https://github.com/superbitcoin/SuperBitcoin.git --branch v0.16.2 --depth 1 /work/blockchain && \ - cd /work/blockchain && ./autogen.sh && ./configure --with-gui=no --disable-wallet --disable-tests --disable-bench && make -j${BUILD_JOBS} && \ - cd /work/blockchain/src/secp256k1 && ./autogen.sh && ./configure --enable-module-recovery && make -j${BUILD_JOBS} - -# For forward compatible -RUN ln -s /work/blockchain /work/bitcoin - -# Used later by btcpool build -ENV CHAIN_TYPE=SBTC diff --git a/docker/btcpool/base-image/README.md b/docker/btcpool/base-image/README.md index 06ea423d3..7fab5fd45 100644 --- a/docker/btcpool/base-image/README.md +++ b/docker/btcpool/base-image/README.md @@ -44,9 +44,6 @@ docker build -t btccom/btcpool_build:bsv-1.0.1 -f Dockerfile.bsv --build-arg BUI # UBTC docker build -t btccom/btcpool_build:ubtc-2.5.0.1-1 -f Dockerfile.ubtc --build-arg BUILD_JOBS=$(nproc) . -# SBTC (outdated) -docker build -t btccom/btcpool_build:sbtc-0.16.2 -f Dockerfile.sbtc --build-arg BUILD_JOBS=$(nproc) . - # LTC docker build -t btccom/btcpool_build:ltc-0.16.3 -f Dockerfile.ltc --build-arg BUILD_JOBS=$(nproc) . diff --git a/docker/btcpool/deploy/README.md b/docker/btcpool/deploy/README.md index 12752f833..2ed447af3 100644 --- a/docker/btcpool/deploy/README.md +++ b/docker/btcpool/deploy/README.md @@ -48,9 +48,6 @@ See [here](../base-image/). # UBTC ./build.sh -t btccom/btcpool-ubtc -b btccom/btcpool_build:ubtc-2.5.0.1-1 -j$(nproc) -# SBTC (outdated) -./build.sh -t btccom/btcpool-sbtc -b btccom/btcpool_build:sbtc-0.16.2 -j$(nproc) - # LTC ./build.sh -t btccom/btcpool-ltc -b btccom/btcpool_build:ltc-0.16.3 -j$(nproc) @@ -75,9 +72,6 @@ docker build -t btccom/btcpool-bsv -f Dockerfile --build-arg BASE_IMAGE=btccom/b # UBTC docker build -t btccom/btcpool-ubtc -f Dockerfile --build-arg BASE_IMAGE=btccom/btcpool_build:ubtc-2.5.0.1-1 --build-arg BUILD_JOBS=$(nproc) --build-arg GIT_DESCRIBE=$(git describe --tag --long) ../../.. -# SBTC (outdated) -docker build -t btccom/btcpool-sbtc -f Dockerfile --build-arg BASE_IMAGE=btccom/btcpool_build:sbtc-0.16.2 --build-arg BUILD_JOBS=$(nproc) --build-arg GIT_DESCRIBE=$(git describe --tag --long) ../../.. - # LTC docker build -t btccom/btcpool-ltc -f Dockerfile --build-arg BASE_IMAGE=btccom/btcpool_build:ltc-0.16.3 --build-arg BUILD_JOBS=$(nproc) --build-arg GIT_DESCRIBE=$(git describe --tag --long) ../../.. @@ -103,9 +97,6 @@ docker run -it --rm btccom/btcpool-bsv unittest # UBTC docker run -it --rm btccom/btcpool-ubtc unittest -# SBTC (outdated) -docker run -it --rm btccom/btcpool-sbtc unittest - # LTC docker run -it --rm btccom/btcpool-ltc unittest diff --git a/docker/super-bitcoin/v0.16.2/Dockerfile b/docker/super-bitcoin/v0.16.2/Dockerfile deleted file mode 100644 index 7d5697ea9..000000000 --- a/docker/super-bitcoin/v0.16.2/Dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -# -# Dockerfile -# -# @author yihao.peng@bitmain.com -# @copyright btc.com -# @since 2016-08-01 -# -# -FROM phusion/baseimage:0.9.22 -MAINTAINER YihaoPeng - -ENV HOME /root -ENV TERM xterm -CMD ["/sbin/my_init"] - -# use aliyun source -ADD sources-aliyun.com.list /etc/apt/sources.list - -RUN apt-get update -RUN apt-get install -y build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 -RUN apt-get install -y libboost-all-dev libzmq3-dev curl wget net-tools - -# build bitcoind -RUN mkdir ~/source -RUN cd ~/source && wget https://github.com/superbitcoin/SuperBitcoin/archive/v0.16.2.tar.gz -RUN cd ~/source \ - && tar zxf v0.16.2.tar.gz && cd SuperBitcoin-0.16.2 \ - && ./autogen.sh \ - && ./configure --disable-bench --disable-tests --disable-wallet \ - && make && make install - -# make some alias -RUN ln -s sbtcd /usr/local/bin/bitcoind \ - && ln -s sbtc-cli /usr/local/bin/bitcoin-cli \ - && ln -s sbtc-tx /usr/local/bin/bitcoin-tx - -# mkdir bitcoind data dir -RUN mkdir -p /root/.bitcoin -RUN mkdir -p /root/scripts - -# scripts -ADD opsgenie-monitor-bitcoind.sh /root/scripts/opsgenie-monitor-bitcoind.sh - -# crontab shell -ADD crontab.txt /etc/cron.d/bitcoind - -# logrotate -ADD logrotate-bitcoind /etc/logrotate.d/bitcoind - -# -# services -# -# service for mainnet -RUN mkdir /etc/service/bitcoind -ADD run /etc/service/bitcoind/run -RUN chmod +x /etc/service/bitcoind/run -# service for testnet3 -#RUN mkdir /etc/service/bitcoind_testnet3 -#ADD run_testnet3 /etc/service/bitcoind_testnet3/run -#RUN chmod +x /etc/service/bitcoind_testnet3/run - -# remove source & build files -RUN rm -rf ~/source - -# clean -RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docker/super-bitcoin/v0.16.2/README.md b/docker/super-bitcoin/v0.16.2/README.md deleted file mode 100644 index d51bf82f7..000000000 --- a/docker/super-bitcoin/v0.16.2/README.md +++ /dev/null @@ -1,67 +0,0 @@ -Docker for SuperSmartBitcoin v0.16.2 -============================ - -* OS: `Ubuntu 14.04 LTS`, `Ubuntu 16.04 LTS` -* Docker Image OS: `Ubuntu 16.04 LTS` -* SuperSmartBitcoin: `v0.16.2` - -## Install Docker - -``` -# Use 'curl -sSL https://get.daocloud.io/docker | sh' instead of this line -# when your server is in China. -wget -qO- https://get.docker.com/ | sh - -service docker start -service docker status -``` - -## Build Docker Images - -``` -cd /work - -git clone https://github.com/btccom/btcpool.git -cd btcpool/docker/super-bitcoin/v0.16.2 - -# If your server is in China, please check "Dockerfile" and uncomment some lines. -# If you want to enable testnet3, please uncomment several lines behind `# service for testnet3` - -# build -docker build -t super-bitcoin:0.16.2 . -# docker build --no-cache -t super-bitcoin:0.16.2 . - -# mkdir for super-bitcoin -mkdir -p /work/super-bitcoin - -# bitcoin.conf -ln -s ./bitcoin.conf /work/super-bitcoin/sbtc.conf -touch /work/super-bitcoin/bitcoin.conf -``` - -### bitcoin.conf example - -``` -rpcuser=bitcoinrpc -# generate random rpc password: -# $ strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo -rpcpassword=xxxxxxxxxxxxxxxxxxxxxxxxxx -rpcthreads=4 - -rpcallowip=172.16.0.0/12 -rpcallowip=192.168.0.0/16 -rpcallowip=10.0.0.0/8 - -# use 1G memory for utxo, depends on your machine's memory -dbcache=1000 -``` - -## Start Docker Container - -``` -# start docker -docker run -it -v /work/super-bitcoin:/root/.bitcoin --name super-bitcoin -p 8333:8333 -p 8332:8332 -p 8331:8331 -p 18333:18333 -p 18332:18332 -p 18331:18331 --restart always -d super-bitcoin:0.16.2 - -# login -docker exec -it super-bitcoin /bin/bash -``` diff --git a/docker/super-bitcoin/v0.16.2/crontab.txt b/docker/super-bitcoin/v0.16.2/crontab.txt deleted file mode 100644 index edf8faf8c..000000000 --- a/docker/super-bitcoin/v0.16.2/crontab.txt +++ /dev/null @@ -1,4 +0,0 @@ -SHELL=/bin/sh -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -* * * * * root bash /root/scripts/opsgenie-monitor-bitcoind.sh > /dev/null 2>&1 diff --git a/docker/super-bitcoin/v0.16.2/logrotate-bitcoind b/docker/super-bitcoin/v0.16.2/logrotate-bitcoind deleted file mode 100644 index b32e75873..000000000 --- a/docker/super-bitcoin/v0.16.2/logrotate-bitcoind +++ /dev/null @@ -1,6 +0,0 @@ -/root/.bitcoin/debug.log /root/.bitcoin/testnet3/debug.log { - daily - rotate 3 - missingok - copytruncate -} diff --git a/docker/super-bitcoin/v0.16.2/opsgenie-monitor-bitcoind.sh b/docker/super-bitcoin/v0.16.2/opsgenie-monitor-bitcoind.sh deleted file mode 100755 index b261f5ff5..000000000 --- a/docker/super-bitcoin/v0.16.2/opsgenie-monitor-bitcoind.sh +++ /dev/null @@ -1,47 +0,0 @@ -#! /bin/bash -# -# bitcoind monitor shell -# -# @copyright btc.com -# @author Yihao Peng -# @since 2017-07 -# -SROOT=$(cd $(dirname "$0"); pwd) -cd $SROOT - -# the name of https://app.opsgenie.com/heartbeat -SERVICE="sbtc-bitcoind.1" -# api key of opsgenie -API_KEY="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -# api endpoint -MURL="https://api.opsgenie.com/v1/json/heartbeat/send" -# error log -LOG=/var/log/opsgenie-monitor-bitcoind.log - -BITCOIND_RPC="bitcoin-cli " -#WANIP=`curl -sL https://ip.btc.com` - -#NOERROR=`$BITCOIND_RPC getinfo | grep '"errors" : ""' | wc -l` -HEIGHT=`$BITCOIND_RPC getinfo | grep "blocks" | awk '{print $2}' | awk -F"," '{print $1}'` -CONNS=`$BITCOIND_RPC getinfo | grep "connections" | awk '{print $2}' | awk -F"," '{print $1}'` -DATE=`date "+%Y-%m-%d %H:%M:%S"` - -#VALUE="height:$HEIGHT;conn:$CONNS;" - -DATA=`cat << EOF -{"apiKey":"$API_KEY","name":"$SERVICE"} -EOF` - -if [[ $CONNS -ne 0 ]]; then - result=`curl -XPOST --max-time 30 -s -S $MURL -d "$DATA" 2>&1` - success=`echo "$result" | grep successful` - - if [ "x$success" = "x" ]; then - echo "[$DATE] api response is not successful: $result" >>$LOG - fi - - echo "$result" -else - echo "[$DATE] bitcoind's connections is 0: $RPCINFO" >>$LOG - echo "$RPCINFO" -fi diff --git a/docker/super-bitcoin/v0.16.2/run b/docker/super-bitcoin/v0.16.2/run deleted file mode 100644 index e04361c6f..000000000 --- a/docker/super-bitcoin/v0.16.2/run +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/bash -# -# run shell for bitcoind -# -# @copyright btc.com -# @author zhibiao.pan@bitmain.com -# -export LC_ALL=C -SROOT=$(cd $(dirname "$0"); pwd) -cd $SROOT - -OPT_PORT="-port=8333 -rpcport=8332" -OPT_ZMQ="-zmqpubrawblock=tcp://0.0.0.0:8331 -zmqpubrawtx=tcp://0.0.0.0:8331 -zmqpubhashtx=tcp://0.0.0.0:8331 -zmqpubhashblock=tcp://0.0.0.0:8331" -bitcoind -conf="/root/.bitcoin/bitcoin.conf" -datadir="/root/.bitcoin" $OPT_PORT $OPT_ZMQ diff --git a/docker/super-bitcoin/v0.16.2/run_testnet3 b/docker/super-bitcoin/v0.16.2/run_testnet3 deleted file mode 100644 index 4f9c74cd1..000000000 --- a/docker/super-bitcoin/v0.16.2/run_testnet3 +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/bash -# -# run shell for bitcoind: testnet3 -# -# @copyright btc.com -# @author zhibiao.pan@bitmain.com -# -export LC_ALL=C -SROOT=$(cd $(dirname "$0"); pwd) -cd $SROOT - -OPT_PORT="-port=18333 -rpcport=18332" -OPT_ZMQ="-zmqpubrawblock=tcp://0.0.0.0:18331 -zmqpubrawtx=tcp://0.0.0.0:18331 -zmqpubhashtx=tcp://0.0.0.0:18331 -zmqpubhashblock=tcp://0.0.0.0:18331" -bitcoind -testnet -conf="/root/.bitcoin/bitcoin.conf" -datadir="/root/.bitcoin" $OPT_PORT $OPT_ZMQ diff --git a/docker/super-bitcoin/v0.16.2/sources-aliyun.com.list b/docker/super-bitcoin/v0.16.2/sources-aliyun.com.list deleted file mode 100644 index d12b73236..000000000 --- a/docker/super-bitcoin/v0.16.2/sources-aliyun.com.list +++ /dev/null @@ -1,10 +0,0 @@ -deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse diff --git a/docs/Eth/INSTALL-ETHPool.md b/docs/Eth/INSTALL-ETHPool.md index 574cf1f40..a5a5a0172 100644 --- a/docs/Eth/INSTALL-ETHPool.md +++ b/docs/Eth/INSTALL-ETHPool.md @@ -94,11 +94,11 @@ or link BTCPool with different blockchains. | - | - | - | - | | CMAKE_BUILD_TYPE | Release, Debug | Release | Build type | | JOBS | A number, between 1 to your CPU cores' number. | 1 | Concurrent jobs when building blockchain's source code that linking to BTCPool. | -| CHAIN_TYPE | BTC, BCH, UBTC, SBTC | No default value, you must define it. | Blockchain's type that you want to BTCPool linking to. | +| CHAIN_TYPE | BTC, BCH, UBTC | No default value, you must define it. | Blockchain's type that you want to BTCPool linking to. | | CHAIN_SRC_ROOT | A path of dir, such as `/work/bitcoin`. | No default value, you must define it. | The path of blockchain's source code that you want to BTCPool linking to. | | OPENSSL_ROOT_DIR | A path of dir, such as `/usr/local/opt/openssl`. | No definition is required by default, and cmake will automatically look for it. | The path of `openssl`'s source code. The macOS user may need to define it if cmake cannot find it automatically. | | POOL__WORK_WITH_STRATUM_SWITCHER | ON, OFF | OFF | Build a special version of pool's stratum server, so you can run it with a stratum switcher. See also: [Stratum Switcher](https://github.com/btccom/stratumSwitcher). | -| POOL__INSTALL_PREFIX | A path of dir, such as `/work/btcpool.btc`. | /work/bitcoin.\[btc\|bch\|sbtc\|ubtc\] | The install path of `make install`. The deb package that generated by `make package` will install to the same path. | +| POOL__INSTALL_PREFIX | A path of dir, such as `/work/btcpool.btc`. | /work/bitcoin.\[btc\|bch\|ubtc\] | The install path of `make install`. The deb package that generated by `make package` will install to the same path. | | POOL__GENERATE_DEB_PACKAGE | ON, OFF | OFF | When it enabled, you can generate a deb package with `make package`. | #### Building commands (example) @@ -206,36 +206,6 @@ cmake -DJOBS=4 -DCHAIN_TYPE=UBTC -DCHAIN_SRC_ROOT=/work/UnitedBitcoin-1.0.7.0 -D make -j4 ``` -**build BTCPool that linking to SuperBitcoin** - -```bash -mkdir /work -cd /work -wget -O SuperBitcoin-0.16.2.tar.gz https://github.com/superbitcoin/SuperBitcoin/archive/v0.16.2.tar.gz -tar zxf SuperBitcoin-0.16.2.tar.gz - -git clone https://github.com/btccom/btcpool.git -cd btcpool -mkdir build -cd build - -# Release build with 4 jobs: -cmake -DJOBS=4 -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.16.2 .. -make -j4 - -# Release build at macOS: -cmake -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.16.2 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. -make - -# Debug build: -cmake -DCMAKE_BUILD_TYPE=Debug -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.16.2 .. -make - -# Build a special version of pool's stratum server, so you can run it with a stratum switcher: -cmake -DJOBS=4 -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.16.2 -DPOOL__WORK_WITH_STRATUM_SWITCHER=ON .. -make -j4 -``` - **build libethash** ```bash @@ -302,24 +272,6 @@ Topics for UnitedBitcoin ./bin/kafka-topics.sh --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --alter --topic UBTC_CommonEvents --config retention.ms=43200000 ``` -Topics for SuperBitcoin -```bash -# For compatibility with old deployments, topics of BTCPool for Bitcoin and BitcoinCash have the same names. -# So we cannot share the same kafka cluster with these two blockchains. -./bin/kafka-topics.sh --create --topic SBTC_RawGbt --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --replication-factor 2 --partitions 1 -./bin/kafka-topics.sh --create --topic SBTC_StratumJob --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --replication-factor 2 --partitions 1 -./bin/kafka-topics.sh --create --topic SBTC_SolvedShare --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --replication-factor 3 --partitions 1 -./bin/kafka-topics.sh --create --topic SBTC_ShareLog --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --replication-factor 2 --partitions 1 -./bin/kafka-topics.sh --create --topic SBTC_NMCAuxBlock --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --replication-factor 2 --partitions 1 -./bin/kafka-topics.sh --create --topic SBTC_NMCSolvedShare --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --replication-factor 2 --partitions 1 -./bin/kafka-topics.sh --create --topic SBTC_CommonEvents --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --replication-factor 2 --partitions 1 - -# do not keep 'RawGbt' message more than 6 hours -./bin/kafka-topics.sh --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --alter --topic SBTC_RawGbt --config retention.ms=21600000 -# 'CommonEvents': 12 hours -./bin/kafka-topics.sh --zookeeper 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181 --alter --topic SBTC_CommonEvents --config retention.ms=43200000 -``` - Check kafka topics stutus: ``` diff --git a/docs/INSTALL-BTCPool.md b/docs/INSTALL-BTCPool.md index 90d007993..0f065e816 100644 --- a/docs/INSTALL-BTCPool.md +++ b/docs/INSTALL-BTCPool.md @@ -104,11 +104,11 @@ or link BTCPool with different blockchains. | - | - | - | - | | CMAKE_BUILD_TYPE | Release, Debug | Release | Build type | | JOBS | A number, between 1 to your CPU cores' number. | 1 | Concurrent jobs when building blockchain's source code that linking to BTCPool. | -| CHAIN_TYPE | BTC, BCH, BSV, UBTC, SBTC, LTC, ZEC | No default value, you must define it. | Blockchain's type that you want to BTCPool linking to. | +| CHAIN_TYPE | BTC, BCH, BSV, UBTC, LTC, ZEC | No default value, you must define it. | Blockchain's type that you want to BTCPool linking to. | | CHAIN_SRC_ROOT | A path of dir, such as `/work/bitcoin`. | No default value, you must define it. | The path of blockchain's source code that you want to BTCPool linking to. | | OPENSSL_ROOT_DIR | A path of dir, such as `/usr/local/opt/openssl`. | No definition is required by default, and cmake will automatically look for it. | The path of `openssl`'s source code. The macOS user may need to define it if cmake cannot find it automatically. | | POOL__WORK_WITH_STRATUM_SWITCHER | ON, OFF | OFF | Build a special version of pool's stratum server, so you can run it with a stratum switcher. See also: [Stratum Switcher](https://github.com/btccom/btcpool-go-modules/stratumSwitcher). | -| POOL__INSTALL_PREFIX | A path of dir, such as `/work/btcpool.btc`. | /work/bitcoin.\[btc\|bch\|sbtc\|ubtc\] | The install path of `make install`. The deb package that generated by `make package` will install to the same path. | +| POOL__INSTALL_PREFIX | A path of dir, such as `/work/btcpool.btc`. | /work/bitcoin.\[btc\|bch\|ubtc\] | The install path of `make install`. The deb package that generated by `make package` will install to the same path. | | POOL__GENERATE_DEB_PACKAGE | ON, OFF | OFF | When it enabled, you can generate a deb package with `make package`. | #### Building commands (example) @@ -235,38 +235,6 @@ cmake -DCMAKE_BUILD_TYPE=Debug -DCHAIN_TYPE=UBTC -DCHAIN_SRC_ROOT=/work/UnitedBi make -j$(nproc) ``` -**build BTCPool that linking to SuperBitcoin** - -**Warning**: Support for SuperBitcoin is **outdated** and lacks maintenance. -Existing code may **not be compatible** with the current SuperBitcoin blockchain. - -In addition, if you have a plan to maintain the SuperBitcoin supporting, -you are welcome to make a pull request. - -```bash -mkdir /work -cd /work -wget -O SuperBitcoin-0.17.1.tar.gz https://github.com/superbitcoin/SuperBitcoin/archive/v0.17.1.tar.gz -tar zxf SuperBitcoin-0.17.1.tar.gz - -git clone https://github.com/btccom/btcpool.git -cd btcpool -mkdir build -cd build - -# Release build: -cmake -DJOBS=4 -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.17.1 .. -make -j$(nproc) - -# Release build at macOS: -cmake -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.17.1 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. -make -j$(nproc) - -# Debug build: -cmake -DCMAKE_BUILD_TYPE=Debug -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.17.1 .. -make -j$(nproc) -``` - **build BTCPool that linking to Litecoin** ```bash @@ -344,7 +312,6 @@ The following are some dockerfiles of full-nodes: * Bitcoin: [docker for Bitcoin Core](../docker/bitcoind) * BitcoinCash: [docker for Bitcoin ABC](../docker/bitcoin-abc) * UnitedBitcoin: [docker for UnitedBitcoin](../docker/united-bitcoin) -* SuperBitcoin: [docker for SuperBitcoin](../docker/super-bitcoin) * Litecoin: [docker for Litecoin Core](../docker/litecoind) * Namecoin: [docker for Namecoin Core](../docker/namecoind) * RSK: [docker for RSKJ](https://github.com/rsksmart/rskj/wiki/install-rskj-using-docker) @@ -372,7 +339,7 @@ mysql -h xxx -u xxx -p ```sql CREATE DATABASE bpool_local_db; USE bpool_local_db; --- for BTC/BCH/BSV/UBTC/SBTC/LTC/ZEC +-- for BTC/BCH/BSV/UBTC/LTC/ZEC SOURCE bpool_local_db.sql; -- for other chains (use one of them) SOURCE bpool_local_db_BEAM.sql; diff --git a/docs/NiceHash-Configurations.md b/docs/NiceHash-Configurations.md index 87508d294..ed0401b54 100644 --- a/docs/NiceHash-Configurations.md +++ b/docs/NiceHash-Configurations.md @@ -29,7 +29,7 @@ The configurations needs to be adjusted on per algorithm basis. * `forced` If this value is set to `false` (by default), sserver will try to detect NiceHash automatically by checking the user agent sent by client. If it is set to `true`, sserver considers all connections are from NiceHash. This is useful when the stratum protocol of a coin does not have user agent, e. g. BEAM. * `min_difficulty` This is the fallback minimal difficulty value in hex. It will be used when ZooKeeper is not available. * `min_difficulty_zookeeper_path` This is the ZooKeeper path sserver reads NiceHash minimal difficulty from. `` should be replaced by the proper values. If `initNiceHash` is used to populate ZooKeeper nodes, they shall be of the following values. - * `sha256` for BTC/BCH/UBTC/SBTC + * `sha256` for BTC/BCH/UBTC * `daggerhashimoto` for ETH/ETC * `decred` for DCR * `beam` for BEAM diff --git a/src/bitcoin/BitcoinUtils.cc b/src/bitcoin/BitcoinUtils.cc index 9c0da09ab..5266252f6 100644 --- a/src/bitcoin/BitcoinUtils.cc +++ b/src/bitcoin/BitcoinUtils.cc @@ -321,7 +321,7 @@ int64_t GetBlockReward(int nHeight, const Consensus::Params &consensusParams) { #else -/////////////////////// Block Reward of BTC, BCH, SBTC /////////////////////// +/////////////////////// Block Reward of BTC, BCH /////////////////////// int64_t GetBlockReward(int nHeight, const Consensus::Params &consensusParams) { int halvings = nHeight / consensusParams.nSubsidyHalvingInterval; // Force block reward to zero when right shift is undefined. @@ -340,20 +340,6 @@ int64_t GetBlockReward(int nHeight, const Consensus::Params &consensusParams) { #endif -#ifdef CHAIN_TYPE_SBTC -namespace BitcoinUtils { -CTxDestination DecodeDestination(const std::string &str) { - CBitcoinAddress addr(str); - return addr.Get(); -} - -bool IsValidDestinationString(const std::string &str) { - CBitcoinAddress addr(str); - return addr.IsValid(); -} -} // namespace BitcoinUtils -#endif // CHAIN_TYPE_SBTC - #ifdef CHAIN_TYPE_ZEC int32_t getSolutionVintSize() { // diff --git a/src/bitcoin/BitcoinUtils.h b/src/bitcoin/BitcoinUtils.h index 940e3f123..3e144eb4a 100644 --- a/src/bitcoin/BitcoinUtils.h +++ b/src/bitcoin/BitcoinUtils.h @@ -80,17 +80,9 @@ inline bool IsValidDestinationString(const std::string &addr) { inline CTxDestination DecodeDestination(const std::string &str) { return ::DecodeDestination(str, Params()); } -} // namespace BitcoinUtils - -#elif defined(CHAIN_TYPE_SBTC) - -#define AMOUNT_TYPE CAmount -#define COIN_TO_SATOSHIS COIN -#define AMOUNT_SATOSHIS(amt) amt - -namespace BitcoinUtils { -CTxDestination DecodeDestination(const std::string &str); -bool IsValidDestinationString(const std::string &str); +inline std::string EncodeDestination(const CTxDestination &dest) { + return ::EncodeDestination(dest); +} } // namespace BitcoinUtils #else diff --git a/src/bitcoin/JobMakerBitcoin.cc b/src/bitcoin/JobMakerBitcoin.cc index b2e8adb32..d1a44b807 100644 --- a/src/bitcoin/JobMakerBitcoin.cc +++ b/src/bitcoin/JobMakerBitcoin.cc @@ -338,7 +338,7 @@ void JobMakerHandlerBitcoin::clearTimeoutGbt() { // Ensure that rawgbtMap_ has at least one element, even if it expires. // So jobmaker can always generate jobs even if blockchain node does not // update the response of getblocktemplate for a long time when there is no - // new transaction. This happens on SBTC v0.17. + // new transaction. for (auto itr = rawgbtMap_.begin(); rawgbtMap_.size() > 1 && itr != rawgbtMap_.end();) { const uint32_t ts = gbtKeyGetTime(itr->first); diff --git a/src/bitcoin/StratumBitcoin.h b/src/bitcoin/StratumBitcoin.h index f19b32b52..074be9f4e 100644 --- a/src/bitcoin/StratumBitcoin.h +++ b/src/bitcoin/StratumBitcoin.h @@ -311,7 +311,6 @@ class ShareBitcoin : public sharebase::Serializable { set_blkbits(share->blkBits_); // There is no height in ShareBitcoinBytesV1, so it can only be assumed. - // Note: BTCPool's SBTC support is outdated, so SBTC is not considered. #ifdef CHAIN_TYPE_UBTC // UBTC's height and block rewards differ greatly from other SHA256 diff --git a/tools/sharelog_to_parquet/StratumBitcoin.hpp b/tools/sharelog_to_parquet/StratumBitcoin.hpp index e42b8b1de..7735a9466 100644 --- a/tools/sharelog_to_parquet/StratumBitcoin.hpp +++ b/tools/sharelog_to_parquet/StratumBitcoin.hpp @@ -189,7 +189,6 @@ class ShareBitcoin : public sharebase::BitcoinMsg { set_blkbits(share->blkBits_); // There is no height in ShareBitcoinBytesV1, so it can only be assumed. - // Note: BTCPool's SBTC support is outdated, so SBTC is not considered. // The block reward should be 12.5 on this height set_height(570000);