fab

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const EmptyTransactionID = TransactionID("")

EmptyTransactionID represents a non-existing transaction (usually due to error).

View Source
const SystemChannel = ""

SystemChannel is the Fabric channel for managaing resources.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChaincodeInvokeRequest

type ChaincodeInvokeRequest struct {
	ChaincodeID  string
	TransientMap map[string][]byte
	Fcn          string
	Args         [][]byte
}

ChaincodeInvokeRequest contains the parameters for sending a transaction proposal.

type ProcessProposalRequest

type ProcessProposalRequest struct {
	SignedProposal *pb.SignedProposal
}

ProcessProposalRequest requests simulation of a proposed transaction from transaction processors.

type ProposalProcessor

type ProposalProcessor interface {
	ProcessTransactionProposal(reqContext.Context, ProcessProposalRequest) (*TransactionProposalResponse, error)
}

ProposalProcessor simulates transaction proposal, so that a client can submit the result for ordering.

type ProposalSender

type ProposalSender interface {
	CreateTransactionHeader(opts ...TxnHeaderOpt) (TransactionHeader, error)
	SendTransactionProposal(*TransactionProposal, []ProposalProcessor) ([]*TransactionProposalResponse, error)
}

ProposalSender provides the ability for a transaction proposal to be created and sent.

type TransactionHeader

type TransactionHeader interface {
	TransactionID() TransactionID
	Creator() []byte
	Nonce() []byte
	ChannelID() string
}

TransactionHeader provides a handle to transaction metadata.

type TransactionID

type TransactionID string

TransactionID provides the identifier of a Fabric transaction proposal.

type TransactionProposal

type TransactionProposal struct {
	TxnID TransactionID
	*pb.Proposal
}

TransactionProposal contains a marashalled transaction proposal.

type TransactionProposalResponse

type TransactionProposalResponse struct {
	Endorser string
	// Status is the EndorserStatus
	Status int32
	// ChaincodeStatus is the status returned by Chaincode
	ChaincodeStatus int32
	*pb.ProposalResponse
}

TransactionProposalResponse respresents the result of transaction proposal processing.

type TxnHeaderOpt

type TxnHeaderOpt func(*TxnHeaderOptions)

TxnHeaderOpt is a Transaction Header option

func WithCreator

func WithCreator(creator []byte) TxnHeaderOpt

WithCreator specifies the creator to use when creating the Transaction Header

func WithNonce

func WithNonce(nonce []byte) TxnHeaderOpt

WithNonce specifies the nonce to use when creating the Transaction Header

type TxnHeaderOptions

type TxnHeaderOptions struct {
	Nonce   []byte
	Creator []byte
}

TxnHeaderOptions contains options for creating a Transaction Header

Jump to

Keyboard shortcuts

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