Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query LOCAL Bitcoin blockchain with C# .NET

People also ask

How do I query Bitcoin blockchain?

But if you want to query the bitcoin blockchain locally, you'll need to download the 120+GB blockchain and then write up a custom script to consume the data manually to do what you need. Time intensive if you are willing to invest in it. Otherwise best to use publicly available stats and data and work off of that.

Is SQL used in blockchain?

To incorporate the increasingly important blockchain technology into Information Systems curriculum, one approach is to store blockchain data in a SQL database, thus allowing fast data access and a simpler understanding of the underlying concepts.

How do I trace Bitcoin transactions or addresses?

A Bitcoin address by itself is not traceable, as there is no identifying information stored directly on the blockchain. But there are ways that the identity of an individual can be linked to specific wallets they own and transactions they have made. This is why Bitcoin is not anonymous — it's pseudonymous.


The first and second attempts in your question are nothing alike. First one uses json rpc to ask the daemon for the balance (and I dare say it's the proper way - you don't take the top off your car engine and push the pistons up and down yourself to achieve forward motion, do you?) the second attempts to open the daemon's database itself and calculate the balance directly.

You don't "need a network" to query the localhost, you just need a machine that has TCP/IP support installed, so just use the first method by whatever means - either by using a library that writes the relevant json-rpc data into an http request, or by forming the relevant http request yourself..

BitcoinLib may or may not be maintained (I don't know) but that doesn't invalidate its ability to query your local daemon; as far as I know GetBalance hasn't been removed or refactored, and I use BitcoinLib with the latest bitcoind for a variety of operations including GetBalance