Bitcoin Forum
May 30, 2024, 10:30:19 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Get balance of address which is not from my bitcoind wallet  (Read 4187 times)
JimmyGre (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
June 09, 2014, 11:21:46 PM
 #1

Hi,
I just installed bitcoin daemon on my server. Now I only can get address balance from my wallet.
Is there a way to get external addresses balance in my bitcoin daemon (PHP)?

(I don't want to use something like blockchain api ...)
(getreceivedbylabel is not working for me  Huh)

Cheers,
J
Automatic
Full Member
***
Offline Offline

Activity: 238
Merit: 105


View Profile
June 09, 2014, 11:23:01 PM
 #2

Unless bitcoind has updated recently, you cant do this. You'll have to create your own database by crawling through the blockchain.

Please ask for a signed message from my on-site Bitcoin address (Check my profile) before doing any offsite trades with me.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3402
Merit: 4657



View Profile
June 09, 2014, 11:27:05 PM
 #3

The answer in this sub-forum is the same as it was in the other sub-forum where you asked the exact same question:

As far as I'm aware, you'd have to process the entire blockchain using commands such as getblockhash, getblock, and getrawtransaction to search for any and all unspent transaction outputs associated with the address you are interested in.  Then you'd have to add up all the unspent outputs to arrive at a total balance.

To avoid having to repeatedly scan the entire blockchain, you'd probably be better off scanning it once and building a database table with the complete UTXO set.  Then you'd want to use blocknotify to update your UTXO table everytime a new block is created.  That way you could just query your UTXO table to find address balances.
JimmyGre (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
June 09, 2014, 11:45:48 PM
 #4

The answer in this sub-forum is the same as it was in the other sub-forum where you asked the exact same question:

As far as I'm aware, you'd have to process the entire blockchain using commands such as getblockhash, getblock, and getrawtransaction to search for any and all unspent transaction outputs associated with the address you are interested in.  Then you'd have to add up all the unspent outputs to arrive at a total balance.

To avoid having to repeatedly scan the entire blockchain, you'd probably be better off scanning it once and building a database table with the complete UTXO set.  Then you'd want to use blocknotify to update your UTXO table everytime a new block is created.  That way you could just query your UTXO table to find address balances.

Ye putting here just I hope more people could see this quesion.
This is a good way. Thank you. But would like to hear some more solutions.
Thanks~
J
rapport
Full Member
***
Offline Offline

Activity: 157
Merit: 100


View Profile
June 12, 2014, 11:15:17 PM
 #5

The answer in this sub-forum is the same as it was in the other sub-forum where you asked the exact same question:

As far as I'm aware, you'd have to process the entire blockchain using commands such as getblockhash, getblock, and getrawtransaction to search for any and all unspent transaction outputs associated with the address you are interested in.  Then you'd have to add up all the unspent outputs to arrive at a total balance.

To avoid having to repeatedly scan the entire blockchain, you'd probably be better off scanning it once and building a database table with the complete UTXO set.  Then you'd want to use blocknotify to update your UTXO table everytime a new block is created.  That way you could just query your UTXO table to find address balances.

Ye putting here just I hope more people could see this quesion.
This is a good way. Thank you. But would like to hear some more solutions.
Thanks~
J

If you have some familiarity with NodeJS, check https://github.com/bitpay/insight  It will take time the first time (as it builds indexes) but after that you can make such queries easily.
(edit: more clarity)
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!