def main(args): """Entry point. :param args: Parsed CLI arguments. """ if args.node: _, node = get_network_node(args) nodeset = [node] else: _, nodeset = get_network_nodeset(args) for node in nodeset: utils.log_line() utils.log( f"VALIDATOR ACCOUNT KEYS @ NODE {node.index} ({node.address}) :") utils.log( f"NETWORK: {node.network} :: validator account-hash = {node.account.account_hash}" ) utils.log( f"NETWORK: {node.network} :: validator account-id = {node.account.account_key}" ) utils.log( f"NETWORK: {node.network} :: validator private-key = {node.account.private_key}" ) utils.log( f"NETWORK: {node.network} :: validator public-key = {node.account.public_key}" ) utils.log_line()
def main(args): """Entry point. :param args: Parsed CLI arguments. """ network, node = get_network_node(args) purse_uref = chain.get_account_main_purse_uref(network, node, network.faucet.account_key) balance = chain.get_account_balance(network, node, purse_uref) utils.log(f"FAUCET ACCOUNT BALANCE = {balance or 'N/A'}")
def main(args): """Entry point. :param args: Parsed CLI arguments. """ network, node = get_network_node(args) purse_uref = chain.get_account_main_purse_uref(network, node, args.account_key) utils.log(f"ACCOUNT MAIN PURSE UREF = {purse_uref or 'N/A'}")
def main(args): """Entry point. :param args: Parsed CLI arguments. """ network, node = get_network_node(args) deploy = chain.get_deploy(network, node, args.deploy_hash) if deploy: print(json.dumps(deploy, indent=4)) else: print("Chain query returned null - is the deploy hash correct ?")
def main(args): """Entry point. :param args: Parsed CLI arguments. """ network, node = get_network_node(args) account = chain.get_account(network, node, network.faucet.account_key) if account: print(json.dumps(account, indent=4)) else: print("Chain query returned null - is the faucet correct ?")
def main(args): """Entry point. :param args: Parsed CLI arguments. """ network, node = get_network_node(args) block = chain.get_block(network, node, args.block_hash) if block: print(json.dumps(block, indent=4)) else: print("Chain query returned null - is the block hash correct ?")
def main(args): """Entry point. :param args: Parsed CLI arguments. """ network, node = get_network_node(args) auction_info = chain.get_auction_info(network, node) if auction_info: print(json.dumps(auction_info, indent=4)) else: print( "Chain query returned null - is the auction contract correctly installed ?" )
def main(args): """Entry point. :param args: Parsed CLI arguments. """ if args.node: network, node = get_network_node(args) nodeset = [node] else: network, nodeset = get_network_nodeset(args) for node in nodeset: purse_uref = chain.get_account_main_purse_uref(network, node, node.account.account_key) balance = chain.get_account_balance(network, node, purse_uref) utils.log(f"VALIDATOR ACCOUNT BALANCE @ NODE #{node.index} ({node.address}) = {balance or 'N/A'}")
def main(args): """Entry point. :param args: Parsed CLI arguments. """ def _filter(node: Node, info: NodeEventInfo, payload: dict): """Applies a filter to incoming events. """ if args.event_type == "*" or \ info.event_type.name == f"MONIT_{args.event_type.upper().replace('-', '_')}": _on_event_callback(node, info, payload) _, node = get_network_node(args) chain.stream_events(node, _filter, args.event_id)
def main(args): """Entry point. :param args: Parsed CLI arguments. """ utils.log(f"Executing `systemctl {args.command}`:") _, node = get_network_node(args) remote_node_systemctl( node=node, ssh_user=args.ssh_user, command=args.command, ssh_key_path=args.ssh_key_path, check_rc=False, )
def main(args): """Entry point. :param args: Parsed CLI arguments. """ if args.node: network, node = get_network_node(args) nodeset = [node] else: network, nodeset = get_network_nodeset(args) for node in nodeset: state_root_hash = chain.get_state_root_hash(network, node, args.block_hash) utils.log( f"STATE ROOT HASH @ {node.address_rpc} = {state_root_hash or 'N/A'}" )
def main(args): """Entry point. :param args: Parsed CLI arguments. """ if args.node: network, node = get_network_node(args) nodeset = [node] else: network, nodeset = get_network_nodeset(args) for node in nodeset: utils.log_line() utils.log(f"NODE METRICS @ NODE {node.index} :: {node.address_rpc}:") for metric in chain.get_node_metrics(network, node).split("\n"): if args.metric == "*" or metric.startswith(args.metric): print(metric) utils.log_line()
def main(args): """Entry point. :param args: Parsed CLI arguments. """ if args.node: network, node = get_network_node(args) nodeset = [node] else: network, nodeset = get_network_nodeset(args) for node in nodeset: try: block = chain.get_block(network, node) except: utils.log(f"ERA::HEIGHT @ {node.address_rpc} = N/A") else: utils.log( f"ERA:HEIGHT @ {node.address_rpc} = {block['header']['era_id']}:{block['header']['height']}" )
def main(args): """Entry point. :param args: Parsed CLI arguments. """ if args.node: network, node = get_network_node(args) nodeset = [node] else: network, nodeset = get_network_nodeset(args) for node in nodeset: info = chain.get_node_peers(network, node) if info: utils.log_line() utils.log(f"NODE PEERS @ {node.address_rpc}:") print(json.dumps(info, indent=4)) else: utils.log("Node peers query failed.") utils.log_line()
def main(args): """Entry point. :param args: Parsed CLI arguments. """ if args.node: network, node = get_network_node(args) nodeset = [node] else: network, nodeset = get_network_nodeset(args) for node in nodeset: block = chain.get_block(network, node) try: era_id = block['header']['era_id'] except: era_id = "N/A" try: height = block['header']['height'] except: height = "N/A" utils.log(f"ERA::HEIGHT @ {node.address_rpc} = {era_id}::{height}")
def main(args): """Entry point. :param args: Parsed CLI arguments. """ if args.node: network, node = get_network_node(args) nodeset = [node] else: network, nodeset = get_network_nodeset(args) for node in nodeset: utils.log_line() utils.log(f"VALIDATOR ACCOUNT @ NODE {node.index} ({node.address}) :") account = chain.get_account(network, node, node.account.account_key) if account: print(json.dumps(account, indent=4)) else: print( "Chain query returned null - is the validator account correct ?" ) utils.log_line()