Saturday, July 6, 2024

bitcoind – What is the distinction between the three index directories “blocks/index/”, “bitcoin/indexes” and “chainstate”?

Bitcoin Core has a number of completely different databases and indexes that it maintains independently of one another since some issues are non-obligatory.

blocks/index comprises the LevelDB database for the block index. This comprises the knowledge of the place each single block is positioned within the blocks/ listing (which blk*.dat file comprises it, and the offset throughout the file). It additionally has the knowledge of which rev*.dat file has the undo knowledge, and the place that undo knowledge is inside that file.

chainstate/ comprises the LevelDB database that has the UTXO set.

Each the block index and the chainstate database are needed for regular operation, and each Bitcoin Core node has them. Nonetheless, they’re separate as they retailer distinct knowledge, and lacking the chainstate database doesn’t imply that the block index is invalid.

If you’re lacking the chainstate database however have the block index, the chainstate database might be rebuilt a lot quicker than rebuilding each the chainstate and the block index. That is what the -reindex-chainstate choice does – it removes the chainstate database however retains the block index so it solely has to rebuild the chainstate. -reindex is a full reindex and removes each databases.

The databasese in indexes/ are for the non-obligatory indexes – txindex, coinstatsindex, and blockfilterindex. These are maintained individually as a result of they aren’t needed for regular operation. The format of those databases are impartial of one another, and since these indexes are constructed asynchronously, every index has its personal database.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles