3

I learned that the blocks and transactions are stored locally in .bitcoin/blocks/index and .bitcoin/chainstate databases, respectively. I want to make a direct query to those databases to measure the response time. However, I found it hard to understand the format and the best way to access to the data. I am using Plyvel, but I couldn't formulate the exact query, for example to search for a particular transaction identified by its hash value, or searching for the all transactions made by a particular sender identified by the hash of its public address.

Any help, please.

7
  • This may help you bitcoin.stackexchange.com/a/52167/30668
    – sr_gi
    May 16, 2017 at 9:15
  • I already see it, but how the transaction id is transformed from 246c5a81b6ad0dfc0dbc0b2ff5bde65ee1913f75a47d409b8ff8074a27ec1000 to c0010ec274a07f88f9b407da4753f91e15ee6bdf52f0bbc0dfc0dadb6815a6c24 ??
    – Noureddine
    May 16, 2017 at 10:10
  • You should change the endianness. While txids are displayed in blockexplorers as big endian values, they are stored in the LevelDB in their little endian representation.
    – sr_gi
    May 16, 2017 at 10:17
  • Ah ok, I see. Then I have to convert txid from big to little endian before making the query. May be this can help in the conversion: stackoverflow.com/questions/13155570/…
    – Noureddine
    May 16, 2017 at 10:33
  • What about the sender address, how I can search for transaction by sender address?
    – Noureddine
    May 16, 2017 at 10:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.