Josh
Josh

Reputation: 21

Populating PostgreSQL DB using bitcoind RPCs and API

I'm attempting to create a PostgreSQL database with block data on:

Hash, total transactions, height, time, merkle root, confirmations, difficulty, bits, size (bytes), version, nonce

And transaction data on:

Hash, Txid, Size (bytes), confirmations, fee, time, amount, addresses

I'm struggling to figure out the best way to use the bitcoin daemon RPCs/API to get the data, so that I can put it into the database.

Cheers!

Upvotes: 0

Views: 358

Answers (1)

jordiburgos
jordiburgos

Reputation: 6302

First, you have to have acces to the information of blocks and transactions. Choose one of these

Then, query every block and its transactions, from block 0 to current one (496764 as of now) and store this information through SQL to your PostgreSQL database.

To query blocks and transactions from a Bitcoin node, use the JSON/RPC API.

Upvotes: 0

Related Questions