Пример #1
0
def get_block_with_proof(ledger_name, block_address, digest_tip_address):
    """
    Get the block of a ledger's journal. Also returns a proof of the block for verification.

    :type ledger_name: str
    :param ledger_name: Name of the ledger to operate on.

    :type block_address: dict
    :param block_address: The location of the block to request.

    :type digest_tip_address: dict
    :param digest_tip_address: The location of the digest tip.

    :rtype: dict
    :return: The response of the request.
    """
    logger.info(
        "Let's get the block for block address {}, digest tip address {}, for the ledger named {}."
        .format(block_address, digest_tip_address, ledger_name))
    result = qldb_client.get_block(Name=ledger_name,
                                   BlockAddress=block_address,
                                   DigestTipAddress=digest_tip_address)
    logger.info('Success. GetBlock: {}.'.format(
        block_response_to_string(result)))
    return result
Пример #2
0
def get_block(ledger_name, block_address):
    """
    Get the block of a ledger's journal.

    :type ledger_name: str
    :param ledger_name: Name of the ledger to operate on.

    :type block_address: dict
    :param block_address: The location of the block to request.

    :rtype: dict
    :return: The response of the request.
    """
    logger.info(
        "Let's get the block for block address {} of the ledger named {}.".
        format(block_address, ledger_name))
    result = qldb_client.get_block(Name=ledger_name,
                                   BlockAddress=block_address)
    logger.info('Success. GetBlock: {}'.format(
        block_response_to_string(result)))
    return result