Author

Topic: Get balance of *coin addresses (Read 949 times)

full member
Activity: 148
Merit: 100
Crazy!
May 05, 2013, 10:59:37 AM
#9
Yep :/
I'm currently importing the whole blockchain to a mongodb database so I can easily query it (currently only at block 5000).
I don't know how I will deal with blockchain rewrites (maybe by occasionaly deleting/reimporting last weeks blocks and transactions for example).
My concern now is how will I get the balance of a say address by querying the transactions... I would hate having caches in this situation, because of the "moving" past.
I guess I will query all "vout" transactions to the address, then query for all "vin" transactions referencing a previously returned "vout" transaction, right?
newbie
Activity: 28
Merit: 0
full member
Activity: 148
Merit: 100
Crazy!
May 05, 2013, 04:55:25 AM
#7
dammit, bitcoind documentation sucks!
even with -txindex=1 -reindex=1 :
gettransaction 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b (the first transaction ever in bitcoin history): Invalid or non-wallet transaction id!
getrawtransaction on it fails too

gettransaction fails on any non wallet transaction
on other transactions I tested, getrawtransaction works fine, but need another call to decoderawtransaction to get the readable data (basically what getransaction would do in a single call).
I guess this could do the job however.

Other problem: how to handle blockchains (temporary) forks? (like the one in march)? How to be notified by the bitcoind that the history has changed since block xxx?
newbie
Activity: 28
Merit: 0
May 05, 2013, 04:35:18 AM
#6
I'm not sure about that, but I think you have to run bitcoind with -txindex option set.
full member
Activity: 148
Merit: 100
Crazy!
May 05, 2013, 01:51:15 AM
#5
OK, getblock does the job to list transactions included in the wallet. But how can I get the details for each of those transactions?
You are right, gettransaction/getrawtransaction are only for the transactions concerning the wallet, despite the man page not saying it (https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list).
I see no way to get the details of a given transaction through bitcoind...
newbie
Activity: 28
Merit: 0
May 04, 2013, 05:33:35 PM
#4
Yes, this seems to be great!
What I don't understand, is how do I get the list of transactions included in the block (listsinceblock returns an empty transaction array, which seems odd, right?).
Then I guess I could use massive "gettransaction" calls to reconstitute the graph of the transactions.

listsinceblock return transactions concerning addresses in your wallet. The same goes for gettransaction. Try getblock.
full member
Activity: 148
Merit: 100
Crazy!
May 04, 2013, 02:27:48 PM
#3
Yes, this seems to be great!
What I don't understand, is how do I get the list of transactions included in the block (listsinceblock returns an empty transaction array, which seems odd, right?).
Then I guess I could use massive "gettransaction" calls to reconstitute the graph of the transactions.
hero member
Activity: 728
Merit: 500
165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
May 04, 2013, 02:01:37 PM
#2
You may like: bitcoind -blocknotify=
full member
Activity: 148
Merit: 100
Crazy!
May 04, 2013, 01:54:01 PM
#1
Hello,
I'd like to do a multicurrency dashboard. BY multicurrency, I mean really the more altcoins possible.
My problem is to be able to check the balance of a user given address.
I understood it's not possible to get the balance of any address using only the "bitcoind like" program, so I'd like to index blockchains/transactions in a SQL database, so I can do the "getbalance" work myself.
My problem is : how could I get "real time" blocks and transactions to put them in the database preferentially using the bitcoind software provided with each altcoin?
Did someone already addressed this issue?

Ideally I'd like something like (todo ?) a webservice like blochain.info that works every altcoin.

Any help greatly appreciated.
Thanks.
Jump to: