endorser

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: 34 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCCEventBytes

func CreateCCEventBytes(ccevent *pb.ChaincodeEvent) ([]byte, error)

func JavaEnabled

func JavaEnabled() bool

Types

type Channel

type Channel struct {
	IdentityDeserializer msp.IdentityDeserializer
}

type ChannelFetcher

type ChannelFetcher interface {
	Channel(channelID string) *Channel
}

type ChannelState

type ChannelState struct {
	transientstore.Store
	QueryCreator
}

func (*ChannelState) FetchState

func (cs *ChannelState) FetchState() (endorsement.State, error)

type ChannelStateRetriever

type ChannelStateRetriever interface {
	NewQueryCreator(channel string) (QueryCreator, error)
}

type CollectionConfigRetriever

type CollectionConfigRetriever interface {
	GetState(namespace string, key string) ([]byte, error)
}

type Context

type Context struct {
	PluginName     string
	Channel        string
	TxID           string
	Proposal       *pb.Proposal
	SignedProposal *pb.SignedProposal
	Visibility     []byte
	Response       *pb.Response
	Event          []byte
	ChaincodeID    *pb.ChaincodeID
	SimRes         []byte
}

func (Context) String

func (c Context) String() string

type Endorser

type Endorser struct {
	ChannelFetcher         ChannelFetcher
	LocalMSP               msp.IdentityDeserializer
	PrivateDataDistributor PrivateDataDistributor
	Support                Support
	PvtRWSetAssembler      PvtRWSetAssembler
	Metrics                *Metrics
}

func (*Endorser) ProcessProposal

func (e *Endorser) ProcessProposal(ctx context.Context, signedProp *pb.SignedProposal) (*pb.ProposalResponse, error)

func (*Endorser) ProcessProposalSuccessfullyOrError

func (e *Endorser) ProcessProposalSuccessfullyOrError(up *UnpackedProposal) (*pb.ProposalResponse, error)

func (*Endorser) SimulateProposal

func (e *Endorser) SimulateProposal(txParams *ccprovider.TransactionParams, chaincodeName string, chaincodeInput *pb.ChaincodeInput) (*pb.Response, []byte, *pb.ChaincodeEvent, error)

type MapBasedPluginMapper

type MapBasedPluginMapper map[string]endorsement.PluginFactory

func (MapBasedPluginMapper) PluginFactoryByName

func (m MapBasedPluginMapper) PluginFactoryByName(name PluginName) endorsement.PluginFactory

type Metrics

type Metrics struct {
	ProposalDuration         metrics.Histogram
	ProposalsReceived        metrics.Counter
	SuccessfulProposals      metrics.Counter
	ProposalValidationFailed metrics.Counter
	ProposalACLCheckFailed   metrics.Counter
	InitFailed               metrics.Counter
	EndorsementsFailed       metrics.Counter
	DuplicateTxsFailure      metrics.Counter
}

func NewMetrics

func NewMetrics(p metrics.Provider) *Metrics

type PeerOperations

type PeerOperations interface {
	GetApplicationConfig(cid string) (channelconfig.Application, bool)
	GetLedger(cid string) ledger.PeerLedger
}

type PluginEndorser

type PluginEndorser struct {
	sync.Mutex
	PluginMapper

	ChannelStateRetriever
	endorsement3.SigningIdentityFetcher
	TransientStoreRetriever
	// contains filtered or unexported fields
}

func NewPluginEndorser

func NewPluginEndorser(ps *PluginSupport) *PluginEndorser

func (*PluginEndorser) EndorseWithPlugin

func (pe *PluginEndorser) EndorseWithPlugin(pluginName, channelID string, prpBytes []byte, signedProposal *pb.SignedProposal) (*pb.Endorsement, []byte, error)

type PluginMapper

type PluginMapper interface {
	PluginFactoryByName(name PluginName) endorsement.PluginFactory
}

type PluginName

type PluginName string

type PrivateDataDistributor

type PrivateDataDistributor interface {
	DistributePrivateData(channel string, txID string, privateData *transientstore.TxPvtReadWriteSetWithConfigInfo, blkHt uint64) error
}

type PvtRWSetAssembler

type PvtRWSetAssembler interface {
	AssemblePvtRWSet(channelName string,
		privData *rwset.TxPvtReadWriteSet,
		txsim ledger.SimpleQueryExecutor,
		deployedCCInfoProvider ledger.DeployedChaincodeInfoProvider) (
		*transientstore.TxPvtReadWriteSetWithConfigInfo, error,
	)
}

type QueryCreator

type QueryCreator interface {
	NewQueryExecutor() (ledger.QueryExecutor, error)
}

type StateContext

type StateContext struct {
	transientstore.Store
	ledger.QueryExecutor
}

func (*StateContext) GetTransientByTXID

func (sc *StateContext) GetTransientByTXID(txID string) ([]*rwset.TxPvtReadWriteSet, error)

type Store

type Store interface {
	transientstore.Store
}

type Support

type Support interface {
	identity.SignerSerializer

	GetTxSimulator(ledgername string, txid string) (ledger.TxSimulator, error)

	GetHistoryQueryExecutor(ledgername string) (ledger.HistoryQueryExecutor, error)

	GetTransactionByID(chid, txID string) (*pb.ProcessedTransaction, error)

	IsSysCC(name string) bool

	Execute(txParams *ccprovider.TransactionParams, name string, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)

	ExecuteLegacyInit(txParams *ccprovider.TransactionParams, name, version string, spec *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)

	ChaincodeEndorsementInfo(channelID, chaincodeID string, txsim ledger.QueryExecutor) (*lifecycle.ChaincodeEndorsementInfo, error)

	CheckACL(channelID string, signedProp *pb.SignedProposal) error

	EndorseWithPlugin(pluginName, channnelID string, prpBytes []byte, signedProposal *pb.SignedProposal) (*pb.Endorsement, []byte, error)

	GetLedgerHeight(channelID string) (uint64, error)

	GetDeployedCCInfoProvider() ledger.DeployedChaincodeInfoProvider
}

type SupportImpl

type SupportImpl struct {
	*PluginEndorser
	identity.SignerSerializer
	Peer             PeerOperations
	ChaincodeSupport *chaincode.ChaincodeSupport
	ACLProvider      aclmgmt.ACLProvider
	BuiltinSCCs      scc.BuiltinSCCs
}

func (*SupportImpl) ChaincodeEndorsementInfo

func (s *SupportImpl) ChaincodeEndorsementInfo(channelID, chaincodeName string, txsim ledger.QueryExecutor) (*lifecycle.ChaincodeEndorsementInfo, error)

func (*SupportImpl) CheckACL

func (s *SupportImpl) CheckACL(channelID string, signedProp *pb.SignedProposal) error

func (*SupportImpl) Execute

func (s *SupportImpl) Execute(txParams *ccprovider.TransactionParams, name string, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)

func (*SupportImpl) ExecuteLegacyInit

func (s *SupportImpl) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, name, version string, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)

func (*SupportImpl) GetApplicationConfig

func (s *SupportImpl) GetApplicationConfig(cid string) (channelconfig.Application, bool)

func (*SupportImpl) GetDeployedCCInfoProvider

func (s *SupportImpl) GetDeployedCCInfoProvider() ledger.DeployedChaincodeInfoProvider

func (*SupportImpl) GetHistoryQueryExecutor

func (s *SupportImpl) GetHistoryQueryExecutor(ledgername string) (ledger.HistoryQueryExecutor, error)

func (*SupportImpl) GetLedgerHeight

func (s *SupportImpl) GetLedgerHeight(channelID string) (uint64, error)

func (*SupportImpl) GetTransactionByID

func (s *SupportImpl) GetTransactionByID(chid, txID string) (*pb.ProcessedTransaction, error)

func (*SupportImpl) GetTxSimulator

func (s *SupportImpl) GetTxSimulator(ledgername string, txid string) (ledger.TxSimulator, error)

func (*SupportImpl) IsSysCC

func (s *SupportImpl) IsSysCC(name string) bool

func (*SupportImpl) NewQueryCreator

func (s *SupportImpl) NewQueryCreator(channel string) (QueryCreator, error)

func (*SupportImpl) SigningIdentityForRequest

func (s *SupportImpl) SigningIdentityForRequest(*pb.SignedProposal) (endorsement.SigningIdentity, error)

type TransientStoreRetriever

type TransientStoreRetriever interface {
	StoreForChannel(channel string) transientstore.Store
}

type UnpackedProposal

type UnpackedProposal struct {
	ChaincodeName   string
	ChannelHeader   *cb.ChannelHeader
	Input           *pb.ChaincodeInput
	Proposal        *pb.Proposal
	SignatureHeader *cb.SignatureHeader
	SignedProposal  *pb.SignedProposal
	ProposalHash    []byte
}

func UnpackProposal

func UnpackProposal(signedProp *pb.SignedProposal) (*UnpackedProposal, error)

func (*UnpackedProposal) ChannelID

func (up *UnpackedProposal) ChannelID() string

func (*UnpackedProposal) TxID

func (up *UnpackedProposal) TxID() string

func (*UnpackedProposal) Validate

func (up *UnpackedProposal) Validate(idDeserializer msp.IdentityDeserializer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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