Пример #1
0
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.

    """
    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'}")
Пример #3
0
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'}"
        )
Пример #4
0
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()
Пример #5
0
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']}"
            )
Пример #6
0
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()
Пример #7
0
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}")
Пример #8
0
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()