Skip to content

Latest commit

 

History

History
598 lines (470 loc) · 24.6 KB

INSTALL-BTCPool.md

File metadata and controls

598 lines (470 loc) · 24.6 KB

Install BTC.COM Pool

Supported OS

  • Ubuntu 14.04 LTS, 64 Bits
  • Ubuntu 16.04 LTS, 64 Bits
  • macOS Sierra or later

BTCPool has a known compatibility issue with 32-bit operating systems. btccom#38

If you want to run BTCPool on a 32-bit operating system, you must fix the problem first. Or, choose a 64-bit operating system.

Build

[Need fix] If you are the first time build btcpool, you could run bash install/install_btcpool.sh instead of exec these shell commands one by one.

cd /work
wget https://raw.githubusercontent.com/btccom/btcpool/master/install/install_btcpool.sh
bash ./install_btcpool.sh

Install dependency

Ubuntu

apt-get update
apt-get install -y build-essential autotools-dev libtool autoconf automake pkg-config cmake \
                   openssl libssl-dev libcurl4-openssl-dev libconfig++-dev \
                   libboost-all-dev libgmp-dev libmysqlclient-dev libzookeeper-mt-dev \
                   libzmq3-dev libgoogle-glog-dev libhiredis-dev zlib1g zlib1g-dev libprotobuf-dev protobuf-compiler

