部署比特幣主網全資料節點
阿新 • • 發佈:2022-01-28
參考資料
部署過程
- 下載Bitcoin程式碼
官方下載地址:bitcoincore.org/en/download/,不同系統選擇不同版本。
以linux為例:
wget https://bitcoincore.org/bin/bitcoin-core-22.0/bitcoin-22.0-x86_64-linux-gnu.tar.gz
tar -xzvf bitcoin-22.0-x86_64-linux-gnu.tar.gz
- 配置環境變數
vi ~/.bashrc #bitcoin env export BTCPATH=/root/bitcoin/bin export PATH=$BTCPATH:$PATH source ~/.bashrc
- 建立配置檔案(
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=btc2021
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 getblockchaininfo
同步時間
截止到發稿2022/1/28 10:51
,區塊同步資訊如下:
{ "chain": "main", "blocks": 642383, // 當前同步的區塊高度 "headers": 720686, // 主網區塊高度 "bestblockhash": "0000000000000000000fdb7094d6c0cc6190c8b889b46f431565ccbe5d11a7e7", "difficulty": 16847561611550.27, "mediantime": 1596661550, "verificationprogress": 0.7973446475106887, "initialblockdownload": true, "chainwork": "0000000000000000000000000000000000000000121654aa68906e226cbf59f0", "size_on_disk": 331753405195, "pruned": false, "softforks": { "bip34": { "type": "buried", "active": true, "height": 227931 }, "bip66": { "type": "buried", "active": true, "height": 363725 }, "bip65": { "type": "buried", "active": true, "height": 388381 }, "csv": { "type": "buried", "active": true, "height": 419328 }, "segwit": { "type": "buried", "active": true, "height": 481824 }, "taproot": { "type": "bip9", "bip9": { "status": "defined", "start_time": 1619222400, "timeout": 1628640000, "since": 0, "min_activation_height": 709632 }, "active": false } }, "warnings": "" }
開始同步時間是2022/1/27 15:23
。