scanblocks

Back to blockchain

Summary

Return relevant blockhashes for given descriptors (requires blockfilterindex).

Description

Return relevant blockhashes for given descriptors (requires blockfilterindex). This call may take several minutes. Make sure to use no RPC timeout (qbit-cli -rpcclienttimeout=0)

Arguments

  • action (STR, required): The action to execute "start" for starting a scan "abort" for aborting the current scan (returns true when abort was successful) "status" for progress report (in %) of the current scan
  • scanobjects (ARR): Array of scan objects. Required for "start" action Every scan object is either a string descriptor or an object:
  • descriptor (STR): An output descriptor
  • value (OBJ): An object with output descriptor and metadata
    • desc (STR, required): An output descriptor
    • range (RANGE): The range of HD chain indexes to explore (either end or [begin,end])
  • start_height (NUM): Height to start to scan from
  • stop_height (NUM): Height to stop to scan
  • filtertype (STR): The type name of the filter
  • options (OBJ_NAMED_PARAMS): No description.
  • filter_false_positives (BOOL): Filter false positives (slower and may fail on pruned nodes). Otherwise they may occur at a rate of 1/M

Results

  • value (NONE): No description.
  • value (OBJ): No description.
  • from_height (NUM): The height we started the scan from
  • to_height (NUM): The height we ended the scan at
  • relevant_blocks (ARR): Blocks that may have matched a scanobject.
    • blockhash (STR_HEX): A relevant blockhash
  • completed (BOOL): true if the scan process was not aborted
  • value (OBJ): No description.
  • progress (NUM): Approximate percent complete
  • current_height (NUM): Height of the block currently being scanned
  • success (BOOL): True if scan will be aborted (not necessarily before this RPC returns), or false if there is no scan to abort

Examples

qbit-cli scanblocks start '["addr(qbrt1zqqqsyqcyq5rqwzqfpg9scrgwpugpzysnzs23v9ccrydpk8qarc0s8kqqny)"]' 300000
qbit-cli scanblocks start '["addr(qbrt1zqqqsyqcyq5rqwzqfpg9scrgwpugpzysnzs23v9ccrydpk8qarc0s8kqqny)"]' 100 150 basic
qbit-cli scanblocks status
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "scanblocks", "params": ["start", ["addr(qbrt1zqqqsyqcyq5rqwzqfpg9scrgwpugpzysnzs23v9ccrydpk8qarc0s8kqqny)"], 300000]}' -H 'content-type: application/json' http://127.0.0.1:8352/
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "scanblocks", "params": ["start", ["addr(qbrt1zqqqsyqcyq5rqwzqfpg9scrgwpugpzysnzs23v9ccrydpk8qarc0s8kqqny)"], 100, 150, "basic"]}' -H 'content-type: application/json' http://127.0.0.1:8352/
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "scanblocks", "params": ["status"]}' -H 'content-type: application/json' http://127.0.0.1:8352/