utils

package
v0.0.0-...-95b87ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChannelHeader

func ChannelHeader(env *cb.Envelope) (*cb.ChannelHeader, error)

func ChannelID

func ChannelID(env *cb.Envelope) (string, error)

func CheckTxID

func CheckTxID(txid string, nonce, creator []byte) error

func ComputeProposalBinding

func ComputeProposalBinding(proposal *peer.Proposal) ([]byte, error)

func ComputeTxID

func ComputeTxID(nonce, creator []byte) (string, error)

func CopyBlockMetadata

func CopyBlockMetadata(src *cb.Block, dst *cb.Block)

func CreateChaincodeProposal

func CreateChaincodeProposal(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, creator []byte) (*peer.Proposal, string, error)

func CreateChaincodeProposalWithTransient

func CreateChaincodeProposalWithTransient(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, creator []byte, transientMap map[string][]byte) (*peer.Proposal, string, error)

func CreateChaincodeProposalWithTxIDAndTransient

func CreateChaincodeProposalWithTxIDAndTransient(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, creator []byte, txid string, transientMap map[string][]byte) (*peer.Proposal, string, error)

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)

func CreateDeployProposalFromCDS

func CreateDeployProposalFromCDS(
	chainID string,
	cds *peer.ChaincodeDeploymentSpec,
	creator []byte,
	policy []byte,
	escc []byte,
	vscc []byte,
	collectionConfig []byte) (*peer.Proposal, string, error)

func CreateGetChaincodesProposal

func CreateGetChaincodesProposal(chainID string, creator []byte) (*peer.Proposal, string, error)

func CreateGetInstalledChaincodesProposal

func CreateGetInstalledChaincodesProposal(creator []byte) (*peer.Proposal, string, error)

func CreateInstallProposalFromCDS

func CreateInstallProposalFromCDS(ccpack proto.Message, creator []byte) (*peer.Proposal, string, error)

func CreateNonce

func CreateNonce() ([]byte, error)

func CreateNonceOrPanic

func CreateNonceOrPanic() []byte

func CreateProposalFromCIS

func CreateProposalFromCIS(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, creator []byte) (*peer.Proposal, string, error)

func CreateProposalFromCISAndTxid

func CreateProposalFromCISAndTxid(txid string, typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, creator []byte) (*peer.Proposal, string, error)

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)

func CreateProposalResponseFailure

func CreateProposalResponseFailure(hdrbytes []byte, payl []byte, response *peer.Response, results []byte, events []byte, ccid *peer.ChaincodeID, visibility []byte) (*peer.ProposalResponse, error)

func CreateSignedEnvelope

func CreateSignedEnvelope(txType common.HeaderType, channelID string, signer crypto.LocalSigner, dataMsg proto.Message, msgVersion int32, epoch uint64) (*common.Envelope, error)

func CreateSignedEnvelopeWithTLSBinding

func CreateSignedEnvelopeWithTLSBinding(txType common.HeaderType, channelID string, signer crypto.LocalSigner, dataMsg proto.Message, msgVersion int32, epoch uint64, tlsCertHash []byte) (*common.Envelope, error)

func CreateSignedTx

func CreateSignedTx(proposal *peer.Proposal, signer msp.SigningIdentity, resps ...*peer.ProposalResponse) (*common.Envelope, error)

func CreateUpgradeProposalFromCDS

func CreateUpgradeProposalFromCDS(
	chainID string,
	cds *peer.ChaincodeDeploymentSpec,
	creator []byte,
	policy []byte,
	escc []byte,
	vscc []byte,
	collectionConfig []byte) (*peer.Proposal, string, error)

func EnvelopeToConfigUpdate

func EnvelopeToConfigUpdate(configtx *cb.Envelope) (*cb.ConfigUpdateEnvelope, error)

func ExtractEnvelope

func ExtractEnvelope(block *cb.Block, index int) (*cb.Envelope, error)

func ExtractEnvelopeOrPanic

