Author

Topic: Need idea for FASTER Balance & transaction update (Read 300 times)

legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
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?
Hmm, CMMIW but I don't think you can send the coins to a specific wallet instead of an address. Wallet tokens are not meant to be exposed and they don't have off-chain transactions this could easily expose the keys that is contained within the wallet.

we did this method in our site: instead of using unique address for each user, generate addresses for each deposit and tell users to send payment only one time to each address and change address after a successful payment. this way you do not need to check balance of all addresses every time. you just check one when they deposit and then show summary of all addresses balance from db.
Most people won't read what you put on the site and just assume that the addresses are reusable. You'll have a bigger headache trying to transfer out the funds that were accidentally sent to old addresses than to just monitor all the addresses that was generated in the first place.
copper member
Activity: 27
Merit: 0
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. 
we did this method in our site: instead of using unique address for each user, generate addresses for each deposit and tell users to send payment only one time to each address and change address after a successful payment. this way you do not need to check balance of all addresses every time. you just check one when they deposit and then show summary of all addresses balance from db.
member
Activity: 264
Merit: 16
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?
member
Activity: 84
Merit: 22
Hi,


Depending on your programming language, you can log each address generated into your database then

bitcoin-cli listunspent 0 99999 "address" - this should return the address balance.

example: 0.0384758


Hope this helps Smiley

legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
--snip--

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
  

Yeah, if you wanted the balance of an address, the getreceivedbyaddress or listreceivedbyaddress calls would have been a logical choice (you'd still need some extra calls to find/query the funding transactions tough). listtransactions would also be fitting your usecase.  If you're looking for "fresh" deposits, you could also use listunspent (altough as soon as you spend those unspent outputs, they'll no longer be listed, so it might not be a good idear to use this call).

You'll need a decent script to keep track of which transactions were already credited to a user's account and which ones need to be credited tough...

getbalance does not give you any details, so if you're tracking deposits from multiple users, this call does not suffice
copper member
Activity: 14
Merit: 6
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
 
legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
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.
copper member
Activity: 14
Merit: 6
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. 



Jump to: