예제 #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()
예제 #2
0
def _on_event_callback(node: Node, info: NodeEventInfo, payload: dict):
    """Event callback.
    
    """
    utils.log_line()

    for label, data in (
        ("Event Emitter", info.node_address),
        ("Event ID", info.event_id),
        ("Event Type", info.event_type.name[6:]),
        ("Event Timestamp", info.event_timestamp.isoformat()),
    ):
        print(f"{label.ljust(20)}: {data}")

    print(json.dumps(payload, indent=4))
예제 #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:
        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()
예제 #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:
        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()
예제 #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:
        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()