why is bitcoin leveldb separated in so many small pieces?

1

Currently I could see 1418 ldb files on my box, from 210040.ldb to 215423.ldb (some missing).

  • Why are they separated in this way?
  • I want to read the leveldb using golang, but I don't know which one should I use.
  • Can I load them altogether?

lzl124631x

Posted 2018-10-20T04:49:16.727

Reputation: 121

Answers

1

At the moment I try out creating my own leveldb I understand.. The chainstate folder itself is the entry point of the database; all the files within it are just the data.

This is what the data looks like after I put some dummy data

enter image description here

lzl124631x

Posted 2018-10-20T04:49:16.727

Reputation: 121

If you want to add more information, please edit the question rather than posting an answer :)MeshCollider 2018-10-20T11:18:05.893

Apologies if this was intended as an answer, it didn't seem to fully address all the points of the question :)MeshCollider 2018-10-21T08:02:52.547

@MeshCollider np. :) Actually the 3 questions can be answered by this one. The separation of .ldb files has nothing to do with bitcoin, it's just the way leveldb stores the data. I hope this learning can help save others' time.lzl124631x 2018-10-21T09:50:04.573