What's the easiest way to calculate the median size of the last 100 blocks programmatically?
I have tried using monerod and the print_block
and print_bc
commands but neither shows the block size directly.
What's the easiest way to calculate the median size of the last 100 blocks programmatically?
I have tried using monerod and the print_block
and print_bc
commands but neither shows the block size directly.
If you have a recent enough daemon, you can run the bc_dyn_stats 100
command, which will include the median block size over the last 100 blocks, among other things.
If you have a recent, but not so recent daemon, you can try the getinfo RPC call, which includes the current block size limit, which is twice the last 100 blocks median:
curl -v -X POST http://127.0.0.1:18081/getinfo -d '{}' -H 'Content-Type: application/json'
bc_dyn_stats
is unknown and the curl thingy doesn't seem to contain the block size limit (it's got: alt_blocks_count, cumulative_difficulty, difficulty, grey_peerlist_size, height, incoming_connections_count, outgoing_connections_count, status, target, target_height, testnet, top_block_hash, tx_count, tx_pool_size, white_peerlist_size)
– assylias
Jan 18 '17 at 9:55