Wednesday, December 25, 2024

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

Bitcoin Core has a number of totally different databases and indexes that it maintains independently of one another since some issues are elective.

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 inside the file). It additionally has the knowledge of which rev*.dat file has the undo information, and the place that undo information is inside that file.

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

Each the block index and the chainstate database are essential for regular operation, and each Bitcoin Core node has them. Nevertheless, they’re separate as they retailer distinct information, 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 could 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 elective indexes – txindex, coinstatsindex, and blockfilterindex. These are maintained individually as a result of they don’t seem to be essential for regular operation. The format of those databases are unbiased 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