waitforblockheight

Back to blockchain

Summary

Waits for (at least) block height and returns the height and hash

Description

Waits for (at least) block height and returns the height and hash of the current tip.

Returns the current block on timeout or exit.

Make sure to use no RPC timeout (qbit-cli -rpcclienttimeout=0)

Arguments

  • height (NUM, required): Block height to wait for.
  • timeout (NUM): Time in milliseconds to wait for a response. 0 indicates no timeout.

Results

  • value (OBJ): No description.
  • hash (STR_HEX): The blockhash
  • height (NUM): Block height

Examples

qbit-cli waitforblockheight 100 1000
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "waitforblockheight", "params": [100, 1000]}' -H 'content-type: application/json' http://127.0.0.1:8352/