Documentation ¶
Index ¶
- func CheckProposalTxID(txid string, nonce, creator []byte) error
- func ComputeProposalBinding(proposal *peer.Proposal) ([]byte, error)
- func ComputeProposalTxID(nonce, creator []byte) (string, error)
- func CopyBlockMetadata(src *cb.Block, dst *cb.Block)
- func CreateChaincodeProposal(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, ...) (*peer.Proposal, string, error)
- func CreateChaincodeProposalWithTransient(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, ...) (*peer.Proposal, string, error)
- func CreateChaincodeProposalWithTxIDNonceAndTransient(txid string, typ common.HeaderType, chainID string, ...) (*peer.Proposal, string, error)
- func CreateDeployProposalFromCDS(chainID string, cds *peer.ChaincodeDeploymentSpec, creator []byte, ...) (*peer.Proposal, string, error)
- func CreateInstallProposalFromCDS(ccpack proto.Message, creator []byte) (*peer.Proposal, string, error)
- func CreateNonce() ([]byte, error)
- func CreateNonceOrPanic() []byte
- func CreateProposalFromCIS(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, ...) (*peer.Proposal, string, error)
- func CreateProposalResponse(hdrbytes []byte, payl []byte, response *peer.Response, results []byte, ...) (*peer.ProposalResponse, error)
- func CreateProposalResponseFailure(hdrbytes []byte, payl []byte, response *peer.Response, results []byte, ...) (*peer.ProposalResponse, error)
- func CreateSignedEnvelope(txType common.HeaderType, channelID string, signer crypto.LocalSigner, ...) (*common.Envelope, error)
- func CreateSignedTx(proposal *peer.Proposal, signer msp.SigningIdentity, ...) (*common.Envelope, error)
- func CreateUpgradeProposalFromCDS(chainID string, cds *peer.ChaincodeDeploymentSpec, creator []byte, ...) (*peer.Proposal, string, error)
- func ExtractEnvelope(block *cb.Block, index int) (*cb.Envelope, error)
- func ExtractEnvelopeOrPanic(block *cb.Block, index int) *cb.Envelope
- func ExtractPayload(envelope *cb.Envelope) (*cb.Payload, error)
- func ExtractPayloadOrPanic(envelope *cb.Envelope) *cb.Payload
- func GetActionFromEnvelope(envBytes []byte) (*peer.ChaincodeInvocationSpec, *peer.ChaincodeAction, error)
- func GetActionFromEnvelopePayload(payloadBytes []byte) (*peer.ChaincodeInvocationSpec, *peer.ChaincodeAction, error)
- func GetActionFromEnvelopeProp(env *common.Envelope) (*peer.ChaincodeInvocationSpec, *peer.ChaincodeAction, error)
- func GetBlockFromBlockBytes(blockBytes []byte) (*cb.Block, error)
- func GetBytesChaincodeActionPayload(cap *peer.ChaincodeActionPayload) ([]byte, error)
- func GetBytesChaincodeEvent(event *peer.ChaincodeEvent) ([]byte, error)
- func GetBytesChaincodeProposalPayload(cpp *peer.ChaincodeProposalPayload) ([]byte, error)
- func GetBytesEnvelope(env *common.Envelope) ([]byte, error)
- func GetBytesHeader(hdr *common.Header) ([]byte, error)
- func GetBytesPayload(payl *common.Payload) ([]byte, error)
- func GetBytesProposal(prop *peer.Proposal) ([]byte, error)
- func GetBytesProposalPayloadForTx(payload *peer.ChaincodeProposalPayload, visibility []byte) ([]byte, error)
- func GetBytesProposalResponse(pr *peer.ProposalResponse) ([]byte, error)
- func GetBytesProposalResponsePayload(hash []byte, response *peer.Response, result []byte, event []byte, ...) ([]byte, error)
- func GetBytesResponse(res *peer.Response) ([]byte, error)
- func GetBytesSignatureHeader(hdr *common.SignatureHeader) ([]byte, error)
- func GetBytesTransaction(tx *peer.Transaction) ([]byte, error)
- func GetChainIDFromBlock(block *cb.Block) (string, error)
- func GetChainIDFromBlockBytes(bytes []byte) (string, error)
- func GetChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error)
- func GetChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error)
- func GetChaincodeDeploymentSpec(code []byte) (*peer.ChaincodeDeploymentSpec, error)
- func GetChaincodeEvents(eBytes []byte) (*peer.ChaincodeEvent, error)
- func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error)
- func GetChaincodeInvocationSpec(prop *peer.Proposal) (*peer.ChaincodeInvocationSpec, error)
- func GetChaincodeInvocationSpecFromSignedProposal(proposal *peer.Proposal) (*peer.ChaincodeInvocationSpec, error)
- func GetChaincodeProposalContext(prop *peer.Proposal) ([]byte, map[string][]byte, error)
- func GetChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error)
- func GetEnvelopeFromBlock(data []byte) (*common.Envelope, error)
- func GetHeader(bytes []byte) (*common.Header, error)
- func GetLastConfigIndexFromBlock(block *cb.Block) (uint64, error)
- func GetLastConfigIndexFromBlockOrPanic(block *cb.Block) uint64
- func GetMetadataFromBlock(block *cb.Block, index cb.BlockMetadataIndex) (*cb.Metadata, error)
- func GetMetadataFromBlockOrPanic(block *cb.Block, index cb.BlockMetadataIndex) *cb.Metadata
- func GetNonce(prop *peer.Proposal) ([]byte, error)
- func GetPayload(e *common.Envelope) (*common.Payload, error)
- func GetPayloads(txActions *peer.TransactionAction) (*peer.ChaincodeActionPayload, *peer.ChaincodeAction, error)
- func GetProposal(propBytes []byte) (*peer.Proposal, error)
- func GetProposalHash1(header *common.Header, ccPropPayl []byte, visibility []byte) ([]byte, error)
- func GetProposalHash2(header *common.Header, ccPropPayl []byte) ([]byte, error)
- func GetProposalResponse(prBytes []byte) (*peer.ProposalResponse, error)
- func GetProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error)
- func GetResponse(resBytes []byte) (*peer.Response, error)
- func GetSignatureHeader(bytes []byte) (*common.SignatureHeader, error)
- func GetSignedEvent(evt *peer.Event, signer msp.SigningIdentity) (*peer.SignedEvent, error)
- func GetSignedProposal(prop *peer.Proposal, signer msp.SigningIdentity) (*peer.SignedProposal, error)
- func GetTransaction(txBytes []byte) (*peer.Transaction, error)
- func InitBlockMetadata(block *cb.Block)
- func IsConfigBlock(block *cb.Block) bool
- func MakeChannelHeader(headerType cb.HeaderType, version int32, chainID string, epoch uint64) *cb.ChannelHeader
- func MakePayloadHeader(ch *cb.ChannelHeader, sh *cb.SignatureHeader) *cb.Header
- func MakeSignatureHeader(serializedCreatorCertChain []byte, nonce []byte) *cb.SignatureHeader
- func Marshal(pb proto.Message) ([]byte, error)
- func MarshalOrPanic(pb proto.Message) []byte
- func MockSignedEndorserProposal2OrPanic(chainID string, cs *peer.ChaincodeSpec, signer msp.SigningIdentity) (*peer.SignedProposal, *peer.Proposal)
- func MockSignedEndorserProposalOrPanic(chainID string, cs *peer.ChaincodeSpec, creator, signature []byte) (*peer.SignedProposal, *peer.Proposal)
- func NewSignatureHeaderOrPanic(signer crypto.LocalSigner) *cb.SignatureHeader
- func SetTxID(channelHeader *cb.ChannelHeader, signatureHeader *cb.SignatureHeader) error
- func SignOrPanic(signer crypto.LocalSigner, msg []byte) []byte
- func UnmarshalChaincodeID(bytes []byte) (*pb.ChaincodeID, error)
- func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error)
- func UnmarshalEnvelope(encoded []byte) (*cb.Envelope, error)
- func UnmarshalEnvelopeOfType(envelope *cb.Envelope, headerType cb.HeaderType, message proto.Message) (*cb.ChannelHeader, error)
- func UnmarshalEnvelopeOrPanic(encoded []byte) *cb.Envelope
- func UnmarshalPayload(encoded []byte) (*cb.Payload, error)
- func UnmarshalPayloadOrPanic(encoded []byte) *cb.Payload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckProposalTxID ¶
CheckProposalTxID checks that txid is equal to the Hash computed over the concatenation of nonce and creator.
func ComputeProposalBinding ¶
ComputeProposalBinding computes the binding of a proposal
func ComputeProposalTxID ¶
ComputeProposalTxID computes TxID as the Hash computed over the concatenation of nonce and creator.
func CopyBlockMetadata ¶
CopyBlockMetadata copies metadata from one block into another
func CreateChaincodeProposal ¶
func CreateChaincodeProposal(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, creator []byte) (*peer.Proposal, string, error)
CreateChaincodeProposal creates a proposal from given input. It returns the proposal and the transaction id associated to the proposal
func CreateChaincodeProposalWithTransient ¶
func CreateChaincodeProposalWithTransient(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, creator []byte, transientMap map[string][]byte) (*peer.Proposal, string, error)
CreateChaincodeProposalWithTransient creates a proposal from given input It returns the proposal and the transaction id associated to the proposal
func CreateChaincodeProposalWithTxIDNonceAndTransient ¶
func CreateChaincodeProposalWithTxIDNonceAndTransient(txid string, typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, nonce, creator []byte, transientMap map[string][]byte) (*peer.Proposal, string, error)
CreateChaincodeProposalWithTxIDNonceAndTransient creates a proposal from given input
func CreateDeployProposalFromCDS ¶
func CreateDeployProposalFromCDS(chainID string, cds *peer.ChaincodeDeploymentSpec, creator []byte, policy []byte, escc []byte, vscc []byte) (*peer.Proposal, string, error)
CreateDeployProposalFromCDS returns a deploy proposal given a serialized identity and a ChaincodeDeploymentSpec
func CreateInstallProposalFromCDS ¶
func CreateInstallProposalFromCDS(ccpack proto.Message, creator []byte) (*peer.Proposal, string, error)
CreateInstallProposalFromCDS returns a install proposal given a serialized identity and a ChaincodeDeploymentSpec
func CreateNonce ¶
CreateNonce generates a nonce using the common/crypto package.
func CreateNonceOrPanic ¶
func CreateNonceOrPanic() []byte
CreateNonceOrPanic generates a nonce using the common/crypto package and panics if this operation fails.
func CreateProposalFromCIS ¶
func CreateProposalFromCIS(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, creator []byte) (*peer.Proposal, string, error)
CreateProposalFromCIS returns a proposal given a serialized identity and a ChaincodeInvocationSpec
func CreateProposalResponse ¶
func CreateProposalResponse(hdrbytes []byte, payl []byte, response *peer.Response, results []byte, events []byte, ccid *peer.ChaincodeID, visibility []byte, signingEndorser msp.SigningIdentity) (*peer.ProposalResponse, error)
CreateProposalResponse creates a proposal response.
func CreateProposalResponseFailure ¶
func CreateProposalResponseFailure(hdrbytes []byte, payl []byte, response *peer.Response, results []byte, events []byte, ccid *peer.ChaincodeID, visibility []byte) (*peer.ProposalResponse, error)
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)
func CreateSignedEnvelope ¶
func CreateSignedEnvelope(txType common.HeaderType, channelID string, signer crypto.LocalSigner, dataMsg proto.Message, msgVersion int32, epoch uint64) (*common.Envelope, error)
CreateSignedEnvelope creates a signed envelope of the desired type, with marshaled dataMsg and signs it
func CreateSignedTx ¶
func CreateSignedTx(proposal *peer.Proposal, signer msp.SigningIdentity, resps ...*peer.ProposalResponse) (*common.Envelope, error)
CreateSignedTx assembles an Envelope message from proposal, endorsements, and a signer. This function should be called by a client when it has collected enough endorsements for a proposal to create a transaction and submit it to peers for ordering
func CreateUpgradeProposalFromCDS ¶
func CreateUpgradeProposalFromCDS(chainID string, cds *peer.ChaincodeDeploymentSpec, creator []byte, policy []byte, escc []byte, vscc []byte) (*peer.Proposal, string, error)
CreateUpgradeProposalFromCDS returns a upgrade proposal given a serialized identity and a ChaincodeDeploymentSpec
func ExtractEnvelope ¶
ExtractEnvelope retrieves the requested envelope from a given block and unmarshals it.
func ExtractEnvelopeOrPanic ¶
ExtractEnvelopeOrPanic retrieves the requested envelope from a given block and unmarshals it -- it panics if either of these operation fail.
func ExtractPayload ¶
ExtractPayload retrieves the payload of a given envelope and unmarshals it.
func ExtractPayloadOrPanic ¶
ExtractPayloadOrPanic retrieves the payload of a given envelope and unmarshals it -- it panics if either of these operations fail.
func GetActionFromEnvelope ¶
func GetActionFromEnvelope(envBytes []byte) (*peer.ChaincodeInvocationSpec, *peer.ChaincodeAction, error)
GetActionFromEnvelope extracts a ChaincodeAction message from a serialized Envelope
func GetActionFromEnvelopePayload ¶
func GetActionFromEnvelopePayload(payloadBytes []byte) (*peer.ChaincodeInvocationSpec, *peer.ChaincodeAction, error)
func GetActionFromEnvelopeProp ¶ added in v0.12.0
func GetActionFromEnvelopeProp(env *common.Envelope) (*peer.ChaincodeInvocationSpec, *peer.ChaincodeAction, error)
func GetBlockFromBlockBytes ¶
GetBlockFromBlockBytes marshals the bytes into Block
func GetBytesChaincodeActionPayload ¶
func GetBytesChaincodeActionPayload(cap *peer.ChaincodeActionPayload) ([]byte, error)
GetBytesChaincodeActionPayload get the bytes of ChaincodeActionPayload from the message
func GetBytesChaincodeEvent ¶
func GetBytesChaincodeEvent(event *peer.ChaincodeEvent) ([]byte, error)
GetBytesChaincodeEvent gets the bytes of ChaincodeEvent
func GetBytesChaincodeProposalPayload ¶
func GetBytesChaincodeProposalPayload(cpp *peer.ChaincodeProposalPayload) ([]byte, error)
GetBytesChaincodeProposalPayload gets the chaincode proposal payload
func GetBytesEnvelope ¶
GetBytesEnvelope get the bytes of Envelope from the message
func GetBytesHeader ¶
GetBytesHeader get the bytes of Header from the message
func GetBytesPayload ¶
GetBytesPayload get the bytes of Payload from the message
func GetBytesProposal ¶
GetBytesProposal returns the bytes of a proposal message
func GetBytesProposalPayloadForTx ¶
func GetBytesProposalPayloadForTx(payload *peer.ChaincodeProposalPayload, visibility []byte) ([]byte, error)
GetBytesProposalPayloadForTx takes a ChaincodeProposalPayload and returns its serialized version according to the visibility field
func GetBytesProposalResponse ¶
func GetBytesProposalResponse(pr *peer.ProposalResponse) ([]byte, error)
GetBytesProposalResponse gets propoal bytes response
func GetBytesProposalResponsePayload ¶
func GetBytesProposalResponsePayload(hash []byte, response *peer.Response, result []byte, event []byte, ccid *peer.ChaincodeID) ([]byte, error)
GetBytesProposalResponsePayload gets proposal response payload
func GetBytesResponse ¶
GetBytesResponse gets the bytes of Response
func GetBytesSignatureHeader ¶
func GetBytesSignatureHeader(hdr *common.SignatureHeader) ([]byte, error)
GetBytesSignatureHeader get the bytes of SignatureHeader from the message
func GetBytesTransaction ¶
func GetBytesTransaction(tx *peer.Transaction) ([]byte, error)
GetBytesTransaction get the bytes of Transaction from the message
func GetChainIDFromBlock ¶
GetChainIDFromBlock returns chain ID in the block
func GetChainIDFromBlockBytes ¶
GetChainIDFromBlockBytes returns chain ID given byte array which represents the block
func GetChaincodeAction ¶
func GetChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error)
GetChaincodeAction gets the ChaincodeAction given chaicnode action bytes
func GetChaincodeActionPayload ¶
func GetChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error)
GetChaincodeActionPayload Get ChaincodeActionPayload from bytes
func GetChaincodeDeploymentSpec ¶
func GetChaincodeDeploymentSpec(code []byte) (*peer.ChaincodeDeploymentSpec, error)
GetChaincodeDeploymentSpec returns a ChaincodeDeploymentSpec given args
func GetChaincodeEvents ¶
func GetChaincodeEvents(eBytes []byte) (*peer.ChaincodeEvent, error)
GetChaincodeEvents gets the ChaincodeEvents given chaicnode event bytes
func GetChaincodeHeaderExtension ¶
func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error)
GetChaincodeHeaderExtension get chaincode header extension given header
func GetChaincodeInvocationSpec ¶
func GetChaincodeInvocationSpec(prop *peer.Proposal) (*peer.ChaincodeInvocationSpec, error)
GetChaincodeInvocationSpec get the ChaincodeInvocationSpec from the proposal
func GetChaincodeInvocationSpecFromSignedProposal ¶
func GetChaincodeInvocationSpecFromSignedProposal(proposal *peer.Proposal) (*peer.ChaincodeInvocationSpec, error)
func GetChaincodeProposalContext ¶
GetChaincodeProposalContext returns creator and transient
func GetChaincodeProposalPayload ¶
func GetChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error)
GetChaincodeProposalPayload Get ChaincodeProposalPayload from bytes
func GetEnvelopeFromBlock ¶
GetEnvelopeFromBlock gets an envelope from a block's Data field.
func GetLastConfigIndexFromBlock ¶
GetLastConfigIndexFromBlock retrieves the index of the last config block as encoded in the block metadata
func GetLastConfigIndexFromBlockOrPanic ¶
GetLastConfigIndexFromBlockOrPanic retrieves the index of the last config block as encoded in the block metadata, or panics on error.
func GetMetadataFromBlock ¶
GetMetadataFromBlock retrieves metadata at the specified index.
func GetMetadataFromBlockOrPanic ¶
GetMetadataFromBlockOrPanic retrieves metadata at the specified index, or panics on error.
func GetPayload ¶
GetPayload Get Payload from Envelope message
func GetPayloads ¶
func GetPayloads(txActions *peer.TransactionAction) (*peer.ChaincodeActionPayload, *peer.ChaincodeAction, error)
GetPayloads get's the underlying payload objects in a TransactionAction
func GetProposal ¶
GetProposal returns a Proposal message from its bytes
func GetProposalHash1 ¶
GetProposalHash1 gets the proposal hash bytes after sanitizing the chaincode proposal payload according to the rules of visibility
func GetProposalHash2 ¶
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
func GetProposalResponse ¶
func GetProposalResponse(prBytes []byte) (*peer.ProposalResponse, error)
GetProposalResponse given proposal in bytes
func GetProposalResponsePayload ¶
func GetProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error)
GetProposalResponsePayload gets the proposal response payload
func GetResponse ¶
GetResponse gets the Response given response bytes
func GetSignatureHeader ¶
func GetSignatureHeader(bytes []byte) (*common.SignatureHeader, error)
GetSignatureHeader Get SignatureHeader from bytes
func GetSignedEvent ¶
func GetSignedEvent(evt *peer.Event, signer msp.SigningIdentity) (*peer.SignedEvent, error)
GetSignedEvent returns a signed event given an Event message and a signing identity
func GetSignedProposal ¶
func GetSignedProposal(prop *peer.Proposal, signer msp.SigningIdentity) (*peer.SignedProposal, error)
GetSignedProposal returns a signed proposal given a Proposal message and a signing identity
func GetTransaction ¶
func GetTransaction(txBytes []byte) (*peer.Transaction, error)
GetTransaction Get Transaction from bytes
func InitBlockMetadata ¶
InitBlockMetadata copies metadata from one block into another
func IsConfigBlock ¶
IsConfigBlock validates whenever given block contains configuration update transaction
func MakeChannelHeader ¶
func MakeChannelHeader(headerType cb.HeaderType, version int32, chainID string, epoch uint64) *cb.ChannelHeader
MakeChannelHeader creates a ChannelHeader.
func MakePayloadHeader ¶
func MakePayloadHeader(ch *cb.ChannelHeader, sh *cb.SignatureHeader) *cb.Header
MakePayloadHeader creates a Payload Header.
func MakeSignatureHeader ¶
func MakeSignatureHeader(serializedCreatorCertChain []byte, nonce []byte) *cb.SignatureHeader
MakeSignatureHeader creates a SignatureHeader.
func MarshalOrPanic ¶
MarshalOrPanic serializes a protobuf message and panics if this operation fails.
func MockSignedEndorserProposal2OrPanic ¶
func MockSignedEndorserProposal2OrPanic(chainID string, cs *peer.ChaincodeSpec, signer msp.SigningIdentity) (*peer.SignedProposal, *peer.Proposal)
func MockSignedEndorserProposalOrPanic ¶
func MockSignedEndorserProposalOrPanic(chainID string, cs *peer.ChaincodeSpec, creator, signature []byte) (*peer.SignedProposal, *peer.Proposal)
MockSignedEndorserProposalOrPanic creates a SignedProposal with the passed arguments
func NewSignatureHeaderOrPanic ¶
func NewSignatureHeaderOrPanic(signer crypto.LocalSigner) *cb.SignatureHeader
NewSignatureHeaderOrPanic returns a signature header and panics on error.
func SetTxID ¶
func SetTxID(channelHeader *cb.ChannelHeader, signatureHeader *cb.SignatureHeader) error
func SignOrPanic ¶
func SignOrPanic(signer crypto.LocalSigner, msg []byte) []byte
SignOrPanic signs a message and panics on error.
func UnmarshalChaincodeID ¶
func UnmarshalChaincodeID(bytes []byte) (*pb.ChaincodeID, error)
UnmarshalChaincodeID returns a ChaincodeID from bytes
func UnmarshalChannelHeader ¶
func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error)
UnmarshalChannelHeader returns a ChannelHeader from bytes
func UnmarshalEnvelope ¶
UnmarshalEnvelope unmarshals bytes to an Envelope structure
func UnmarshalEnvelopeOfType ¶
func UnmarshalEnvelopeOfType(envelope *cb.Envelope, headerType cb.HeaderType, message proto.Message) (*cb.ChannelHeader, error)
UnmarshalEnvelopeOfType unmarshals an envelope of the specified type, including the unmarshaling the payload data
func UnmarshalEnvelopeOrPanic ¶
UnmarshalEnvelopeOrPanic unmarshals bytes to an Envelope structure or panics on error
func UnmarshalPayload ¶
UnmarshalPayload unmarshals bytes to a Payload structure
func UnmarshalPayloadOrPanic ¶
UnmarshalPayloadOrPanic unmarshals bytes to a Payload structure or panics on error
Types ¶
This section is empty.