Documentation
¶
Index ¶
- func ChannelHeader(env *cb.Envelope) (*cb.ChannelHeader, error)
- func ChannelID(env *cb.Envelope) (string, error)
- func ComputeTxID(nonce, creator []byte, hashType newcryptosm.Hash) string
- func CreateChaincodeProposal(typ common.HeaderType, channelID string, cis *peer.ChaincodeInvocationSpec, ...) (*peer.Proposal, string, error)
- func CreateChaincodeProposalWithTransient(typ common.HeaderType, channelID string, cis *peer.ChaincodeInvocationSpec, ...) (*peer.Proposal, string, error)
- func CreateChaincodeProposalWithTxIDNonceAndTransient(txid string, typ common.HeaderType, channelID string, ...) (*peer.Proposal, string, error)
- func CreateNonce() ([]byte, error)
- func CreateProposalFromCIS(typ common.HeaderType, channelID string, cis *peer.ChaincodeInvocationSpec, ...) (*peer.Proposal, string, error)
- func CreateProposalResponse(hdrbytes []byte, payl []byte, response *peer.Response, results []byte, ...) (*peer.ProposalResponse, error)
- func CreateSignedEnvelope(txType common.HeaderType, channelID string, signer Signer, ...) (*common.Envelope, error)
- func CreateSignedEnvelopeWithTLSBinding(txType common.HeaderType, channelID string, signer Signer, ...) (*common.Envelope, error)
- func CreateSignedTx(proposal *peer.Proposal, signer Signer, resps ...*peer.ProposalResponse) (*common.Envelope, error)
- func ExtractEnvelope(block *cb.Block, index int) (*cb.Envelope, error)
- func GetBytesChaincodeActionPayload(cap *peer.ChaincodeActionPayload) ([]byte, error)
- func GetBytesChaincodeProposalPayload(cpp *peer.ChaincodeProposalPayload) ([]byte, error)
- func GetBytesPayload(payl *common.Payload) ([]byte, error)
- func GetBytesProposalPayloadForTx(payload *peer.ChaincodeProposalPayload) ([]byte, error)
- func GetBytesProposalResponsePayload(hash []byte, response *peer.Response, result []byte, event []byte, ...) ([]byte, error)
- func GetBytesTransaction(tx *peer.Transaction) ([]byte, error)
- func GetEnvelopeFromBlock(data []byte) (*common.Envelope, error)
- func GetProposalHash1(header *common.Header, ccPropPayl []byte, hashType newcryptosm.Hash) ([]byte, error)
- func GetSignedProposal(prop *peer.Proposal, signer Signer) (*peer.SignedProposal, error)
- func MakeChannelHeader(headerType cb.HeaderType, version int32, chainID string, epoch uint64) *cb.ChannelHeader
- func MakePayloadHeader(ch *cb.ChannelHeader, sh *cb.SignatureHeader) *cb.Header
- func Marshal(pb proto.Message) ([]byte, error)
- func MarshalOrPanic(pb proto.Message) []byte
- func NewSignatureHeader(id Signer) (*cb.SignatureHeader, error)
- func UnmarshalChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error)
- func UnmarshalChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error)
- func UnmarshalChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error)
- func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error)
- func UnmarshalEnvelope(encoded []byte) (*cb.Envelope, error)
- func UnmarshalHeader(bytes []byte) (*common.Header, error)
- func UnmarshalPayload(encoded []byte) (*cb.Payload, error)
- func UnmarshalProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error)
- func UnmarshalSignatureHeader(bytes []byte) (*cb.SignatureHeader, error)
- func UnmarshalTransaction(txBytes []byte) (*peer.Transaction, error)
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChannelHeader ¶
func ChannelHeader(env *cb.Envelope) (*cb.ChannelHeader, error)
ChannelHeader returns the *cb.ChannelHeader for a given *cb.Envelope.
func ComputeTxID ¶
func ComputeTxID(nonce, creator []byte, hashType newcryptosm.Hash) string
ComputeTxID computes TxID as the Hash computed over the concatenation of nonce and creator.
func CreateChaincodeProposal ¶
func CreateChaincodeProposal(typ common.HeaderType, channelID string, cis *peer.ChaincodeInvocationSpec, creator []byte, hashType newcryptosm.Hash) (*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, channelID string, cis *peer.ChaincodeInvocationSpec, creator []byte, transientMap map[string][]byte, hashType newcryptosm.Hash) (*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, channelID string, cis *peer.ChaincodeInvocationSpec, nonce, creator []byte, transientMap map[string][]byte) (*peer.Proposal, string, error)
CreateChaincodeProposalWithTxIDNonceAndTransient creates a proposal from given input
func CreateNonce ¶
CreateNonce generates a nonce using the common/crypto package.
func CreateProposalFromCIS ¶
func CreateProposalFromCIS(typ common.HeaderType, channelID string, cis *peer.ChaincodeInvocationSpec, creator []byte, hashType newcryptosm.Hash) (*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, signingEndorser Signer, ) (*peer.ProposalResponse, error)
CreateProposalResponse creates a proposal response.
func CreateSignedEnvelope ¶
func CreateSignedEnvelope( txType common.HeaderType, channelID string, signer Signer, 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 CreateSignedEnvelopeWithTLSBinding ¶
func CreateSignedEnvelopeWithTLSBinding( txType common.HeaderType, channelID string, signer Signer, dataMsg proto.Message, msgVersion int32, epoch uint64, tlsCertHash []byte, ) (*common.Envelope, error)
CreateSignedEnvelopeWithTLSBinding creates a signed envelope of the desired type, with marshaled dataMsg and signs it. It also includes a TLS cert hash into the channel header
func CreateSignedTx ¶
func CreateSignedTx( proposal *peer.Proposal, signer Signer, 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 ExtractEnvelope ¶
ExtractEnvelope retrieves the requested envelope from a given block and unmarshals it
func GetBytesChaincodeActionPayload ¶
func GetBytesChaincodeActionPayload(cap *peer.ChaincodeActionPayload) ([]byte, error)
GetBytesChaincodeActionPayload get the bytes of ChaincodeActionPayload from the message
func GetBytesChaincodeProposalPayload ¶
func GetBytesChaincodeProposalPayload(cpp *peer.ChaincodeProposalPayload) ([]byte, error)
GetBytesChaincodeProposalPayload gets the chaincode proposal payload
func GetBytesPayload ¶
GetBytesPayload get the bytes of Payload from the message
func GetBytesProposalPayloadForTx ¶
func GetBytesProposalPayloadForTx( payload *peer.ChaincodeProposalPayload, ) ([]byte, error)
GetBytesProposalPayloadForTx takes a ChaincodeProposalPayload and returns its serialized version according to the visibility field
func GetBytesProposalResponsePayload ¶
func GetBytesProposalResponsePayload(hash []byte, response *peer.Response, result []byte, event []byte, ccid *peer.ChaincodeID) ([]byte, error)
GetBytesProposalResponsePayload gets proposal response payload
func GetBytesTransaction ¶
func GetBytesTransaction(tx *peer.Transaction) ([]byte, error)
GetBytesTransaction get the bytes of Transaction from the message
func GetEnvelopeFromBlock ¶
GetEnvelopeFromBlock gets an envelope from a block's Data field.
func GetProposalHash1 ¶
func GetProposalHash1(header *common.Header, ccPropPayl []byte, hashType newcryptosm.Hash) ([]byte, error)
GetProposalHash1 gets the proposal hash bytes after sanitizing the chaincode proposal payload according to the rules of visibility
func GetSignedProposal ¶
GetSignedProposal returns a signed proposal given a Proposal message and a signing identity
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 MarshalOrPanic ¶
MarshalOrPanic serializes a protobuf message and panics if this operation fails
func NewSignatureHeader ¶
func NewSignatureHeader(id Signer) (*cb.SignatureHeader, error)
NewSignatureHeader returns a SignatureHeader with a valid nonce.
func UnmarshalChaincodeAction ¶
func UnmarshalChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error)
UnmarshalChaincodeAction unmarshals bytes to a ChaincodeAction
func UnmarshalChaincodeActionPayload ¶
func UnmarshalChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error)
UnmarshalChaincodeActionPayload unmarshals bytes to a ChaincodeActionPayload
func UnmarshalChaincodeProposalPayload ¶
func UnmarshalChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error)
UnmarshalChaincodeProposalPayload unmarshals bytes to a ChaincodeProposalPayload
func UnmarshalChannelHeader ¶
func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error)
UnmarshalChannelHeader unmarshals bytes to a ChannelHeader
func UnmarshalEnvelope ¶
UnmarshalEnvelope unmarshals bytes to a Envelope
func UnmarshalHeader ¶
UnmarshalHeader unmarshals bytes to a Header
func UnmarshalPayload ¶
UnmarshalPayload unmarshals bytes to a Payload
func UnmarshalProposalResponsePayload ¶
func UnmarshalProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error)
UnmarshalProposalResponsePayload unmarshals bytes to a ProposalResponsePayload
func UnmarshalSignatureHeader ¶
func UnmarshalSignatureHeader(bytes []byte) (*cb.SignatureHeader, error)
UnmarshalSignatureHeader unmarshals bytes to a SignatureHeader
func UnmarshalTransaction ¶
func UnmarshalTransaction(txBytes []byte) (*peer.Transaction, error)
UnmarshalTransaction unmarshals bytes to a Transaction