Support #892
Updated by Daniel Curtis over 7 years ago
This is a guide for setting up btcpool on FreeBSD 10. h2. Prepare the Environment * Make sure the system is up to date: <pre> pkg update && pkg upgrade portsnap fetch extract </pre> * Create a btcpool user: <pre> pw add user -n btcpool -s /sbin/nologin -c "BTC Pool" </pre> * Install a few dependencies: <pre> pkg install gcc git gmake portmaster autotools libtool autoconf automake cmake openssl boost-libs gmp libconfig libzmq4 glog librdkafka libevent </pre> * Install Zookeeper and ensure its running, refer to issue #890 <pre> service zookeeper start </pre> * Install Kafka and ensure its running, refer to issue #891 <pre> service kafka start </pre> * Add the following to the @make.conf@ make.conf file to enable ZMQ while compiling from ports: <pre> echo 'OPTIONS_UNSET+= DOCS NLS X11 EXAMPLES' >> /etc/make.conf echo 'OPTIONS_SET+= ZMQ' >> /etc/make.conf </pre> * Compile bitcoin-daemon from ports: <pre> portmaster net-p2p/bitcoin </pre> * Compile bitcoin-daemon from ports: <pre> portmaster net-p2p/bitcoin-daemon </pre> h2. Install MySQL Server * Start by installing the mariadb100-server and mariadb100-client packages: <pre> pkg install mariadb100-{server,client} </pre> * Copy a base MySQL configuration to use: <pre> cp /usr/local/share/mysql/my-small.cnf /var/db/mysql/my.cnf </pre> * Enable and start mysql at boot: <pre> echo 'mysql_enable="YES"' >> /etc/rc.conf service mysql-server start </pre> * Prepare the database for use by running the secure installation: *NOTE*: Choose a strong root password and answer yes to all questions. <pre> mysql_secure_installation </pre> h3. Create Databases and Users * Login to MySQL and create appropriate databases and users. <pre> mysql -u root -p </pre> #* And run the following SQL queries to create the btcpooldb database and btcpooluser user: <pre> CREATE DATABASE btcpooldb CHARACTER SET utf8; CREATE USER 'btcpooluser'@'localhost' IDENTIFIED BY 'SuperSecretPassword'; GRANT ALL PRIVILEGES ON btcpooldb.* TO 'btcpooluser'@'localhost'; FLUSH PRIVILEGES; quit </pre> h2. Install btcpool * Download the latest version of btcpool from GitHub: <pre> git clone https://github.com/btccom/btcpool.git /usr/local/btcpool </pre> * Build btcpool using gcc: btcpool: <pre> cd /usr/local/btcpool mkdir build && cd build env CC=gcc CXX=g++ CPP=cpp cmake -DCMAKE_BUILD_TYPE=Release .. gmake make </pre> h2. Initialize btcpool h3. Create Kafka Topics h3. Init MySQL database tables h3. User list API h2. Init script h2. Resources * https://github.com/btccom/btcpool * https://github.com/btccom/btcpool/blob/master/INSTALL.md