Title: Detailed information about datadir Post by: DeathAndTaxes on July 04, 2013, 08:25:00 PM Looking for detailed information on the data directory and file formats for QT client (0.8.3).
There is this wiki page but it is pretty sparse: https://en.bitcoin.it/wiki/Data_directory For example what format is the peers.dat file in? The chainstate sub folder contains leveldb representation of the UXTO right? What is the significance of multiple xxxxxx.sst files? There is also LOCK, LOG, and MANIFEST-xxxxxx files? The "blocks" subfolder contains leveldb representation of raw blocks right? Why are the files of difference size? Code: 08/05/2012 02:16 AM 2,097,361,271 blk00000.dat For example there are 30 blkxxxxxx files the first few are very large then most are 134MB. The last one is smaller but that would make sense as it is the block file in progress. Why 134MB? Why roughly 2GB for the first two block files and then the third one breaks that pattern? Title: Re: Detailed information about datadir Post by: etotheipi on July 05, 2013, 01:36:43 AM For example there are 30 blkxxxxxx files the first few are very large then most are 134MB. The last one is smaller but that would make sense as it is the block file in progress. Why 134MB? Why roughly 2GB for the first two block files and then the third one breaks that pattern? If you redownload the blockchain, they will be 134 MB. But if your blockfiles were mostly downloaded prior to version 0.8, then it used a 2 GB blkfile size, and just kept them when they switched it in 0.8. If you were to wipe the directory and redownload with 0.8+, it would be about 70 files of 134 MB each. If you redownloaded with version 0.7 or prior, it would be 5 files of 2 GB each. Title: Re: Detailed information about datadir Post by: DeathAndTaxes on July 05, 2013, 03:36:18 AM Thanks. That makes sense and yes this is from a very old install so it fits.
Any idea on the format of peers.dat file? Title: Re: Detailed information about datadir Post by: DeathAndTaxes on July 05, 2013, 03:40:31 AM Found a little more info here ....
Quote Used in 0.8.0: https://github.com/bitcoin/bitcoin/blob/cb2e1bdaa902197ba0f04aebd00420a4680548e0/doc/files.txt* wallet.dat: personal wallet (BDB) with keys and transactions * peers.dat: peer IP address database (custom format); since 0.7.0 * blocks/blk000??.dat: block data (custom, 128 MiB per file); since 0.8.0 * blocks/rev000??.dat; block undo data (custom); since 0.8.0 (format changed since pre-0.8) * blocks/index/*; block index (LevelDB); since 0.8.0 * chainstate/*; block chain state database (LevelDB); since 0.8.0 ok "custom format". Well that helps. ;) Title: Re: Detailed information about datadir Post by: jgarzik on July 05, 2013, 02:17:50 PM The chainstate sub folder contains leveldb representation of the UXTO right? Yes. Quote What is the significance of multiple xxxxxx.sst files? There is also LOCK, LOG, and MANIFEST-xxxxxx files? These are leveldb internal storage setup. Inherent in leveldb design. Analogy: Berkeley DB's low level storage format. Quote The "blocks" subfolder contains leveldb representation of raw blocks right? No. This is the raw bitcoin-specific wire format of blocks. Quote Why are the files of difference size? Bitcoin blocks differ in size. Also, some blk*.dat are larger because they were originally that way when imported the first time. If you use bootstrap.dat to initialize a new database (https://bitcointalk.org/index.php?topic=145386.0) then all your files should be nearly the same size. |