Post
Topic
Board Development & Technical Discussion
Re: From node to block explorer?
by
noblefire
on 14/01/2021, 23:44:03 UTC
A block explorer will use a database to keep track of transactions and will update it as new blocks come in. It will probably not use RPC commands as it receives requests from its users.
This seems a great idea. Why haven't I thought it before... Once a new block is mined, the database will insert a new row of information. Still, though, I don't get how I'll convert the blk.dat files to csv. (So I can import it to a database)

I recently began working on trying to do the same thing. I wanted a python library that would let me change the RPC authentication info so that I could use python to send RPC commands to my node and store the returned data into a CSV file.

There were some libraries I found on Github but they didn't do exactly what I wanted, so I started writing a library myself. I've tested it with a few commands, and it works. Using the requests library and this link https://curl.trillworks.com/ you can convert all the bitcoin-cli curl commands to python. I've been making them into functions so they're callable within other programs.