Language

Choose a language

/build/rpc / reorg

getreorgadvisories

getreorgadvisories ( count ) Returns recent reorg advisory data. Reorg advisories are generated when the node detects a chain reorganization deeper than 3 blocks, providing metrics to help assess the event. Arguments: 1. count (numeric, optional, default=10) Number of recent advisories to return (max 100) Result: { (json object) "total_stored" : n, (numeric) Total number of advisories in memory "advisories" : [ (json array) Recent reorg advisories (newest first) { (json object) "valid" : true|false, (boolean) Whether advisory data is complete "lca_height" : n, (numeric) Height of the last common ancestor "depth_current" : n, (numeric) Reorg depth on the current chain "depth_fork" : n, (numeric) Reorg depth on the fork chain "tx_overlap_pct" : n, (numeric) Transaction overlap percentage (Jaccard index) "first_block_delay_secs" : n, (numeric) Delay (seconds) before first fork block was seen "hashrate_current_pct" : n, (numeric) Estimated hashrate on current segment as % of baseline "hashrate_fork_pct" : n, (numeric) Estimated hashrate on fork segment as % of baseline "since_last_block_secs" : n, (numeric) Seconds since last block was seen at advisory time "calibration" : { (json object) Tick-to-time calibration data "valid" : true|false, (boolean) Whether calibration succeeded "sec_per_tick" : n, (numeric) Seconds per VDF tick "baseline_hashrate" : n, (numeric) Baseline network hashrate "window_blocks" : n, (numeric) Number of blocks used for calibration "invalid_reason" : "str" (string, optional) Reason if calibration failed }, "segment_current" : { (json object) Statistics for current chain segment "block_count" : n, (numeric) Number of blocks "ticks_diff" : n, (numeric) VDF tick difference "clock_time_secs" : n, (numeric) Wall-clock time in seconds "miner_time_secs" : n, (numeric) Miner-reported time in seconds "tx_count" : n, (numeric) Number of non-coinbase transactions "blocks_read" : n, (numeric) Blocks successfully read for txids "blocks_pruned" : n, (numeric) Blocks that couldn't be read "txids_capped" : true|false, (boolean) Whether txid collection was limited "data_complete" : true|false (boolean) Whether all required data was available }, "segment_fork" : { (json object) Statistics for fork chain segment "block_count" : n, (numeric) Number of blocks "ticks_diff" : n, (numeric) VDF tick difference "clock_time_secs" : n, (numeric) Wall-clock time in seconds "miner_time_secs" : n, (numeric) Miner-reported time in seconds "tx_count" : n, (numeric) Number of non-coinbase transactions "blocks_read" : n, (numeric) Blocks successfully read for txids "blocks_pruned" : n, (numeric) Blocks that couldn't be read "txids_capped" : true|false, (boolean) Whether txid collection was limited "data_complete" : true|false (boolean) Whether all required data was available } }, ... ] } Examples: > bitcoin-cli getreorgadvisories > bitcoin-cli getreorgadvisories 5 > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getreorgadvisories", "params": [10]}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

getreorgadvisories(count?: number) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"getreorgadvisories","params":[10]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
countnumberNumber of recent advisories to return (max 100)

Result

Type:  any

{ (json object) "total_stored" : n, (numeric) Total number of advisories in memory "advisories" : [ (json array) Recent reorg advisories (newest first) { (json object) "valid" : true|false, (boolean) Whether advisory data is complete "lca_height" : n, (numeric) Height of the last common ancestor "depth_current" : n, (numeric) Reorg depth on the current chain "depth_fork" : n, (numeric) Reorg depth on the fork chain "tx_overlap_pct" : n, (numeric) Transaction overlap percentage (Jaccard index) "first_block_delay_secs" : n, (numeric) Delay (seconds) before first fork block was seen "hashrate_current_pct" : n, (numeric) Estimated hashrate on current segment as % of baseline "hashrate_fork_pct" : n, (numeric) Estimated hashrate on fork segment as % of baseline "since_last_block_secs" : n, (numeric) Seconds since last block was seen at advisory time "calibration" : { (json object) Tick-to-time calibration data "valid" : true|false, (boolean) Whether calibration succeeded "sec_per_tick" : n, (numeric) Seconds per VDF tick "baseline_hashrate" : n, (numeric) Baseline network hashrate "window_blocks" : n, (numeric) Number of blocks used for calibration "invalid_reason" : "str" (string, optional) Reason if calibration failed }, "segment_current" : { (json object) Statistics for current chain segment "block_count" : n, (numeric) Number of blocks "ticks_diff" : n, (numeric) VDF tick difference "clock_time_secs" : n, (numeric) Wall-clock time in seconds "miner_time_secs" : n, (numeric) Miner-reported time in seconds "tx_count" : n, (numeric) Number of non-coinbase transactions "blocks_read" : n, (numeric) Blocks successfully read for txids "blocks_pruned" : n, (numeric) Blocks that couldn't be read "txids_capped" : true|false, (boolean) Whether txid collection was limited "data_complete" : true|false (boolean) Whether all required data was available }, "segment_fork" : { (json object) Statistics for fork chain segment "block_count" : n, (numeric) Number of blocks "ticks_diff" : n, (numeric) VDF tick difference "clock_time_secs" : n, (numeric) Wall-clock time in seconds "miner_time_secs" : n, (numeric) Miner-reported time in seconds "tx_count" : n, (numeric) Number of non-coinbase transactions "blocks_read" : n, (numeric) Blocks successfully read for txids "blocks_pruned" : n, (numeric) Blocks that couldn't be read "txids_capped" : true|false, (boolean) Whether txid collection was limited "data_complete" : true|false (boolean) Whether all required data was available } }, ... ] }

Source: services/core-node/bcore/src/rpc/blockchain.cpp:3401

C++ symbol: getreorgadvisories