Bitcoin Core - testnet4 full node & main net pruned node setup

blockchain snapshot

speed-up synchronization

as user

grab the latest snapshot of the Bitcoin blockchain and deploy it before starting the daemon for the first time

mkdir ~/.bitcoin/
cd ~/.bitcoin/

ls -lhF ~/Downloads/snapshot-*

# main net pruned ~ 8.9G
tar xvf ~/Downloads/snapshot-bitcoin-mainnet-891749-pruned.tar.zst
rm -f ~/Downloads/snapshot-bitcoin-mainnet-891749-pruned.tar.zst

# testnet4
tar xvf ~/Downloads/snapshot-bitcoin-testnet4-76687-full.tar.zst
rm -f ~/Downloads/snapshot-bitcoin-testnet4-76687-full.tar.zst

install

as root

grab the latest and official protocol implementation

ver=28.1
# FW
wget https://bitcoin.org/bin/bitcoin-core-$ver/bitcoin-$ver-x86_64-linux-gnu.tar.gz
wget https://bitcoin.org/bin/bitcoin-core-$ver/SHA256SUMS.asc

#wget https://bitcoin.org/laanwj-releases.asc
#md5sum laanwj-releases.asc
## d5f302457c9206f087b3143f697b073a  laanwj-releases.asc
#gpg1 --import laanwj-releases.asc

tar xzf bitcoin-$ver-x86_64-linux-gnu.tar.gz
cd bitcoin-$ver/
mkdir -p /usr/local/bin/ /usr/local/share/
cp -ai bin/* /usr/local/bin/
cp -ai share/* /usr/local/share/

ready to go

as user

which bitcoind
bitcoind -version

cd ~/.bitcoin/

# conf came with the snapshot
vi bitcoin.conf

main net pruned node

daemon=1
chain=main
prune=550
#txindex=1

testnet4 full node

daemon=1
testnet4=1
txindex=1
coinstatsindex=1
blockfilterindex=1

and we want to add these

# rpc
server=1
rpcbind=192.168.0.103
rpcuser=REPLACEME
rpcpassword=REPLACEME

# zero-mq
zmqpubrawblock=tcp://192.168.0.103:28332
zmqpubrawtx=tcp://192.168.0.103:28333

let’s proceed and start the freakin' node and check its sync status

screen -S bitcoin

bitcoind

pgrep -a bitcoind
netstat -lntup | grep bitcoind

# main net
watch "df -hT; echo; du -sh ~/.bitcoin/blocks/ ~/.bitcoin/chainstate/"
tail -F ~/.bitcoin/debug.log

# testnet4
watch "df -hT; echo; du -sh ~/.bitcoin/*/blocks/ ~/.bitcoin/*/chainstate/"
tail -F ~/.bitcoin/*/debug.log

wait until you’ve reached progress=1

operations

status

bitcoin-cli getmemoryinfo
bitcoin-cli getrpcinfo
bitcoin-cli uptime

bitcoin-cli getnetworkinfo
bitcoin-cli getpeerinfo

bitcoin-cli getblockchaininfo
bitcoin-cli getdifficulty

stop

bitcoin-cli stop

acceptance

are we truly up-to-date? – did we get the last block?

# main
curl -s https://blockchain.info/q/getblockcount; echo

# testnet4
https://testnet4.com/
https://mempool.space/testnet4

bitcoin-cli getblockcount

additional notes

firewall

once your node is in sync, you might want to open the service to the world

vi /etc/nftables.conf

    # bitcoind
            iif $nic tcp dport 8333 accept
            iif $nic tcp dport 48333 accept

systemctl reload nftables.service

as for 8332/tcp, it is only enabled on localhost by default

resources

https://bitcoin.org/en/download

https://bitcoin.org/en/full-node

https://blockgeeks.com/install-bitcoin-core/

https://en.bitcoinwiki.org/wiki/Bitcoind

firewall

https://bitcoin.stackexchange.com/questions/5757/what-is-the-difference-between-the-rpc-port-8332-and-port-8333

full node

FW https://bitcoin.org/en/full-node

FW https://bitcoin.org/en/full-node#what-is-a-full-node ==> 7GiB

FW https://bitcoin.org/en/posts/how-to-run-a-full-node

blockchain snapshots

https://bitcoin.stackexchange.com/questions/110945/how-download-whole-blockchain-and-preprocess-it-for-analysis

https://bitcoin.stackexchange.com/questions/799/can-i-download-the-whole-block-chain-from-somewhere

https://blockchains.download/bitcoin/

https://github.com/Blockchains-Download/Bitcoin/releases

https://github.com/Blockchains-Download/Bitcoin

https://flo.sh/download-bitcoin-blockchain-bootstrap/#donation ==> not for free

https://prunednode.today/ ==> OK

[fw] https://bitcointalk.org/index.php?topic=5177528.0

[fw] https://bitcointalk.org/index.php?topic=145386.0

https://www.linux.org/threads/installing-bitcoin-on-kali.29678/

https://blockgeeks.com/guides/how-to-install-blockchain-on-ubuntu/

https://bitcoin.stackexchange.com/questions/12001/what-is-the-fastest-possible-way-to-download-the-blockchain

https://www.reddit.com/r/Bitcoin/comments/h06stx/can_you_predownload_the_whole_blockchain_before/

sync

https://bitcoin.stackexchange.com/questions/37815/how-to-know-if-bitcoind-synced

prune

https://bitcoin.stackexchange.com/questions/37496/how-can-i-run-bitcoind-in-pruning-mode

https://bitcoin.stackexchange.com/questions/24563/is-there-a-way-to-run-bitcoind-without-being-a-full-node

https://news.bitcoin.com/pros-and-cons-on-bitcoin-block-pruning/

https://bitcoin.stackexchange.com/questions/71539/do-you-have-to-download-the-entire-bitcoin-blockchain-for-bitcoin-core-pruned-mo

https://coinguides.org/bitcoin-blockchain-pruning/

rpc

https://jlopp.github.io/bitcoin-core-config-generator/

troubles

https://bitcoin.stackexchange.com/questions/84918/bitcoind-daemon-error-connecting-to-the-server


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun