12

I realize that LMDB is very different from your typical SQL database, but is there a query language, or scripting language interface, that can be used to query the blockchain's database?

I am aware of this question on displaying the output histogram via a feature of monerod. Although, when trying that my daemon crashed. I would like to do something similar from a script.

dpzz
  • 4,539
  • 4
  • 22
  • 46

2 Answers2

8

If you're using python, the py-lmdb module includes a basic CLI. http://lmdb.readthedocs.io/en/release/

Keep in mind that you'll be getting raw data back, not anything in a human-readable format.

hyc
  • 4,253
  • 19
  • 21
5

I don't think there is an equivalent of the mysql or psql commands for lmdb, therefore to make custom queries to the database you must write a program that accesses it directly.

There are some examples at github.com/moneroexamples:

JollyMort
  • 20,004
  • 3
  • 49
  • 105
glv
  • 3,364
  • 11
  • 15