I've downloaded Bitcoin data locally via the Bitcoin Core app install and sync. I'm looking to build a system though which users can query their account balance. I'm thinking of building a simple web interface to accept a wallet address and in the backend, I run below commands in the bitcoin-cli console:
createwallet "wallet-1" true
loadwallet wallet-1
importaddress "1CfaunqrVpcXmpLheUVWeSP1KPsKDha1Nb" "" false
getbalance
And return the result back to webUI.
However this approach is not scalable to support say 100s of requests per sec. Therefore I'm thinking of parsing the Bitcoin data out from the .blk files into a query-able database, say MySQL or Mongo or Cassandra etc and run the balance query on the above db. Its a one time job of preprocessing and indexing the data and then I've a query service sitting in front of db to query and return result. Question
- What is the ideal way to transfer Bitcoin data out into a suitable db. Since I'm only interested in supporting balance enquiries, what's the best and easy way to achieve this? Any existing tools I can use?
- Which db would be suitable for above purpose. sql or no-sql?
createwallet
from web, maybe you should consider few security recommendations mentioned in this doc: github.com/bitcoin/bitcoin/blob/master/doc/…