Run a Pruned Bitcoin Node

This guide is written for a Unix based system. It's reasonable to expect some modifications will be required for other operating systems.

When started, the pruned Bitcoin node will take roughly ~24 hours to reach chain tip.

Requirements:

  • Bitcoin Core >= v25.0

    • https://github.com/bitcoin/bitcoin

    • https://bitcoincore.org/en/download/

  • Host with a minimum of:

    • 2 vCPU (a single dedicated cpu for the bitcoind process)

    • 4GB Memory (during sync, more available memory will improve sync time)

    • 50GB free disk space (actual usage is closer to 20GB)

  • User account: bitcoin:bitcoin

  • Chainstate directory located at: /bitcoin/mainnet

    • bitcoin user must have read/write access.

  • Config directory located at: /etc/bitcoin

    • bitcoin user must have at least read access

Caveats

BIP-0159

In short, this BIP specifies that pruned nodes will advertise the service bit NODE_NETWORK_LIMITED, which restricts syncing blocks older than 288 blocks (~2 days).

What this means is that in practice, a stacks-blockchain node:

  • Cannot sync from genesis using a pruned node.

  • Must not be offline or otherwise down for longer than ~2 days (or 288 Bitcoin blocks).

1

Add bitcoin user and set file ownership

2

Bitcoin Config

Below is a sample config used to sync a pruned bitcoin node - feel free to adjust as needed.

If using the systemd unit below, save this file as /etc/bitcoin/bitcoin.conf

Notes:

  • btuser:btcpass is hardcoded as an rpcauth user/password (generated using this script).

  • Only localhost access is allowed (127.0.0.1) on the standard mainnet ports.

  • Pruning is set to be small, storing only the last 1GB of blocks (for p2p traffic, this is more than enough).

  • dbcache is set to the maximum of 16GB.

  • Wallet (and wallet rpc calls) are disabled.

3

Systemd unit file

ref: https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service

4

Enable and start the Bitcoin service

5

Track sync progress

Once started, you may track the sync progress:

Was this helpful?