package
3.0.0+incompatible
Repository: https://github.com/hyperledger/fabric.git
Documentation: pkg.go.dev
# Functions
ChannelHeader returns the *cb.ChannelHeader for a given *cb.Envelope.
ChannelID returns the Channel ID for a given *cb.Envelope.
CheckTxID checks that txid is equal to the Hash computed over the concatenation of nonce and creator.
ComputeTxID computes TxID as the Hash computed over the concatenation of nonce and creator.
ConfigUpdateEnvelopeAsSignedData returns the set of signatures for the ConfigUpdateEnvelope as SignedData or an error indicating why this was not possible.
CopyBlockMetadata copies metadata from one block into another.
CreateChaincodeProposal creates a proposal from given input.
CreateChaincodeProposalWithTransient creates a proposal from given input It returns the proposal and the transaction id associated to the proposal.
CreateChaincodeProposalWithTxIDAndTransient creates a proposal from given input.
CreateChaincodeProposalWithTxIDNonceAndTransient creates a proposal from given input.
CreateDeployProposalFromCDS returns a deploy proposal given a serialized identity and a ChaincodeDeploymentSpec.
CreateGetChaincodesProposal returns a GETCHAINCODES proposal given a serialized identity.
CreateGetInstalledChaincodesProposal returns a GETINSTALLEDCHAINCODES proposal given a serialized identity.
CreateInstallProposalFromCDS returns a install proposal given a serialized identity and a ChaincodeDeploymentSpec.
CreateNonce generates a nonce using the common/crypto package.
CreateNonceOrPanic generates a nonce using the common/crypto package and panics if this operation fails.
CreateProposalFromCIS returns a proposal given a serialized identity and a ChaincodeInvocationSpec.
CreateProposalFromCISAndTxid returns a proposal given a serialized identity and a ChaincodeInvocationSpec.
CreateProposalResponse creates a proposal response.
CreateProposalResponseFailure creates a proposal response for cases where endorsement proposal fails either due to a endorsement failure or a chaincode failure (chaincode response status >= shim.ERRORTHRESHOLD).
CreateSignedEnvelope creates a signed envelope of the desired type, with marshaled dataMsg and signs it.
CreateSignedEnvelopeWithTLSBinding creates a signed envelope of the desired type, with marshaled dataMsg and signs it.
CreateSignedTx assembles an Envelope message from proposal, endorsements, and a signer.
CreateUpgradeProposalFromCDS returns a upgrade proposal given a serialized identity and a ChaincodeDeploymentSpec.
EnvelopeAsSignedData returns the signatures for the Envelope as SignedData slice of length 1 or an error indicating why this was not possible.
EnvelopeToConfigUpdate is used to extract a ConfigUpdateEnvelope from an envelope of type CONFIG_UPDATE.
ExtractEnvelope retrieves the requested envelope from a given block and unmarshals it.
ExtractEnvelopeOrPanic retrieves the requested envelope from a given block and unmarshals it -- it panics if either of these operations fail.
GetActionFromEnvelope extracts a ChaincodeAction message from a serialized Envelope TODO: fix function name as per FAB-11831.
GetBytesChaincodeActionPayload get the bytes of ChaincodeActionPayload from the message.
GetBytesChaincodeEvent gets the bytes of ChaincodeEvent.
GetBytesChaincodeProposalPayload gets the chaincode proposal payload.
GetBytesEnvelope get the bytes of Envelope from the message.
GetBytesHeader get the bytes of Header from the message.
GetBytesPayload get the bytes of Payload from the message.
GetBytesProposalPayloadForTx takes a ChaincodeProposalPayload and returns its serialized version according to the visibility field.
GetBytesProposalResponse gets proposal bytes response.
GetBytesProposalResponsePayload gets proposal response payload.
GetBytesResponse gets the bytes of Response.
GetBytesSignatureHeader get the bytes of SignatureHeader from the message.
GetBytesTransaction get the bytes of Transaction from the message.
GetChannelIDFromBlock returns channel ID in the block.
GetChannelIDFromBlockBytes returns channel ID given byte array which represents the block.
GetConsenterMetadataFromBlock attempts to retrieve consenter metadata from the value stored in block metadata at index SIGNATURES (first field).
GetEnvelopeFromBlock gets an envelope from a block's Data field.
GetLastConfigIndexFromBlock retrieves the index of the last config block as encoded in the block metadata.
GetLastConfigIndexFromBlockOrPanic retrieves the index of the last config block as encoded in the block metadata, or panics on error.
GetMetadataFromBlock retrieves metadata at the specified index.
GetMetadataFromBlockOrPanic retrieves metadata at the specified index, or panics on error.
GetOrComputeTxIDFromEnvelope gets the txID present in a given transaction envelope.
GetPayloads gets the underlying payload objects in a TransactionAction.
GetProposalHash1 gets the proposal hash bytes after sanitizing the chaincode proposal payload according to the rules of visibility.
GetProposalHash2 gets the proposal hash - this version is called by the committer where the visibility policy has already been enforced and so we already get what we have to get in ccPropPayl.
GetSignedProposal returns a signed proposal given a Proposal message and a signing identity.
InitBlockMetadata initializes metadata structure.
InvokedChaincodeName takes the proposal bytes of a SignedProposal, and unpacks it all the way down, until either an error is encountered, or the chaincode name is found.
IsConfigBlock validates whenever given block contains configuration update transaction.
LogMessageForSerializedIdentity returns a string with serialized identity information, or a string indicating why the serialized identity information cannot be returned.
MakeChannelHeader creates a ChannelHeader.
MakePayloadHeader creates a Payload Header.
MakeSignatureHeader creates a SignatureHeader.
Marshal serializes a protobuf message.
MarshalOrPanic serializes a protobuf message and panics if this operation fails.
MockSignedEndorserProposalOrPanic creates a SignedProposal with the passed arguments.
NewBlock constructs a block with no data and no metadata.
NewSignatureHeader returns a SignatureHeader with a valid nonce.
NewSignatureHeaderOrPanic returns a signature header and panics on error.
SetTxID generates a transaction id based on the provided signature header and sets the TxId field in the channel header.
SignOrPanic signs a message and panics on error.
UnmarshalBlock unmarshals bytes to a Block.
UnmarshalBlockOrPanic unmarshals bytes to an Block or panics on error.
UnmarshalChaincodeAction unmarshals bytes to a ChaincodeAction.
UnmarshalChaincodeActionPayload unmarshals bytes to a ChaincodeActionPayload.
UnmarshalChaincodeDeploymentSpec unmarshals bytes to a ChaincodeDeploymentSpec.
UnmarshalChaincodeEvents unmarshals bytes to a ChaincodeEvent.
UnmarshalChaincodeHeaderExtension unmarshals bytes to a ChaincodeHeaderExtension.
UnmarshalChaincodeID unmarshals bytes to a ChaincodeID.
UnmarshalChaincodeInvocationSpec unmarshals bytes to a ChaincodeInvocationSpec.
UnmarshalChaincodeProposalPayload unmarshals bytes to a ChaincodeProposalPayload.
UnmarshalChannelHeader unmarshals bytes to a ChannelHeader.
UnmarshalChannelHeaderOrPanic unmarshals bytes to a ChannelHeader or panics on error.
UnmarshalConfigEnvelope unmarshals bytes to a ConfigEnvelope.
UnmarshalEnvelope unmarshals bytes to a Envelope.
UnmarshalEnvelopeOfType unmarshals an envelope of the specified type, including unmarshalling the payload data.
UnmarshalEnvelopeOrPanic unmarshals bytes to an Envelope structure or panics on error.
UnmarshalHashedRWSet unmarshals bytes to a HashedRWSet.
UnmarshalHeader unmarshals bytes to a Header.
UnmarshalIdentifierHeader unmarshals bytes to an IdentifierHeader.
UnmarshalKVRWSet unmarshals bytes to a KVRWSet.
UnmarshalPayload unmarshals bytes to a Payload.
UnmarshalPayloadOrPanic unmarshals bytes to a Payload structure or panics on error.
UnmarshalProposal unmarshals bytes to a Proposal.
UnmarshalProposalResponse unmarshals bytes to a ProposalResponse.
UnmarshalProposalResponsePayload unmarshals bytes to a ProposalResponsePayload.
UnmarshalResponse unmarshals bytes to a Response.
UnmarshalSignatureHeader unmarshals bytes to a SignatureHeader.
UnmarshalSignatureHeaderOrPanic unmarshals bytes to a SignatureHeader or panics on error.
UnmarshalSignaturePolicy unmarshals bytes to a SignaturePolicyEnvelope.
UnmarshalTransaction unmarshals bytes to a Transaction.
UnmarshalTxReadWriteSet unmarshals bytes to a TxReadWriteSet.
# Structs
SignedData is used to represent the general triplet required to verify a signature This is intended to be generic across crypto schemes, while most crypto schemes will include the signing identity and a nonce within the Data, this is left to the crypto implementation.
# Interfaces
Signer is the interface needed to sign a transaction.