func ExtractEnvelopeOrPanic(block *cb.Block, index int) *cb.Envelope

func ExtractPayload

func ExtractPayload(envelope *cb.Envelope) (*cb.Payload, error)

func ExtractPayloadOrPanic

func ExtractPayloadOrPanic(envelope *cb.Envelope) *cb.Payload

func GetActionFromEnvelope

func GetActionFromEnvelope(envBytes []byte) (*peer.ChaincodeAction, error)

func GetActionFromEnvelopeMsg

func GetActionFromEnvelopeMsg(env *common.Envelope) (*peer.ChaincodeAction, error)

func GetBlockFromBlockBytes

func GetBlockFromBlockBytes(blockBytes []byte) (*cb.Block, error)

func GetBytesChaincodeActionPayload

func GetBytesChaincodeActionPayload(cap *peer.ChaincodeActionPayload) ([]byte, error)

func GetBytesChaincodeEvent

func GetBytesChaincodeEvent(event *peer.ChaincodeEvent) ([]byte, error)

func GetBytesChaincodeProposalPayload

func GetBytesChaincodeProposalPayload(cpp *peer.ChaincodeProposalPayload) ([]byte, error)

func GetBytesEnvelope

func GetBytesEnvelope(env *common.Envelope) ([]byte, error)

func GetBytesHeader

func GetBytesHeader(hdr *common.Header) ([]byte, error)

func GetBytesPayload

func GetBytesPayload(payl *common.Payload) ([]byte, error)

func GetBytesProposal

func GetBytesProposal(prop *peer.Proposal) ([]byte, error)

func GetBytesProposalPayloadForTx

func GetBytesProposalPayloadForTx(payload *peer.ChaincodeProposalPayload, visibility []byte) ([]byte, error)

func GetBytesProposalResponse

func GetBytesProposalResponse(pr *peer.ProposalResponse) ([]byte, error)

func GetBytesProposalResponsePayload

func GetBytesProposalResponsePayload(hash []byte, response *peer.Response, result []byte, event []byte, ccid *peer.ChaincodeID) ([]byte, error)

func GetBytesResponse

func GetBytesResponse(res *peer.Response) ([]byte, error)

func GetBytesSignatureHeader

func GetBytesSignatureHeader(hdr *common.SignatureHeader) ([]byte, error)

func GetBytesTransaction

func GetBytesTransaction(tx *peer.Transaction) ([]byte, error)

func GetChainIDFromBlock

func GetChainIDFromBlock(block *cb.Block) (string, error)

func GetChainIDFromBlockBytes

func GetChainIDFromBlockBytes(bytes []byte) (string, error)

func GetChaincodeAction

func GetChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error)

func GetChaincodeActionPayload

func GetChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error)

func GetChaincodeDeploymentSpec

func GetChaincodeDeploymentSpec(code []byte, pr *platforms.Registry) (*peer.ChaincodeDeploymentSpec, error)

func GetChaincodeEvents

func GetChaincodeEvents(eBytes []byte) (*peer.ChaincodeEvent, error)

func GetChaincodeHeaderExtension

func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error)

func GetChaincodeInvocationSpec

func GetChaincodeInvocationSpec(prop *peer.Proposal) (*peer.ChaincodeInvocationSpec, error)

func GetChaincodeProposalContext

func GetChaincodeProposalContext(prop *peer.Proposal) ([]byte, map[string][]byte, error)

func GetChaincodeProposalPayload

func GetChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error)

func GetEnvelopeFromBlock

func GetEnvelopeFromBlock(data []byte) (*common.Envelope, error)

func GetHeader

func GetHeader(bytes []byte) (*common.Header, error)

func GetLastConfigIndexFromBlock

func GetLastConfigIndexFromBlock(block *cb.Block) (uint64, error)

func GetLastConfigIndexFromBlockOrPanic

func GetLastConfigIndexFromBlockOrPanic(block *cb.Block) uint64

func GetMetadataFromBlock

