Bitcoin Forum
May 10, 2024, 10:19:18 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need idea for FASTER Balance & transaction update  (Read 297 times)
coinstrader777 (OP)
Copper Member
Newbie
*
Offline Offline

Activity: 14
Merit: 6


View Profile
April 29, 2020, 10:47:17 AM
Merited by OmegaStarScream (2), Welsh (2), ABCbits (2)
 #1

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. 




-------Helping people to Launch their own Cryptocurrency Exchange via pre-build Software-------
1715379558
Hero Member
*
Offline Offline

Posts: 1715379558

View Profile Personal Message (Offline)

Ignore
1715379558
Reply with quote  #2

1715379558
Report to moderator
1715379558
Hero Member
*
Offline Offline

Posts: 1715379558

View Profile Personal Message (Offline)

Ignore
1715379558
Reply with quote  #2

1715379558
Report to moderator
1715379558
Hero Member
*
Offline Offline

Posts: 1715379558

View Profile Personal Message (Offline)

Ignore
1715379558
Reply with quote  #2

1715379558
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715379558
Hero Member
*
Offline Offline

Posts: 1715379558

View Profile Personal Message (Offline)

Ignore
1715379558
Reply with quote  #2

1715379558
Report to moderator
1715379558
Hero Member
*
Offline Offline

Posts: 1715379558

View Profile Personal Message (Offline)

Ignore
1715379558
Reply with quote  #2

1715379558
Report to moderator
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4922


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
April 29, 2020, 10:51:45 AM
Merited by ABCbits (1)
 #2

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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
coinstrader777 (OP)
Copper Member
Newbie
*
Offline Offline

Activity: 14
Merit: 6


View Profile
April 29, 2020, 01:48:09 PM
 #3

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
 

-------Helping people to Launch their own Cryptocurrency Exchange via pre-build Software-------
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4922


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
April 29, 2020, 01:54:03 PM
Merited by Welsh (3), ABCbits (1)
 #4

--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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
cryptoworld99
Member
**
Offline Offline

Activity: 84
Merit: 22


View Profile
May 04, 2020, 01:51:25 AM
 #5

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

cfbtcman
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
June 27, 2020, 02:29:13 AM
 #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.

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?
slancer
Copper Member
Newbie
*
Offline Offline

Activity: 27
Merit: 0


View Profile WWW
June 28, 2020, 06:35:19 AM
 #7

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.

www.satoshilancer.com - online outsourcing and freelancing
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4177



View Profile
June 28, 2020, 07:08:01 AM
 #8

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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!