When parsing through the levelDB or RocksDB (Depending on the client you are using) there are string values representing the key and the value. These are both stored as Byte arrays as well.
My question is: When analyzing each entry, what does the key represent in the relation to the data stored? Is the key just a unique identifier for the data or is it part of the data itself? I am trying to decode the RLP of an entry and need to know what the significance of the key is to the data.
Best Answer
Let's start with having a look at what we get in geth console for block number 40.
Now let's consider a Go program. I Explained everything in code comments about how it is constructing keys and accessing values from Leveldb.
Link to file So that you can see highlighted syntax. gethLevelDbKeys.go Now lets see the Output of above Program in console.
This is just an example. If you want to know everything in detail. You can consider schema.go file in ethereum source code.