• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

dashd getbalance.

calnaughtonjnr

Active member
Foundation Member
Is it possible to get balance of a completely separate wallet address using the dashd getbalance command?
 
Thanks guys. I've got Abe set up and familiar with grep and sed (not so much awk). Do you use queries to get data from MySQL? I have searched and searched, and I just haven't been able to get this sorted.
 
Thanks guys. I've got Abe set up and familiar with grep and sed (not so much awk). Do you use queries to get data from MySQL? I have searched and searched, and I just haven't been able to get this sorted.

I don't use MySQL for this, Abe is much more convenient.

For the balance you don't even need sed or grep!

Random address (not mine):

Code:
curl http://<blockchain_server_ip>:<server_port>/chain/Dash/q/addressbalance/XoWy72yLNndvib94KFf9uPbHFagv6mHUfQ
returns the balance of that address directly.

If you still use the Darkcoin-Abe just replace "Dash" with "Darkcoin".
 
I don't use MySQL for this, Abe is much more convenient.

For the balance you don't even need sed or grep!

Random address (not mine):

Code:
curl http://<blockchain_server_ip>:<server_port>/chain/Dash/q/addressbalance/XoWy72yLNndvib94KFf9uPbHFagv6mHUfQ
returns the balance of that address directly.

If you still use the Darkcoin-Abe just replace "Dash" with "Darkcoin".

Thanks crowning. I used this

Code:
$ch=curl_init('http://<blockchain_server_ip>:<server_port>/chain/Dash/q/addressbalance/' . $);
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
        $result=@curl_exec($ch);
        curl_close($ch);

and it works perfectly!

I don't suppose you'd know how to get a list of transactions using your method? Received to address, sent from address?
 
I don't suppose you'd know how to get a list of transactions using your method? Received to address, sent from address?

Unfortunately there's no API call for this, but it's actually not difficult:
Code:
curl http://<IP>:<port>/address/XkkWjfBaSkB7WdAu6wJbQdwKk4cUeFVnXF 2>/dev/null | grep "class=\"tx\"" | sed 's/[\"..\/tx\/|#]/ /g' | awk '{print $10}'

Result:
47bb351deb0eb9e2059b508fc579faf5c5e9bb364e1a5dc587500dac49ed2f53
c730ed330ef04e2aacebae4b8e2a67396f92d8ef66e2721a7bc1b22817c5d4fb
c2112614879c0f9fdbfe9a2d0d20b8576c453db7f7c0fd5ea0d14770916c1465
9d3af63d0febc2d73b091c3265afb4fc95fc4a0155a93a3ef5f5fbdfefe5b7cf
9c7d0cb011b295b739fa2ddbf4e6c384e51ecaad8660761c30b95ad577bdfa78
f38658a76e9becaac22fb474c9425be4a99deafc79098aa848b906c2bfa7b2e3
9cd9cc747f6db7ed122738e2446db00088c22240a12b0fe3c3cd7007ce05212d
c91a2b763e8b5ce736745d6729dd04b4eb3402df2bf31c5c84d568d5c0b61a02
28a8d9774e785247e33b57baf5a99adfeb91857109a945ad8f35c432c2d2b95e
5df3731711e197c0fb09793ff93e76c17524558b65e95d379f22079236c238b9

Returns all transaction-IDs of this address for further investigation :smile:
 
Unfortunately there's no API call for this, but it's actually not difficult:
Code:
curl http://<IP>:<port>/address/XkkWjfBaSkB7WdAu6wJbQdwKk4cUeFVnXF 2>/dev/null | grep "class=\"tx\"" | sed 's/[\"..\/tx\/|#]/ /g' | awk '{print $10}'

Result:
47bb351deb0eb9e2059b508fc579faf5c5e9bb364e1a5dc587500dac49ed2f53
c730ed330ef04e2aacebae4b8e2a67396f92d8ef66e2721a7bc1b22817c5d4fb
c2112614879c0f9fdbfe9a2d0d20b8576c453db7f7c0fd5ea0d14770916c1465
9d3af63d0febc2d73b091c3265afb4fc95fc4a0155a93a3ef5f5fbdfefe5b7cf
9c7d0cb011b295b739fa2ddbf4e6c384e51ecaad8660761c30b95ad577bdfa78
f38658a76e9becaac22fb474c9425be4a99deafc79098aa848b906c2bfa7b2e3
9cd9cc747f6db7ed122738e2446db00088c22240a12b0fe3c3cd7007ce05212d
c91a2b763e8b5ce736745d6729dd04b4eb3402df2bf31c5c84d568d5c0b61a02
28a8d9774e785247e33b57baf5a99adfeb91857109a945ad8f35c432c2d2b95e
5df3731711e197c0fb09793ff93e76c17524558b65e95d379f22079236c238b9

Returns all transaction-IDs of this address for further investigation :smile:
Wow, that's great. Thanks so much. Would this still work on an address that had 1000+ transactions?

And please send me your Wallet address and let me send you a drink. :grin:
 
Wow, that's great. Thanks so much. Would this still work on an address that had 1000+ transactions?

And please send me your Wallet address and let me send you a drink. :grin:

Add "address-history-rows-max -1" to abe.conf and you get ALL transactions. But keep in mined that this can take a long time for 10000+ addresses, so I would never do this on a public blockchain explorer.

My donation address is in my signature :smile:
 
Last edited by a moderator:
Add "address-history-rows-max -1" to abe conf and you get ALL transactions. But keep in mined that this can take a long time for 10000+ addresses, so I would never do this on a public blockchain explorer.

My donation address is in my signature :smile:

Ahh, so it is. Was on mobile last night and thought you had no sig. Thanks for taking the time to help. Really appreciate it.
 
Ahh, so it is. Was on mobile last night and thought you had no sig. Thanks for taking the time to help. Really appreciate it.


Hey, that's 2 beers! Thanks a lot
smilie_drink3.gif
 
Back
Top