Notice: It is no longer recommended to install libevent-dev from the software source. The release and stable version of libevent will cause a dead lock bug in sserver (issue #75). It is recommended that you manually build the libevent from its master branch with commands at below.

Sometimes one or two packages will fail due to dependency problems, and you can try aptitude.

apt-get update
apt-get install -y aptitude

aptitude install build-essential autotools-dev libtool autoconf automake pkg-config cmake \
                   openssl libssl-dev libcurl4-openssl-dev libconfig++-dev \
                   libboost-all-dev libgmp-dev libmysqlclient-dev libzookeeper-mt-dev \
                   libzmq3-dev libgoogle-glog-dev libhiredis-dev zlib1g zlib1g-dev  libprotobuf-dev protobuf-compiler

# Input `n` if the solution is `NOT INSTALL` some package.
# Eventually aptitude will give a solution that downgrade some packages to allow all packages to be installed.
  • build libevent from its master branch

Notice: the release and stable version of libevent will cause a dead lock bug in sserver (issue #75), so use the code from the master branch.

git clone https://github.com/libevent/libevent.git
cd libevent
./autogen.sh
./configure --disable-shared
make && make install
  • build librdkafka-v0.9.1
wget https://github.com/edenhill/librdkafka/archive/0.9.1.tar.gz
tar zxvf 0.9.1.tar.gz
cd librdkafka-0.9.1
./configure && make && make install

# if you want to keep static libraries only
rm -v /usr/local/lib/librdkafka*.so /usr/local/lib/librdkafka*.so.*

macOS

Please install brew first.

brew install cmake openssl libconfig boost mysql zmq gmp libevent zookeeper librdkafka libhiredis
  • glog-v0.3.4
wget https://github.com/google/glog/archive/v0.3.4.tar.gz
tar zxvf v0.3.4.tar.gz
cd glog-0.3.4
./configure && make && make install

Build BTCPool

CMake Options

There are some cmake options that can change the behavior of compiler, enable or disable optional features of BTCPool, or link BTCPool with different blockchains.

Option Name Values Default Value Description
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_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.
POOL__USER_DEFINED_COINBASE ON, OFF OFF Build a special version of pool that allows user-defined content to be inserted into coinbase input. TODO: add documents about it.
POOL__USER_DEFINED_COINBASE_SIZE A number (bytes), from 1 to the maximum length that coinbase input can hold 10 The size of user-defined content that inserted into coinbase input. No more than 20 bytes is recommended.
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__GENERATE_DEB_PACKAGE ON, OFF OFF When it enabled, you can generate a deb package with make package.

Building commands (example)

build BTCPool that linking to Bitcoin

mkdir /work
cd /work
wget -O bitcoin-0.16.0.tar.gz https://github.com/bitcoin/bitcoin/archive/v0.16.0.tar.gz
tar zxf bitcoin-0.16.0.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=BTC -DCHAIN_SRC_ROOT=/work/bitcoin-0.16.0 ..
make -j4

# Release build at macOS:
cmake -DCHAIN_TYPE=BTC -DCHAIN_SRC_ROOT=/work/bitcoin-0.16.0 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
make

# Debug build:
cmake -DCMAKE_BUILD_TYPE=Debug -DCHAIN_TYPE=BTC -DCHAIN_SRC_ROOT=/work/bitcoin-0.16.0 ..
make

# Build a special version of pool's stratum server, so you can run it with a stratum switcher:
# Important: This version of sserver CANNOT run independently, `Illegal params` will throw
# if you try to connect it directly without using StratumSwitcher.
# Don't use `-DPOOL__WORK_WITH_STRATUM_SWITCHER=ON` if you don't know what StratumSwitcher is.
cmake -DJOBS=4 -DCHAIN_TYPE=BTC -DCHAIN_SRC_ROOT=/work/bitcoin-0.16.0 -DPOOL__WORK_WITH_STRATUM_SWITCHER=ON ..
make -j4

build BTCPool that linking to BitcoinCash ABC

mkdir /work
cd /work
wget -O bitcoin-abc-0.18.5.tar.gz https://github.com/Bitcoin-ABC/bitcoin-abc/archive/v0.18.5.tar.gz
tar zxf bitcoin-abc-0.18.5.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=BCH -DCHAIN_SRC_ROOT=/work/bitcoin-abc-0.18.5 ..
make -j4

# Release build at macOS:
cmake -DCHAIN_TYPE=BCH -DCHAIN_SRC_ROOT=/work/bitcoin-abc-0.18.5 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
make

# Debug build:
cmake -DCMAKE_BUILD_TYPE=Debug -DCHAIN_TYPE=BCH -DCHAIN_SRC_ROOT=/work/bitcoin-abc-0.18.5 ..
make

# Build a special version of pool's stratum server, so you can run it with a stratum switcher:
# Important: This version of sserver CANNOT run independently, `Illegal params` will throw
# if you try to connect it directly without using StratumSwitcher.
# Don't use `-DPOOL__WORK_WITH_STRATUM_SWITCHER=ON` if you don't know what StratumSwitcher is.
cmake -DJOBS=4 -DCHAIN_TYPE=BCH -DCHAIN_SRC_ROOT=/work/bitcoin-abc-0.18.5 -DPOOL__WORK_WITH_STRATUM_SWITCHER=ON ..
make -j4

Note: bitcoin-abc-0.17.1 and earlier are incompatible with current BTCPool, you will meet this error:

/work/bitcoin-abc-0.17.1/src/crypto/libbitcoin_crypto_base.a not exists!

build BTCPool that linking to Bitcoin SV

mkdir /work
cd /work
wget -O bitcoin-sv-0.1.0.tar.gz https://github.com/bitcoin-sv/bitcoin-sv/archive/v0.1.0.tar.gz
tar zxf bitcoin-sv-0.1.0.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=BSV -DCHAIN_SRC_ROOT=/work/bitcoin-sv-0.1.0 ..
make -j4

# Release build at macOS:
cmake -DCHAIN_TYPE=BSV -DCHAIN_SRC_ROOT=/work/bitcoin-sv-0.1.0 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
make

# Debug build:
cmake -DCMAKE_BUILD_TYPE=Debug -DCHAIN_TYPE=BSV -DCHAIN_SRC_ROOT=/work/bitcoin-sv-0.1.0 ..
make

# Build a special version of pool's stratum server, so you can run it with a stratum switcher:
# Important: This version of sserver CANNOT run independently, `Illegal params` will throw
# if you try to connect it directly without using StratumSwitcher.
# Don't use `-DPOOL__WORK_WITH_STRATUM_SWITCHER=ON` if you don't know what StratumSwitcher is.
cmake -DJOBS=4 -DCHAIN_TYPE=BSV -DCHAIN_SRC_ROOT=/work/bitcoin-sv-0.1.0 -DPOOL__WORK_WITH_STRATUM_SWITCHER=ON ..
make -j4

build BTCPool that linking to UnitedBitcoin

mkdir /work
cd /work
wget -O UnitedBitcoin-2.2.0.3.tar.gz https://github.com/UnitedBitcoin/UnitedBitcoin/archive/v2.2.0.3.tar.gz
tar zxf UnitedBitcoin-2.2.0.3.tar.gz

# install libdb that UnitedBitcoin's wallet required
apt-get install -y software-properties-common
add-apt-repository -y ppa:bitcoin/bitcoin
apt-get -y update
apt-get install -y libdb4.8-dev libdb4.8++-dev

# UnitedBitcoin will build failed with `--disable-wallet`, so we have to build it manually with wallet
cd UnitedBitcoin-2.2.0.3
./autogen.sh
./configure --disable-bench --disable-tests
make -j4

cd ..
git clone https://github.com/btccom/btcpool.git
cd btcpool
mkdir build
cd build

# Release build with 4 jobs:
cmake -DJOBS=4 -DCHAIN_TYPE=UBTC -DCHAIN_SRC_ROOT=/work/UnitedBitcoin-2.2.0.3 ..
make -j4

# Release build at macOS:
cmake -DCHAIN_TYPE=UBTC -DCHAIN_SRC_ROOT=/work/UnitedBitcoin-2.2.0.3 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
make

# Debug build:
cmake -DCMAKE_BUILD_TYPE=Debug -DCHAIN_TYPE=UBTC -DCHAIN_SRC_ROOT=/work/UnitedBitcoin-2.2.0.3 ..
make

# Build a special version of pool's stratum server, so you can run it with a stratum switcher:
# Important: This version of sserver CANNOT run independently, `Illegal params` will throw
# if you try to connect it directly without using StratumSwitcher.
# Don't use `-DPOOL__WORK_WITH_STRATUM_SWITCHER=ON` if you don't know what StratumSwitcher is.
cmake -DJOBS=4 -DCHAIN_TYPE=UBTC -DCHAIN_SRC_ROOT=/work/UnitedBitcoin-2.2.0.3 -DPOOL__WORK_WITH_STRATUM_SWITCHER=ON ..
make -j4

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.

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 with 4 jobs:
cmake -DJOBS=4 -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.17.1 ..
make -j4

# Release build at macOS:
cmake -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.17.1 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
make

# Debug build:
cmake -DCMAKE_BUILD_TYPE=Debug -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.17.1 ..
make

# Build a special version of pool's stratum server, so you can run it with a stratum switcher:
# Important: This version of sserver CANNOT run independently, `Illegal params` will throw
# if you try to connect it directly without using StratumSwitcher.
# Don't use `-DPOOL__WORK_WITH_STRATUM_SWITCHER=ON` if you don't know what StratumSwitcher is.
cmake -DJOBS=4 -DCHAIN_TYPE=SBTC -DCHAIN_SRC_ROOT=/work/SuperBitcoin-0.17.1 -DPOOL__WORK_WITH_STRATUM_SWITCHER=ON ..
make -j4

Init btcpool

init the running folders

Now create folder for btcpool, if you are going to run all service in one machine you could run install/init_folders.sh as below.

cd /work/btcpool/build
bash ../install/init_folders.sh

create kafka topics

Login to one of kafka machines, than create topics for btcpool:

cd /work/kafka

10.0.0.1:2181 at below is one node's IP of your ZooKeeper cluster.

Topics for Bitcoin or BitcoinCash

For compatibility with old deployments, kafka topics of Bitcoin and BitcoinCash have the same names. So these two blockchains CANNOT share the same kafka cluster.

# for Bitcoin or BitcoinCash mining
./bin/kafka-topics.sh --create --topic RawGbt         --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
./bin/kafka-topics.sh --create --topic StratumJob     --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1 
./bin/kafka-topics.sh --create --topic SolvedShare    --zookeeper 10.0.0.1:2181 --replication-factor 3 --partitions 1 
./bin/kafka-topics.sh --create --topic ShareLog       --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
./bin/kafka-topics.sh --create --topic CommonEvents   --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
# for Namecoin merge-mining
./bin/kafka-topics.sh --create --topic NMCAuxBlock    --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
./bin/kafka-topics.sh --create --topic NMCSolvedShare --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
# for RSK merge-mining
./bin/kafka-topics.sh --create --topic RawGw          --zookeeper 10.0.0.1:2181 --replication-factor 1 --partitions 1
./bin/kafka-topics.sh --create --topic RskSolvedShare --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1

# do not keep 'RawGbt' message more than 6 hours
./bin/kafka-configs.sh --zookeeper 10.0.0.1:2181 --alter --entity-type topics -entity-name RawGbt       --add-config retention.ms=21600000
# 'CommonEvents': 12 hours
./bin/kafka-configs.sh --zookeeper 10.0.0.1:2181 --alter --entity-type topics -entity-name CommonEvents --add-config retention.ms=43200000
# 'RawGw': 6 hours
./bin/kafka-configs.sh --zookeeper 10.0.0.1:2181 --alter --entity-type topics -entity-name RawGw --add-config retention.ms=21600000

Topics for UnitedBitcoin

UnitedBitcoin CAN share the same kafka cluster with other blockchains.

# for UnitedBitcoin mining
./bin/kafka-topics.sh --create --topic UBTC_RawGbt         --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
./bin/kafka-topics.sh --create --topic UBTC_StratumJob     --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1 
./bin/kafka-topics.sh --create --topic UBTC_SolvedShare    --zookeeper 10.0.0.1:2181 --replication-factor 3 --partitions 1 
./bin/kafka-topics.sh --create --topic UBTC_ShareLog       --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
./bin/kafka-topics.sh --create --topic UBTC_CommonEvents   --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
# for Namecoin merge-mining
./bin/kafka-topics.sh --create --topic UBTC_NMCAuxBlock    --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
./bin/kafka-topics.sh --create --topic UBTC_NMCSolvedShare --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
# for RSK merge-mining
./bin/kafka-topics.sh --create --topic UBTC_RawGw          --zookeeper 10.0.0.1:2181 --replication-factor 1 --partitions 1
./bin/kafka-topics.sh --create --topic UBTC_RskSolvedShare --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1

# do not keep 'RawGbt' message more than 6 hours
./bin/kafka-configs.sh --zookeeper 10.0.0.1:2181 --alter --entity-type topics -entity-name UBTC_RawGbt       --add-config retention.ms=21600000
# 'CommonEvents': 12 hours
./bin/kafka-configs.sh --zookeeper 10.0.0.1:2181 --alter --entity-type topics -entity-name UBTC_CommonEvents --add-config retention.ms=43200000
# 'RawGw': 6 hours
./bin/kafka-configs.sh --zookeeper 10.0.0.1:2181 --alter --entity-type topics -entity-name UBTC_RawGw --add-config retention.ms=21600000

Topics for SuperBitcoin

SuperBitcoin CAN share the same kafka cluster with other blockchains.

# for SuperBitcoin mining
./bin/kafka-topics.sh --create --topic SBTC_RawGbt         --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
./bin/kafka-topics.sh --create --topic SBTC_StratumJob     --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1 
./bin/kafka-topics.sh --create --topic SBTC_SolvedShare    --zookeeper 10.0.0.1:2181 --replication-factor 3 --partitions 1 
./bin/kafka-topics.sh --create --topic SBTC_ShareLog       --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
./bin/kafka-topics.sh --create --topic SBTC_CommonEvents   --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
# for Namecoin merge-mining
./bin/kafka-topics.sh --create --topic SBTC_NMCAuxBlock    --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
./bin/kafka-topics.sh --create --topic SBTC_NMCSolvedShare --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1
# for RSK merge-mining
./bin/kafka-topics.sh --create --topic SBTC_RawGw          --zookeeper 10.0.0.1:2181 --replication-factor 1 --partitions 1
./bin/kafka-topics.sh --create --topic SBTC_RskSolvedShare --zookeeper 10.0.0.1:2181 --replication-factor 2 --partitions 1

# do not keep 'RawGbt' message more than 6 hours
./bin/kafka-configs.sh --zookeeper 10.0.0.1:2181 --alter --entity-type topics -entity-name SBTC_RawGbt       --add-config retention.ms=21600000
# 'CommonEvents': 12 hours
./bin/kafka-configs.sh --zookeeper 10.0.0.1:2181 --alter --entity-type topics -entity-name SBTC_CommonEvents --add-config retention.ms=43200000
# 'RawGw': 6 hours
./bin/kafka-configs.sh --zookeeper 10.0.0.1:2181 --alter --entity-type topics -entity-name SBTC_RawGw --add-config retention.ms=21600000

Check kafka topics status:

# show topics
$ ./bin/kafka-topics.sh --describe --zookeeper 10.0.0.1:2181

# if create these topics success, the output likes:
Topic:RawGbt   	PartitionCount:1       	ReplicationFactor:2    	Configs:
       	Topic: RawGbt  	Partition: 0   	Leader: 1      	Replicas: 1,2  	Isr: 1,2
Topic:ShareLog 	PartitionCount:1       	ReplicationFactor:2    	Configs:
       	Topic: ShareLog	Partition: 0   	Leader: 2      	Replicas: 2,1  	Isr: 2,1
Topic:SolvedShare      	PartitionCount:1       	ReplicationFactor:3    	Configs:
       	Topic: SolvedShare     	Partition: 0   	Leader: 1      	Replicas: 1,2,3	Isr: 1,2,3
Topic:StratumJob       	PartitionCount:1       	ReplicationFactor:2    	Configs:
       	Topic: StratumJob      	Partition: 0   	Leader: 1      	Replicas: 1,2  	Isr: 1,2
Topic:NMCAuxBlock        PartitionCount:1         ReplicationFactor:3      Configs:
         Topic: NMCAuxBlock       Partition: 0     Leader: 3        Replicas: 3,1  Isr: 3,1
Topic:NMCSolvedShare     PartitionCount:1         ReplicationFactor:3      Configs:
         Topic: NMCSolvedShare    Partition: 0     Leader: 3        Replicas: 3,1  Isr: 3,1
... (only part of all topics)

setup full-nodes

Before starting btcpool's services, at least one bitcoin full-node needs to be setup. Which full-node to use depends on the blockchain you want to mining.

Also start Rsk node or Namecoin node if merged mining for any of those chains.

The following are the full-nodes that we recommend:

If you want to merge-mining more than one chains that follow Bitcoin Merged Mining Specification (likes Namecoin, ElastOS, etc), you can running a Merged Mining Proxy and let the pool's nmcauxmaker connect to it.

init MySQL databases & tables

The pool's statshttpd, slparser and blkmaker will write miners', users' & blockchains' information to mysql. We recommend that you create two databases and import the corresponding tables.

# create database `bpool_local_db`, `bpool_local_stats_db`
# and import tables with mysql command-line client.
cd /work/btcpool/install
mysql -h xxx -u xxx -p
CREATE DATABASE bpool_local_db;
USE bpool_local_db;
SOURCE bpool_local_db.sql;

CREATE DATABASE bpool_local_stats_db;
USE bpool_local_stats_db;
SOURCE bpool_local_stats_db.sql;

(optional) install Redis

If you want to install Redis as your statshttpd's optional storage, refer to .

User list API

You need to implement a HTTP API for stratum server (sserver). The API is use to fetch user list in incremental model. Stratum Server will call this API every few seconds, interval is about 10 seconds. When Stratum Server start, it will fetch again and again util no more users.

Should works as below.

#
# `last_id` is the offset. pagesize is 5. total user count is 8.
#
$ curl http://xxx.xxx.xxx/GetUserList?last_id=0
{"err_no":0,"err_msg":null,"data":{"litianzhao":1,"spica":2,"fazhu":3,"kevin":4,"kevin1":5}}

# fetch next page
$ curl http://xxx.xxx.xxx/GetUserList?last_id=5
{"err_no":0,"err_msg":null,"data":{"kevin2":6,"kevin3":7,"Miles":8}}

# fetch next page, no more users
$ curl http://xxx.xxx.xxx/GetUserList?last_id=8
{"err_no":0,"err_msg":null,"data":{}}

There is a demo for the API: btccom#16 (comment)

use supervisor to manager services.

#
# install supervisor
#
apt-get install supervisor

#
# change open file limits
# (add 'minfds=65535' in the [supervisord] section of supervisord.conf)
#
cat /etc/supervisor/supervisord.conf | grep -v 'minfds\s*=' | sed '/\[supervisord\]/a\minfds=65535' | tee /etc/supervisor/supervisord.conf
#
# maker the change effective
#
service supervisor restart


#
# copy processes' config files for supervisor
#
cd /work/btcpool/build/install/supervisord/

################################################################################
# for common server
################################################################################
cp gbtmaker.conf      /etc/supervisor/conf.d
cp jobmaker.conf      /etc/supervisor/conf.d
cp blkmaker.conf      /etc/supervisor/conf.d
cp sharelogger.conf   /etc/supervisor/conf.d
#
# if you need to enable watch other pool's stratum job. poolwatcher will 
# generate empty getblocktemplate when they find a new height stratum job 
# from other pools. this could reduce pool's orphan block rate.
#
cp poolwatcher.conf   /etc/supervisor/conf.d
#
# enable namecoin merged mining
#
cp nmcauxmaker.conf   /etc/supervisor/conf.d
#
# enable rsk merged mining
#
cp ../install/supervisord/gwmaker.conf   /etc/supervisor/conf.d

#
# start services: gbtmaker, jobmaker, blkmaker, sharelogger...
#
$ supervisorctl
> reread
> update
> status


#
# start your stratum server(see below) and add some miners to the pool, after make
# some shares than start 'slparser' & 'statshttpd'
#
cp slparser.conf      /etc/supervisor/conf.d
cp statshttpd.conf    /etc/supervisor/conf.d

# start services: slparser, statshttpd
$ supervisorctl
> reread
> update
> status


################################################################################
# for stratum server
################################################################################
cp sserver.conf       /etc/supervisor/conf.d

$ supervisorctl
> reread
> update
> status

mining-coin switcher

StratumSwitcher is a BTCPool's module that writed by golang. It provides a per user's mining-coin switching capability controlled by the user self or a pool administrator.

There are 3 processes to provide the capability:

A zookeeper is needed as a notification channel, and a new user-coin-map API need be provided to the Switcher API Server.

The module currently has only Chinese documents. Welcome to translate it and initiate a pull request.

Upgrade btcpool

Check release note and upgrade guide. Maybe add some config options to config file or change something of database table.

Get the latest codes and rebuild:

cd /work/btcpool/build
git pull
cmake ..
make

use supervisorctl to restart your services:

$ supervisorctl
> restart xxxx

Incompatible upgrade

Upgrading to BTCPool 2.3.0 requires additional operations on sharelogger, slparser and statshttpd due to incompatible sharelog format changes.

See UPGRADE-BTCPool.md for more information.