Post
Topic
Board Development & Technical Discussion
Re: Need idea for FASTER Balance & transaction update
by
coinstrader777
on 29/04/2020, 13:48:09 UTC
Hello All,
  I was working on some crypto platform. Say the platform has 1000 users with unique & single wallet address for each user.
  Any time they can deposit to their address & start using the platform. I will do a cron API Call to blockcypher API &  pass each address to get their balance, & update to DB.  But it is fragile, as the user grows up, it difficult & slow to update balance & the cron eventually DIES.
  Is there any better way 2 update balance & transaction to the platform DB.  


If you're planning to have more than a handfull of active users, i'd defenately start by running your own bitcoind instead of using blockcypher's api.

When configuring the bitcoin daemon, use notifyers as a hook to your update script, that way your database will stay up-to-date.

I'd probably use a combination of -walletnotify and -blocknotify, and maybe poll the mempool from within the user's account overview page for incoming, unconfirmed transactions.
Make sure you either have a watch-only wallet, or make sure your hotwallet is properly locked.

Hi.,
 I was using bitcoind with getbalance(x) method. which was ridiculous. but as per your suggestion -walletnotify will return only wallet balance i think. i need for individual address. I will definitely do check out this stuff & back.. 
Thanks a lot... Smiley