Documentation ¶
Index ¶
- func BlockDataHash(b *common.BlockData) []byte
- func ComputeTxID(nonce, creator []byte) string
- func CreateNonce() ([]byte, error)
- func CreateNonceOrPanic() []byte
- func CreateSignedEnvelope(txType common.HeaderType, channelID string, signer identity.SigningIdentity, ...) (*common.Envelope, error)
- func CreateSignedEnvelopeWithTLSBinding(txType common.HeaderType, channelID string, signer identity.SigningIdentity, ...) (*common.Envelope, error)
- func CreateSignedTx(proposal *peer.Proposal, signer identity.Signer, ...) (*common.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 GetBytesTransaction(tx *peer.Transaction) ([]byte, error)
- func GetRandomNonce() ([]byte, error)
- func MakeChannelHeader(headerType common.HeaderType, version int32, chainID string, epoch uint64) *common.ChannelHeader
- func MakePayloadHeader(ch *common.ChannelHeader, sh *common.SignatureHeader) *common.Header
- func MakeSignatureHeader(serializedCreatorCertChain []byte, nonce []byte) *common.SignatureHeader
- func MarshalOrPanic(pb proto.Message) []byte
- func NewBlock(seqNum uint64, previousHash []byte) *common.Block
- func NewSignatureHeader(id identity.Identity) (*common.SignatureHeader, error)
- func SetTxID(channelHeader *common.ChannelHeader, signatureHeader *common.SignatureHeader)
- func UnmarshalChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error)
- func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error)
- func UnmarshalConfigUpdateEnvelope(data []byte) (*cb.ConfigUpdateEnvelope, error)
- func UnmarshalEnvelope(encoded []byte) (*cb.Envelope, error)
- func UnmarshalHeader(bytes []byte) (*common.Header, error)
- func UnmarshalPayload(encoded []byte) (*cb.Payload, error)
- func UnmarshalSignatureHeader(bytes []byte) (*common.SignatureHeader, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockDataHash ¶
func ComputeTxID ¶
ComputeTxID computes TxID as the Hash computed over the concatenation of nonce and creator.
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 CreateSignedEnvelope ¶
func CreateSignedEnvelope( txType common.HeaderType, channelID string, signer identity.SigningIdentity, 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 identity.SigningIdentity, 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 identity.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 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 GetBytesTransaction ¶
func GetBytesTransaction(tx *peer.Transaction) ([]byte, error)
GetBytesTransaction get the bytes of Transaction from the message
func GetRandomNonce ¶
func MakeChannelHeader ¶
func MakeChannelHeader(headerType common.HeaderType, version int32, chainID string, epoch uint64) *common.ChannelHeader
MakeChannelHeader creates a ChannelHeader.
func MakePayloadHeader ¶
func MakePayloadHeader(ch *common.ChannelHeader, sh *common.SignatureHeader) *common.Header
MakePayloadHeader creates a Payload Header.
func MakeSignatureHeader ¶
func MakeSignatureHeader(serializedCreatorCertChain []byte, nonce []byte) *common.SignatureHeader
MakeSignatureHeader creates a SignatureHeader.
func MarshalOrPanic ¶
MarshalOrPanic serializes a protobuf message and panics if this operation fails
func NewSignatureHeader ¶
func NewSignatureHeader(id identity.Identity) (*common.SignatureHeader, error)
NewSignatureHeader returns a SignatureHeader with a valid nonce.
func SetTxID ¶
func SetTxID(channelHeader *common.ChannelHeader, signatureHeader *common.SignatureHeader)
SetTxID generates a transaction id based on the provided signature header and sets the TxId field in the channel header
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 UnmarshalConfigUpdateEnvelope ¶
func UnmarshalConfigUpdateEnvelope(data []byte) (*cb.ConfigUpdateEnvelope, error)
UnmarshalConfigUpdateEnvelope attempts to unmarshal bytes to a *cb.ConfigUpdate
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 UnmarshalSignatureHeader ¶
func UnmarshalSignatureHeader(bytes []byte) (*common.SignatureHeader, error)
UnmarshalSignatureHeader unmarshals bytes to a SignatureHeader
Types ¶
This section is empty.