What is the difference between chainstate and blocks folder?

1

Is the blocks and chainstate folder store the same blocks data ?

How can we read those data using code and display that on the web frontend like the blockchain explorer websites

Pankaj Kumar

Posted 2018-11-01T05:55:18.820

Reputation: 145

Answers

2

Is the blocks and chainstate folder store the same blocks data ?

No, the blocks directory contains the actual blocks. The chainstate directory contains the state as of the latest block (in simplified terms, it stores every spendable coin, who owns it, and how much it's worth).

How can we read those data using code and display that on the web frontend like the blockchain explorer websites

No, you need transaction and address indexes for that. Bitcoin Core is not designed to provide those.

Pieter Wuille

Posted 2018-11-01T05:55:18.820

Reputation: 54 032

===>No, you need transaction and address indexes for that. Bitcoin Core is not designed to provide those. how can we get transaction and address indexes from those 2 folders ? Is there is any python library that allow us to show that blocks data in meaning full ways e.g blockchain explorer ?Pankaj Kumar 2018-11-01T06:22:46.653

No, you need different software than Bitcoin Core.Pieter Wuille 2018-11-01T06:43:17.710

ok , then how the blockchain-explorer websites display blocks data ?Pankaj Kumar 2018-11-01T06:53:13.630

By using software they wrote themselves generally, to index the Bitcoin blockchain.Pieter Wuille 2018-11-01T06:54:48.273

https://github.com/bitpay/insight-api , this code from the bitpay explore all the blockchain transactions , I am searching for any other library in python that allow the same functionalityPankaj Kumar 2018-11-01T06:58:08.107

blk00000.dat , is this file represent single block with transactions ?Pankaj Kumar 2018-11-01T08:02:05.487