Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/chainparams/make_chainparams.py
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | def get_chainparams(rpc_caller, block): | ||||
# exception if not. | # exception if not. | ||||
rpc_caller.getblockheader(block) | rpc_caller.getblockheader(block) | ||||
return (chainwork, block) | return (chainwork, block) | ||||
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{}".format(blockhash, chainwork) | ||||
return output | return output | ||||
if __name__ == "__main__": | if __name__ == "__main__": | ||||
parser = argparse.ArgumentParser(description=( | parser = argparse.ArgumentParser(description=( | ||||
"Make chainparams file.\n" | "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) | ||||
Show All 40 Lines |