Post
Topic
Board Development & Technical Discussion
Re: Need idea for FASTER Balance & transaction update
by
cfbtcman
on 27/06/2020, 02:29:13 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.

Im doing something like that and im insisting in blockcypher API but im having a lot of problems discovering syntax of the commands, i cant found it in Blockcypher website and i start to think maybe some optiions id like to use are not possible or im making mistakes.

Someone have the curl syntax to send from one address to one wallet?

I see this example:

{inputs:[{"wallet_name":"alice", "wallet_token":"YOURTOKEN"}], value: 5000000}

But this is example to use as inputs and id like to use a wallet for outputs, i tried a lot of combinations without success, someone can help?