Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/chainparams/make_chainparams.py
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
def main(args): | def main(args): | ||||
(chainwork, blockhash) = get_chainparams(args['rpc'], args['block']) | (chainwork, blockhash) = get_chainparams(args['rpc'], args['block']) | ||||
output = "{}\n{}\n".format(blockhash, chainwork) | output = "{}\n{}\n".format(blockhash, chainwork) | ||||
return output | return output | ||||
if __name__ == "__main__": | if __name__ == "__main__": | ||||
parser = argparse.ArgumentParser(description=( | parser = argparse.ArgumentParser(description=( | ||||
"Make chainparams file." | "Make chainparams file.\n" | ||||
"Prerequisites: RPC access to a bitcoind node.\n\n"), | "Prerequisites: RPC access to a bitcoind node.\n\n"), | ||||
formatter_class=argparse.RawTextHelpFormatter) | formatter_class=argparse.RawTextHelpFormatter) | ||||
parser.add_argument('--address', '-a', default="127.0.0.1:8332", | parser.add_argument('--address', '-a', default="127.0.0.1:8332", | ||||
help="Node address for making RPC calls.\n" | help="Node address for making RPC calls.\n" | ||||
"The chain (MainNet or TestNet) will be automatically detected.\n" | "The chain (MainNet or TestNet) will be automatically detected.\n" | ||||
"Default: '127.0.0.1:8332'") | "Default: '127.0.0.1:8332'") | ||||
parser.add_argument('--block', '-b', | parser.add_argument('--block', '-b', | ||||
help="The block hash or height to use for fetching chainparams.\n" | help="The block hash or height to use for fetching chainparams.\n" | ||||
Show All 34 Lines |