Author

Topic: Check address balance, get unspent TX, and broadcast thru bitcoind or bitcore (Read 291 times)

hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
It can take a number of seconds/minutes to return a response to scantxoutset...

To see the percentage progress of the "current" scan, you can use the following command from another shell:
Code:
./bitcoin-cli scantxoutset status

For example, the output:
Code:
{
  "progress": 13
}
shows us that the scan is 13% complete.

Yes, yesterday I replied here after I noticed that. It worked like I issued thhe command, but my message was deleted.

Thank you anyways.
HCP
legendary
Activity: 2086
Merit: 4361
It can take a number of seconds/minutes to return a response to scantxoutset...

To see the percentage progress of the "current" scan, you can use the following command from another shell:
Code:
./bitcoin-cli scantxoutset status

For example, the output:
Code:
{
  "progress": 13
}
shows us that the scan is 13% complete.
hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
Hello

Sorry to use the same thread but it's about the same command in a different context.
I'm trying to use the command scantxoutset but without examples it's a bit harder to grasp it's usage.
I'm using Bitcoin Core 0.20.1 (full node) under Debian Buster.

I want to check the  utxos in a given address. I tried the following:

Code:
./bitcoin-cli scantxoutset start "[\"addr(address_here)\"]"

but either the command is taking too long to return any output or I'm misusing.

Any help?
staff
Activity: 3458
Merit: 6793
Just writing some code
It turns out Invalid command is not the error for a non-existent RPC method. It's actually saying that scantxoutset does not recognize the action that was given.

This appears to just be a question of how to pass in these parameters into the Ruby code. Unfortunately I am not very familiar with Ruby.

Could you try this line for setting arguments:
Code:
arguments =  { 'action' => 'start', 'scanobjects' => [ 'addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)' ]  }
newbie
Activity: 13
Merit: 9
Code:
$ bitcoin-cli --version
Bitcoin Core RPC client version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65

I'm using bitcoin-cli through Ubuntu Linux subsystem and running bitcoin daemon through cmd.exe on Windows (can't seem to find the windows equivalent for bitcoin-cli for windows?)

I figure it will interface with the server running through main Windows, since it's on the same ports. I have 0.18.0 of Bitcoin Core on Windows.

staff
Activity: 3458
Merit: 6793
Just writing some code
btc.scantxoutset(arguments)  => BitcoinRPC::JSONRPCError: {"code"=>-8, "message"=>"Invalid command"}   Doesn't work...
That error means that the scantxoutset command doesn't exist in your version of Bitcoin Core. What version are you using?
newbie
Activity: 13
Merit: 9
Code:
bitcoin-cli scantxoutset start  "[\"addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)\"]"


That works (only when I enter it as a text JSON array) but I'm having issues with getting the JSON RPC request to succeed"

BitcoinRPC class from here (ruby): https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)

btc = BitcoinRPC.new("http://rpcuser:[email protected]:18332")

btc.getaddress    => "2NCixvAERq3eDt31jM7eYATGiHdTEcizQkj"     THIS WORKS

arguments =  { action: 'start', scanobjects: ["addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)"] }.to_json

btc.scantxoutset(arguments)  => BitcoinRPC::JSONRPCError: {"code"=>-8, "message"=>"Invalid command"}   Doesn't work...
staff
Activity: 3458
Merit: 6793
Just writing some code
Okay, having another issue actually.

Continually getting 500 errors when POSTing with method scantxoutset:



method: 'scantxoutset',
id: 'jsonrpc',
action: "start",
scanobjects: [
        "addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)",
        {
          "desc": "addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)",
          "range": 1000,
        }
    ]


also tried :     [
        {
          "desc": "addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)",
          "range": 1000,
        }
    ]

500 Errror and gives me the same text from the link you sent.

I'll keep testing but, I'd love if someone can point out the error
You've specified an address descriptor with a range, which is not valid.

Just do
Code:
["addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)"]
newbie
Activity: 13
Merit: 9
Okay, having another issue actually.

Continually getting 500 errors when POSTing with method scantxoutset:



method: 'scantxoutset',
id: 'jsonrpc',
action: "start",
scanobjects: [
        "addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)",
        {
          "desc": "addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)",
          "range": 1000,
        }
    ]


also tried :     [
        {
          "desc": "addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)",
          "range": 1000,
        }
    ]

and simply:

['addr(mfskMRWntcPYdDgTJRJdwzdKiiHJikfvH4)']
500 Errror and gives me the same text from the link you sent.

I'll keep testing but, I'd love if someone can point out the error
newbie
Activity: 13
Merit: 9
If you want just the UTXO(s) and don't care about an address's transaction history, you can use Bitcoin Core's scantxoutset command (available since 0.17.0) to scan just the UTXO set and retrieve the UTXOs for a given address or script. The command will also return you the total value of the UTXOs that it found for the address or script.

Once you have the UTXOs, you can get the full transactions if you have the transaction index enabled.


Thanks for the reply. I got my bitcoind server running in testnet on localhost:18332.

I'm figuring it out, but what would the url structure look like for the POST request to the RPC server for scantxoutset?'


Edit: got it, read the API reference. You POST localhost:18332 with { id: 'jsonrpc', method: 'scantxoutset', ....relevant_args } and basic auth with your rpcuser and rpc password from your bitcoin.conf. For anyone who ends up here.
staff
Activity: 3458
Merit: 6793
Just writing some code
If you want just the UTXO(s) and don't care about an address's transaction history, you can use Bitcoin Core's scantxoutset command (available since 0.17.0) to scan just the UTXO set and retrieve the UTXOs for a given address or script. The command will also return you the total value of the UTXOs that it found for the address or script.

Once you have the UTXOs, you can get the full transactions if you have the transaction index enabled.
newbie
Activity: 13
Merit: 9
I'm getting Cloudflare blocked by Blockcypher and chain.so's APIs.

I'm told there's no performant (milliseconds) method to retrieve address balance for an address in one's bitcoin core wallet, it'd take minutes. Is bitcore's node tools a viable option for balance retrieval, getting unspent tx's, and broadcasting?

Any any insight for similar support tools for litecoin?

bonus question: referrals to any non-cloudflare baring API's that hold BTC and/or LTC blockchain data are appreciated
Jump to: