Issue
I am working on cryptocurrencies blockchain data and I want data from the beginning of the time of that particular cryptocurrency. Is there any way to download complete block data in the Postgresql file?
https://blockchair.com/dumps is although offering this but they limit the download speed and number of downloading files. Moreover, I am also waiting for their reply. Meanwhile, I am finding some other ways or websites to download complete data of multiple cryptocurrencies in SQL format. I cannot download the .csv or .tsv file because it takes a lot of space on my laptop. Therefore, I want to use any other format (preferably .sql format)
Solution
This is depends on cryptocurrency, you have. I can suggest you, how to fetch data from Bitcoin-compatible crypto, i.e. Bitcoin, Emercoin, etc. The cryptocurrency node (wallet) has JSON RPC API interface.Usinf this API, you retrieve all your data with following commands from this command list:
- Get total block counter with command
getblockcount. - Iterate block number from 0 to result of
getblockcount. For each number, callgetblockhash. - For result of
getblockhashcallgetblock. This function provide transactions list, enclosed in this block. - For ech transaction (nested loop), call
getrawtransaction. Hint: if you callgetrawtransactionwith 3rd argument "1", node automatically decodes transaction, and return you decoded transaction in JSON.
You can extract from a transaction vectors vin and vout, and upload all data into your SQL database.
Answered By - olegarch Answer Checked By - Candace Johnson (sql.easybugfix Volunteer)
Post a Comment
Post a Comment