2

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

  1. 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?
  2. Which db would be suitable for above purpose. sql or no-sql?
2
  • If users are going to run createwallet from web, maybe you should consider few security recommendations mentioned in this doc: github.com/bitcoin/bitcoin/blob/master/doc/…
    – user103136
    Commented Nov 11, 2021 at 1:59
  • Yes. I plan to have security taken care of. Thats not an issue.
    – kdas
    Commented Nov 12, 2021 at 23:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.