2

You can run bitcoin in:

  • txindex mode: Which allows you to query any transaction on the blockchain with getrawtransactions (any other benefits?). This takes up the most space

  • default mode: this allows you to only getrawtransactions for your own transaction

  • Pruned mode: Like default mode but you only keep a few GB of the latest transactions.You download the blocks verify then throw them away.

But I would like to know in more depth the differences between the modes.

What part of the Bitcoin blockchain does each mode store on the local machine? What does it download and verify? What does it discard? What abilities do you lose with the different modes?

  • Short comment: getrawtransaction only works for unconfirmed transactions (or all, if you have txindex). To query for your own transactions you have to use gettransaction (which always works, and gives way more information). – Pieter Wuille Apr 21 '17 at 15:08
5

TxIndex

Most use cases do not require a tx-index. The wallet keeps track of the relevant transactions (if you run a wallet). A complete tx-index may be useful for block-explorer-like interfaces or for research, etc. It requires some disk space.

Pruning & TxIndex: You can't use a txindex with a pruned blockchain. Pruning will throw away scanned blocks. Having an index that points to a tx in a block that is no longer on your disk seems a waste.


Pruning

Autopprune (-prune=550) allows you to reduce your historical blockchain data to a given target (in MB, example uses 550 which is the minimum). You can't throw away all blocks because you may need to "roll back a couple of block" if there is a chain reorganisation.

If you set prune=1 (== manual mode), you can then manually prune your blockchain (use RPC call pruneblockchain <height>) [since 0.14]

The only reason to keep old blocks (say deeper then 144 blocks) is to allow other peers to bootstrap the blockchain and to serve (filtered) blocks to SPV client. There are little "end-user" use case (expect the txindex) to keep old block.

UTXO set

Important to know is, that your full node will keep track of all unspent transaction (only those are relevant for validating blocks/the chain). This database is (at the moment) roughly 2GB large and will (and must) also be present in pruning-mode. This database is essential for a full node.


Default mode

Keep all blocks (take up ~80GB of disk-space). This will allow other peers to verify the blockchain and it allows SPV peers to ask for relevant transactions in all possible blocks. If no one will run in this mode, the blockchain history may be lost (exaggerated).

  • FYI today the blockchain takes up closer to ~250 GB of disc space. It's getting difficult to run a full node... λ MEC-MBP scripts → λ git master* → du -sh ~/Library/Application\ Support/Bitcoin/{blocks,chainstate} 228G /Users/mec/Library/Application Support/Bitcoin/blocks 2.7G /Users/mec/Library/Application Support/Bitcoin/chainstate – mecampbellsoup Sep 30 '18 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.