2

I'm looking to write up a PHP script that can query 10,000 monero private keys to get its balance. Once the balance is updated, it will be stored in a mysql database. I know scanning the monero blockchain can take quite some time for each address. Each of my users have a shared monero "private key" where they have access to the funds as do I. I want to create a website that keeps track of the balances in these addresses.

I was thinking of scanning each address initially even if it takes awhile. Then keep track of the last scanned height and start from there again on a 5-10 minute cron run. I'm not sure if this is the best method and would like to know if there are other good solutions to this problem?

Patoshi パトシ
  • 4,608
  • 4
  • 27
  • 69

1 Answers1

0

There's a Monero wallet PHP library here (I've never used it so just suggesting) . Perhaps you could use it to create a PHP script that retrieves a wallet balance based on a view key and updates your DB accordingly

The your cron job could iterate over the 10000 wallets (using a managed queue) with the script.

Your DB should hold information like last_update_time in addition to keys, balances, etc.

I would use something like MongoDB for this kind of thing rather than mysql as you don't need a relational db and you will probably want to add fields as you figure out the angles on this thing

Zigglzworth
  • 587
  • 4
  • 11