BTC节点部署

BTC 节点部署

前言

官网:https://bitcoin.org

下载链接:https://bitcoin.org/en/download

下载与安装

安装依赖环境

yum install boost-devel libevent-devel openssl-devel gcc gcc-c++ qt-devel protobuf-devel qrencode-devel libtool git autoconf automake -y

安装 BerkeleyDB

下载链接:https://www.oracle.com/database/technologies/related/berkeleydb-downloads.html

mkdir -p /usr/local/apps/BerkeleyDB/db
tar -zxvf db-18.1.32.tar.gz
cd db-18.1.32
./dist/configure --enable-cxx --disable-shared --with-pic --prefix=/usr/local/apps/BerkeleyDB/db
make && make install

从源码中构建

./autogen.sh
./configure --with-incompatible-bdb

安装包

下载链接:https://bitcoin.org/en/download

下载并解压,进入解压目录

创建配置

mkdir data # /usr/local/apps/btc/bitcoin-0.18.1/data

bitcoin 的默认配置目录为 ~/.bitcoin/bitcoin.conf,填写配置如下

# This config should be placed in following path:
# ~/.bitcoin/bitcoin.conf

# [core]
# Specify a non-default location to store blockchain and other data.
datadir=/usr/local/apps/btc/bitcoin-0.18.1/data
# Set database cache size in megabytes; machines sync faster with a larger cache. Recommend setting as high as possible based upon machine's available RAM.
dbcache=10240
# Maintain a full transaction index, used by the getrawtransaction rpc call.
txindex=1

# [rpc]
# Enable Add Witness Address RPC
deprecatedrpc=addwitnessaddress
# Accept command line and JSON-RPC commands.
server=1
# Accept public REST requests.
rest=1
# Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times. (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)
rpcbind=0.0.0.0
rpcport=18333
rpcuser=btcuser
rpcpassword=btcpassword

# 允许访问的白名单
rpcallowip=127.0.0.1

启动

./bin/bitcoind -daemon
或者
setsid ./bin/bitcoind

你可能感兴趣的:(BlockChain)