Search in sources :

Example 6 with Payload

use of org.hyperledger.fabric.protos.common.Common.Payload in project fabric-sdk-java by hyperledger.

the class ProtoUtils method createSeekInfoEnvelope.

public static Envelope createSeekInfoEnvelope(TransactionContext transactionContext, SeekInfo seekInfo, byte[] tlsCertHash) throws CryptoException {
    ChannelHeader seekInfoHeader = createChannelHeader(Common.HeaderType.DELIVER_SEEK_INFO, transactionContext.getTxID(), transactionContext.getChannelID(), transactionContext.getEpoch(), transactionContext.getFabricTimestamp(), null, tlsCertHash);
    SignatureHeader signatureHeader = SignatureHeader.newBuilder().setCreator(transactionContext.getIdentity().toByteString()).setNonce(transactionContext.getNonce()).build();
    Common.Header seekHeader = Common.Header.newBuilder().setSignatureHeader(signatureHeader.toByteString()).setChannelHeader(seekInfoHeader.toByteString()).build();
    Payload seekPayload = Payload.newBuilder().setHeader(seekHeader).setData(seekInfo.toByteString()).build();
    return Envelope.newBuilder().setSignature(transactionContext.signByteString(seekPayload.toByteArray())).setPayload(seekPayload.toByteString()).build();
}
Also used : ChannelHeader(org.hyperledger.fabric.protos.common.Common.ChannelHeader) SignatureHeader(org.hyperledger.fabric.protos.common.Common.SignatureHeader) Payload(org.hyperledger.fabric.protos.common.Common.Payload) Common(org.hyperledger.fabric.protos.common.Common)

Aggregations

Payload (org.hyperledger.fabric.protos.common.Common.Payload)6 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)5 StatusRuntimeException (io.grpc.StatusRuntimeException)5 IOException (java.io.IOException)5 ExecutionException (java.util.concurrent.ExecutionException)5 TimeoutException (java.util.concurrent.TimeoutException)5 Envelope (org.hyperledger.fabric.protos.common.Common.Envelope)5 ConfigEnvelope (org.hyperledger.fabric.protos.common.Configtx.ConfigEnvelope)5 ConfigUpdateEnvelope (org.hyperledger.fabric.protos.common.Configtx.ConfigUpdateEnvelope)5 CryptoException (org.hyperledger.fabric.sdk.exception.CryptoException)5 EventHubException (org.hyperledger.fabric.sdk.exception.EventHubException)5 InvalidArgumentException (org.hyperledger.fabric.sdk.exception.InvalidArgumentException)5 ProposalException (org.hyperledger.fabric.sdk.exception.ProposalException)5 TransactionEventException (org.hyperledger.fabric.sdk.exception.TransactionEventException)5 TransactionException (org.hyperledger.fabric.sdk.exception.TransactionException)5 ProtoUtils.createSeekInfoEnvelope (org.hyperledger.fabric.sdk.transaction.ProtoUtils.createSeekInfoEnvelope)5 Block (org.hyperledger.fabric.protos.common.Common.Block)4 ByteString (com.google.protobuf.ByteString)3 ChannelHeader (org.hyperledger.fabric.protos.common.Common.ChannelHeader)3 ProtoUtils.getSignatureHeaderAsByteString (org.hyperledger.fabric.sdk.transaction.ProtoUtils.getSignatureHeaderAsByteString)2