func GetMetadataFromBlock(block *cb.Block, index cb.BlockMetadataIndex) (*cb.Metadata, error)

func GetMetadataFromBlockOrPanic

func GetMetadataFromBlockOrPanic(block *cb.Block, index cb.BlockMetadataIndex) *cb.Metadata

func GetNonce

func GetNonce(prop *peer.Proposal) ([]byte, error)

func GetPayload

func GetPayload(e *common.Envelope) (*common.Payload, error)

func GetProposal

func GetProposal(propBytes []byte) (*peer.Proposal, error)

func GetProposalHash1

func GetProposalHash1(header *common.Header, ccPropPayl []byte, visibility []byte) ([]byte, error)

func GetProposalHash2

func GetProposalHash2(header *common.Header, ccPropPayl []byte) ([]byte, error)

func GetProposalResponse

func GetProposalResponse(prBytes []byte) (*peer.ProposalResponse, error)

func GetProposalResponsePayload

func GetProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error)

func GetResponse

func GetResponse(resBytes []byte) (*peer.Response, error)

func GetSignatureHeader

func GetSignatureHeader(bytes []byte) (*common.SignatureHeader, error)

func GetSignedProposal

func GetSignedProposal(prop *peer.Proposal, signer msp.SigningIdentity) (*peer.SignedProposal, error)

func GetTransaction

func GetTransaction(txBytes []byte) (*peer.Transaction, error)

func InitBlockMetadata

func InitBlockMetadata(block *cb.Block)

func IsConfigBlock

func IsConfigBlock(block *cb.Block) bool

func MakeChannelHeader

func MakeChannelHeader(headerType cb.HeaderType, version int32, chainID string, epoch uint64) *cb.ChannelHeader

func MakePayloadHeader

func MakePayloadHeader(ch *cb.ChannelHeader, sh *cb.SignatureHeader) *cb.Header

func MakeSignatureHeader

func MakeSignatureHeader(serializedCreatorCertChain []byte, nonce []byte) *cb.SignatureHeader

func Marshal

func Marshal(pb proto.Message) ([]byte, error)

func MarshalOrPanic

func MarshalOrPanic(pb proto.Message) []byte

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)

func NewSignatureHeaderOrPanic

func NewSignatureHeaderOrPanic(signer crypto.LocalSigner) *cb.SignatureHeader

func SetTxID

func SetTxID(channelHeader *cb.ChannelHeader, signatureHeader *cb.SignatureHeader) error

func SignOrPanic

func SignOrPanic(signer crypto.LocalSigner, msg []byte) []byte

func UnmarshalBlock

func UnmarshalBlock(encoded []byte) (*cb.Block, error)

func UnmarshalBlockOrPanic

func UnmarshalBlockOrPanic(encoded []byte) *cb.Block

func UnmarshalChaincodeDeploymentSpec

func UnmarshalChaincodeDeploymentSpec(cdsBytes []byte) (*peer.ChaincodeDeploymentSpec, error)

func UnmarshalChaincodeID

func UnmarshalChaincodeID(bytes []byte) (*pb.ChaincodeID, error)

func UnmarshalChannelHeader

func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error)

func UnmarshalChannelHeaderOrPanic

func UnmarshalChannelHeaderOrPanic(bytes []byte) *cb.ChannelHeader

func UnmarshalEnvelope

func UnmarshalEnvelope(encoded []byte) (*cb.Envelope, error)

func UnmarshalEnvelopeOfType

func UnmarshalEnvelopeOfType(envelope *cb.Envelope, headerType cb.HeaderType, message proto.Message) (*cb.ChannelHeader, error)

func UnmarshalEnvelopeOrPanic

func UnmarshalEnvelopeOrPanic(encoded []byte) *cb.Envelope

func UnmarshalPayload

func UnmarshalPayload(encoded []byte) (*cb.Payload, error)

func UnmarshalPayloadOrPanic

func UnmarshalPayloadOrPanic(encoded []byte) *cb.Payload

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL