Bitcoin全节点搭建

1. wget https://bitcoincore.org/bin/bitcoin-core-0.20.1/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz

2.tar -xzvf bitcoin-0.20.1-x86_64-linux-gnu.tar.gz

mv bitcoin-0.20.1 bitcoin

3.创建配置文件(bitcoin.conf)
mkdir -p /btc_data

mkdir ~/.bitcoin

vi ~/.bitcoin/bitcoin.conf

datadir=/btc_data

dbcache=4096

txindex=1

irc=1

upnp=1

rpcuser=btc

rpcpassword=btc2024

daemon=1

server=1

addressindex=1

rest=1

rpcbind=0.0.0.0:8332

rpcallowip=0.0.0.0/0

deprecatedrpc=accounts

4.启动节点
./bitcoind -daemon(后台运行)

5.停止节点

./bitcoin-cli stop

6.检查
./bitcoin-cli getblockchaininfo(查看区块链同步)

7.rpc请求测试

curl -s -X POST --user btc:btc2024 -H 'content-type: text/plain;' http://ip:8332/ --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkinfo", "params":[] }'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值