When I start up my Bitcoin core, it says "loading block index". Does this indexing occur on my local machine or does this mean my wallet fetches the latest block info, more specifically the block height? What is the purpose of this block indexing? Thanks
2 Answers
When I start up my Bitcoin core, it says "loading block index".
The Bitcoin Core node software maintains several pieces of data on disk (excluding the wallet):
- The actual blocks in append-only data files.
- The block index (which block headers exist, how they interconnect, and where on disk they are stored)
- The chain state (the set of unspent outputs with amount, txid and address) at the current best block in the index.
Because this information about what blocks are known and where they are on disk is so frequently needed, it is loaded entirely into memory.
During the "loading block index", the full block index is loaded into memory (it's pretty small, 60 MB at the time of writing), and several consistency checks are done (including verifying all difficulties and proof of work).
Does this indexing occur on my local machine
Yes.
or does this mean my wallet fetches the latest block info, more specifically the block height?
No, fetching information about new blocks always occurs in the background while your node is active, but during the "Loading block index" phase it is not yet active.
What is the purpose of this block indexing?
By index you perhaps are thinking of something more fancy than it is. It's simply a table that allows you to look a block's information based on its hash.
Bitcoin Core internally has dozens of indexes for various pieces of data. This is just one that is relatively big, and stored on disk.
this means "init database engine. load data from disk to memory"
-
ok, and after that it verifies the blocks, is still a local job or does the verifying already connects with the internet/network? Commented Jan 27, 2017 at 14:19
-