Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Miraitee on July 09, 2021, 02:30:54 AM



Title: Analyze the blockchain in windows
Post by: Miraitee on July 09, 2021, 02:30:54 AM
I just recently installed the full bitcoin blockchain on windows,

Is it possible to analyze the blockchain through some command line?

If yes, can you help me with some links?

Thank you.


Title: Re: Analyze the blockchain in windows
Post by: nc50lc on July 09, 2021, 03:28:31 AM
What type of data do you need to analyze from the blockchain?

For the commands, you can use this link:https://bitcoincore.org/en/doc/0.21.0/rpc/ (https://bitcoincore.org/en/doc/0.21.0/rpc/)
The command list is on the right-hand side of the page, you can select older Bitcoin core versions under: "Development->RPC Docs->(version)".


Title: Re: Analyze the blockchain in windows
Post by: pooya87 on July 09, 2021, 03:31:19 AM
I just recently installed the full bitcoin blockchain on windows,
I'm assuming you mean you've installed a bitcoin "full node" on your computer and have fully synced it with the network.

Quote
Is it possible to analyze the blockchain through some command line?
It depends on how that full node has stored the blockchain on disk and what kind of analysis you want to perform.
Blockchain is just raw data that has to be indexed if you want to perform additional data analysis on it. Full nodes like bitcoin core don't really index the blockchain. However there are a lot of information you can already extract using the RPC commands. For example: https://chainquery.com/bitcoin-cli#blockchain (you can run almost all commands in your browser).

What kind of information do you want to extract?


Title: Re: Analyze the blockchain in windows
Post by: NotATether on July 09, 2021, 12:24:21 PM
Is it possible to analyze the blockchain through some command line?

I also assume you're running the Bitcoin-QT GUI, so you have a console accessible at Window > Console which you can run all the RPC commands in without opening a command prompt or powershell.


Title: Re: Analyze the blockchain in windows
Post by: HCP on July 09, 2021, 09:56:53 PM
Is it possible to analyze the blockchain through some command line?
You'll need to clearly define what you mean by "analyze the blockchain", before any can give you any meaningful advice or links to possible solutions/guides. Without knowing exactly what it is that you're trying to achieve, it's going to be impossible to point you in the right direction.

One thing to check before you begin, if you're wanting to use certain RPC calls (like getrawtransaction etc) that involve transactions that do not relate to your wallet, you'll need to make sure that you have txindex=1 set in your bitcoin.conf file, so that Bitcoin Core is indexing all the transactions.

You'll also want to make sure that your node is not running in "pruned" mode. Make sure there is no prune= value set in your bitcoin.conf and that in the "Settings -> Options -> Main" tab, that the "prune block storage to..." option is not checked:
https://talkimg.com/images/2023/11/14/zFOoc.png

Both of these are generally required for most analysis tools to work properly.


Note that if your node is currently pruned, you'll need to disable it and then resync your node. You'll need an absolute bare minimum of ~400 GB of free disk space to fully sync Bitcoin Core with transaction indexing turned on... having at least 1TB is better if you indeed to keep and run this node long term.


Title: Re: Analyze the blockchain in windows
Post by: bob123 on July 10, 2021, 11:29:23 AM
Is it possible to analyze the blockchain through some command line?

If you want to analyze the blockchain, you need to have the txindex flag set. Otherwise you won't be able to query transactions not related to your wallet.

Further, the preferred software depends on your specific task and on what exactly you want to analyze.