区块链大学区块链区块链研习社

比特币全节点部署

2018-08-15  本文已影响6人  6017e164c325

选型

比特币节点有很多实现

还有很多其他实现,如java版本和js版本。如果用作商业用途,那bitcoin core必然是最稳妥的选择。所以这里选择了bitcoin core。

服务器配置

节点设置

tar -xzvf bitcoin-0.16.1-x86_64-linux-gnu.tar.gz -C /usr/local
# This config should be placed in following path:
# ~/.bitcoin/bitcoin.conf

# [core]
# Specify a non-default location to store blockchain and other data.
datadir=/data/btc_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=127.0.0.1:8332

rpcuser=btcuser
rpcpassword=btcpassword

# rpcallowip=0.0.0.0
bitcoind -daemon
bitcoin-cli stop
# 查看网络状态:
bitcoin-cli getnetworkinfo
# 查看网络节点:
bitcoin-cli getpeerinfo
# 查看区块链信息:如同步进度、
bitcoin-cli getblockchaininfo
# 查看所有命令
bitcoin-cli help

其他工具

上一篇 下一篇

猜你喜欢

热点阅读