use of com.amazonaws.services.qldb.model.GetBlockRequest in project amazon-qldb-dmv-sample-java by aws-samples.
the class GetBlock method getBlockWithProof.
public static GetBlockResult getBlockWithProof(String ledgerName, BlockAddress blockAddress, BlockAddress tipBlockAddress) {
log.info("Let's get the block for block address {}, digest tip address {}, for the ledger named {}.", blockAddress, tipBlockAddress, ledgerName);
try {
GetBlockRequest request = new GetBlockRequest().withName(ledgerName).withBlockAddress(new ValueHolder().withIonText(Constants.MAPPER.writeValueAsIonValue(blockAddress).toString())).withDigestTipAddress(new ValueHolder().withIonText(Constants.MAPPER.writeValueAsIonValue(tipBlockAddress).toString()));
GetBlockResult result = client.getBlock(request);
log.info("Success. GetBlock: {}.", QldbStringUtils.toUnredactedString(result));
return result;
} catch (IOException ioe) {
throw new IllegalStateException(ioe);
}
}
use of com.amazonaws.services.qldb.model.GetBlockRequest in project amazon-qldb-dmv-sample-java by aws-samples.
the class GetBlock method getBlock.
public static GetBlockResult getBlock(String ledgerName, BlockAddress blockAddress) {
log.info("Let's get the block for block address {} of the ledger named {}.", blockAddress, ledgerName);
try {
GetBlockRequest request = new GetBlockRequest().withName(ledgerName).withBlockAddress(new ValueHolder().withIonText(Constants.MAPPER.writeValueAsIonValue(blockAddress).toString()));
GetBlockResult result = client.getBlock(request);
log.info("Success. GetBlock: {}.", QldbStringUtils.toUnredactedString(result));
return result;
} catch (IOException ioe) {
throw new IllegalStateException(ioe);
}
}
Aggregations