Post
Topic
Board Development & Technical Discussion
Merits 17 from 4 users
Topic OP
How to manually verify blk*.dat and rev*.dat files?
by
.anto.
on 20/02/2019, 17:21:02 UTC
⭐ Merited by ETFbitcoin (9) ,suchmoon (4) ,bones261 (3) ,d5000 (1)
I apologise if this had been asked and answered before, but I failed to find that on this forum.

Every time I found a new VPS provider offering cheaper and bigger resources, I move my full node to the new VPS. I make sure the integrity of blk*.dat and rev*.dat files by comparing their md5sum on the source and target VPS.

I recently decided not to renew the contract of one of my VPS'. Instead of letting it waiting for its contract expiry date and doing nothing, I configured another full node with pruning as it has only about 100 GB storage space.

When I compared the pruning full node with the main one, the most recent blk*.dat and rev*.dat files have different md5sum as below.

Code:
.
.
49d09f29e04dd8c91fea980a1978ee9c  blk01510.dat 49d09f29e04dd8c91fea980a1978ee9c  blk01510.dat
6bdeff13773a02b73b38a859b5f8a461  blk01511.dat 6bdeff13773a02b73b38a859b5f8a461  blk01511.dat
e419727a0b5a370256f623ccbac64e13  blk01512.dat e419727a0b5a370256f623ccbac64e13  blk01512.dat
802fa5848a9cb9fa4adc0b5e2b584207  blk01513.dat      | 3edb80b29dbb6b80c9fbe477d26b5edd  blk01513.dat
bb8f563889804ebce134f371cdd61213  blk01514.dat      | eb7642fcc1de5ff0825a23e23d991e71  blk01514.dat
eeedb8d91fe9fa7cc19021d142744b0f  blk01515.dat      | 08786174285354d992c730c14fb50edb  blk01515.dat
.
.
2e3c8f5cf0bfa1e9147390d238d71001  blk01533.dat      | 07e3d7f105cf504830afae31be5c9574  blk01533.dat
caf153aaf6433814b6579f0a531ae6b4  blk01534.dat      | 5f3021e57cfd4a97204bf25f38ef56a8  blk01534.dat
9a7d8d931540f64a06c7fce73db791cf  blk01535.dat      | 49ae0a801b7fd36ff22f578e521141a8  blk01535.dat
.
.
3a70613f860c242201f4f84d27524992  rev01510.dat 3a70613f860c242201f4f84d27524992  rev01510.dat
7dc17fc34d5ffe5dca1f4fccf0591641  rev01511.dat 7dc17fc34d5ffe5dca1f4fccf0591641  rev01511.dat
ac77bbefd85305fce50dfcc63e41cd1d  rev01512.dat ac77bbefd85305fce50dfcc63e41cd1d  rev01512.dat
95c0f5bc1b19ceee3ee7ba727e580fd3  rev01513.dat      | 0c861743a64dfa3b50002aee40e391b9  rev01513.dat
9d6d81f0429fc33f36ed7fb49cdfe1bd  rev01514.dat      | 74caa8ce3429ccb55e4fb50de0a23630  rev01514.dat
375cf8c1ffef33d6899981d09087205b  rev01515.dat      | 43c2a326b5c5c66da8172f924ba4357d  rev01515.dat
.
.
207ce7cc6b82f9dd0e514edfbfaa3332  rev01533.dat      | dd0dc8175770ea616dce3d7c4fb292fc  rev01533.dat
3a22716cecc8759d96545c8be7274c4a  rev01534.dat      | 167bce7ead5ee42fcdb7629fb86edb2e  rev01534.dat
befed144db33cd208be59bdedb360098  rev01535.dat      | 63fa05c946ad883797ed6053b3a87da5  rev01535.dat

That makes me wonder on the integrity of my blockchain files.

As far as I know, the only command to verify the blockchain database is "bitcoin-cli verifychain" as below

bitcoin-cli shell
Code:
anto@deeppurple:~$ bitcoin-cli verifychain 4 100
true
anto@deeppurple:~$

debug.log
Code:
.
.
2019-02-20T16:46:18Z Verifying last 100 blocks at level 4
2019-02-20T16:46:18Z [0%]...[10%]...[20%]...[30%]...[40%]...[50%]...[DONE].
2019-02-20T16:47:32Z No coin database inconsistencies in last 100 blocks (236944 transactions)
.
.

But I don't think that will tell me which blk*.dat and rev*.dat files that are corrupted (if any). And it will take quite a long time to verify the whole blockchain files.

Is there any better and faster way to manually verify those blk*.dat and rev*.dat?

What will happen if my full node sends corrupted data to its peers who asked very old blocks, due to the corrupted blk*.dat and rev*.dat files? Will my full node get notified so that it can automatically repair the relevant corrupted blk*.dat and rev*.dat files?

Thanks a lot in advance for your help.