标签:href top tail bind awk x86 method wallet .gz
#环境 ubuntu 16.4
#硬盘500GB
#截止2018-12-31磁盘占用超过230GB
#下载页面
#https://bitcoin.org/zh_CN/download
cd /opt/
wget https://bitcoin.org/bin/bitcoin-core-0.17.0.1/bitcoin-0.17.0.1-x86_64-linux-gnu.tar.gz
#解压,软连接
tar zxf bitcoin-0.17.0.1-x86_64-linux-gnu.tar.gz
ln -fs /opt/bitcoin-0.17.0 /opt/bitcoin
ln -fs /opt/bitcoin-0.17.0/bin/bitcoind /usr/local/bin/bitcoind
ln -fs /opt/bitcoin-0.17.0/bin/bitcoin-cli /usr/local/bin/bitcoin-cli
mkdir -p /data/btc_data
mkdir ~/.bitcoin
vim ~/.bitcoin/bitcoin.conf
# ~/.bitcoin/bitcoin.conf
datadir=/data/btc_data
dbcache=10240
txindex=1
rpcuser=btc
rpcpassword=btc2018
daemon=1
server=1
rest=1
rpcbind=0.0.0.0:8332
rpcallowip=0.0.0.0/0
deprecatedrpc=accounts
bitcoind -daemon
bitcoin-cli stop
bitcoin-cli getblockchaininfo
bitcoin-cli getmininginfo
#区块浏览器
# https://btc.com/
#curl访问rpc测试
curl -s -X POST --user btc:btc2018 -H ‘content-type: text/plain;‘ http://127.0.0.1:8332/ --data-binary ‘{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }‘
#查询最新区块高度
curl -s -X POST --user btc:btc2018 -H ‘content-type: text/plain;‘ http://127.0.0.1:8332/ --data-binary ‘{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }‘ |awk -F ‘[:,]‘ ‘{print $3}‘
rpcuser 远程访问的认证用户
rpcpassword 远程访问密码
daemon 在后台运行
rpcallowip 远程访问的ip或网段
txindex 所有交易进行索引;否则只保留钱包地址交易索引记录
deprecatedrpc=accounts 启用账户"account"API ,V0.18版将被完全移除,新版"标签-label"API
#注意事项
#关闭后,再次启动时报错
#Cannot obtain a lock on wallet directory
#删除data目录.lock文件后,再次启动
#不配置datadir时,默认保存在 ~/.bitcoin/
#参考
https://blog.csdn.net/qq_38961394/article/details/82315629
https://blog.csdn.net/littlesmallless/article/details/83825784
标签:href top tail bind awk x86 method wallet .gz
原文地址:https://www.cnblogs.com/elvi/p/10203927.html