import logging


def print_bestblockhash(node, nodeId):
    """ 
    Helper to print bestblockhash and block size
    Input:
        node : node to get the block information
        nodeId : Id of the mode
    Return:
        block_size : block size
        best_block_hash : hash of the best block (tip of the chain)
    """
    best_blockhash = node.getbestblockhash()
    block_size = node.getblock(best_blockhash, True)['size']
    best_blockhash = int(best_blockhash, 16)

    logging.info("> Node%d  block_size = %d"  %(nodeId, block_size))
    logging.info("> Blockhash = %s"  %best_blockhash)
    return block_size, best_blockhash