From 28e72a8f05dfebbaf94faed84420719b13aed5bb Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 13 Mar 2021 16:49:05 +0000 Subject: [PATCH] mmgen-blocks-info: move opts_data --- mmnode-blocks-info | 66 +++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/mmnode-blocks-info b/mmnode-blocks-info index a34d6fa..dbb7ed8 100755 --- a/mmnode-blocks-info +++ b/mmnode-blocks-info @@ -25,39 +25,6 @@ from collections import namedtuple from mmgen.common import * from decimal import Decimal -opts_data = { - 'sets': [ - ('raw_miner_info',True,'miner_info',True), - ('summary',True,'raw_miner_info',False), - ('summary',True,'miner_info',False) - ], - 'text': { - 'desc': 'Display information about a range of blocks', - 'usage': '[opts] +||', - 'options': """ --h, --help Print this help message ---, --longhelp Print help message for long options (common options) --H, --hashes Display only block numbers and hashes --m, --miner-info Display miner info in coinbase transaction --M, --raw-miner-info Display miner info in uninterpreted form --n, --no-header Don't print the column header --o, --fields= Display the specified fields --s, --summary Print the summary only --S, --no-summary Don't print the summary -""", - 'notes': """ -If no block number is specified, the current block is assumed. - -In addition to information about the requested range of blocks, an estimate -of the next difficulty adjustment is also displayed based on the average -Block Discovery Interval from the beginning of the current 2016-block period -to the chain tip. - -Requires --txindex for correct operation. -""" - } -} - class local_vars: pass class BlocksInfo: @@ -308,6 +275,39 @@ class BlocksInfoHashes(BlocksInfo): hashes = await c.gathered_call('getblockhash',[(height,) for height in heights]) Msg('\n'.join('{:<7} {}'.format(height,H) for height,H in zip(heights,hashes))) +opts_data = { + 'sets': [ + ('raw_miner_info',True,'miner_info',True), + ('summary',True,'raw_miner_info',False), + ('summary',True,'miner_info',False) + ], + 'text': { + 'desc': 'Display information about a range of blocks', + 'usage': '[opts] +||', + 'options': """ +-h, --help Print this help message +--, --longhelp Print help message for long options (common options) +-H, --hashes Display only block numbers and hashes +-m, --miner-info Display miner info in coinbase transaction +-M, --raw-miner-info Display miner info in uninterpreted form +-n, --no-header Don't print the column header +-o, --fields= Display the specified fields +-s, --summary Print the summary only +-S, --no-summary Don't print the summary +""", + 'notes': """ +If no block number is specified, the current block is assumed. + +In addition to information about the requested range of blocks, an estimate +of the next difficulty adjustment is also displayed based on the average +Block Discovery Interval from the beginning of the current 2016-block period +to the chain tip. + +Requires --txindex for correct operation. +""" + } +} + cmd_args = opts.init(opts_data) if len(cmd_args) not in (0,1):