sysccprovider

package
v0.0.0-...-99016a9 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSystemChaincodeProviderFactory

func RegisterSystemChaincodeProviderFactory(sccfact SystemChaincodeProviderFactory)

RegisterSystemChaincodeProviderFactory is to be called once to set the factory that will be used to obtain instances of ChaincodeProvider

Types

type ChaincodeInstance

type ChaincodeInstance struct {
	ChainID          string
	ChaincodeName    string
	ChaincodeVersion string
}

ChaincodeInstance is unique identifier of chaincode instance

func (*ChaincodeInstance) String

func (ci *ChaincodeInstance) String() string

type SystemChaincodeProvider

type SystemChaincodeProvider interface {
	// IsSysCC returns true if the supplied chaincode is a system chaincode
	IsSysCC(name string) bool

	// IsSysCCAndNotInvokableCC2CC returns true if the supplied chaincode
	// is a system chaincode and is not invokable through a cc2cc invocation
	IsSysCCAndNotInvokableCC2CC(name string) bool

	// IsSysCCAndNotInvokable returns true if the supplied chaincode
	// is a system chaincode and is not invokable through a proposal
	IsSysCCAndNotInvokableExternal(name string) bool

	// GetQueryExecutorForLedger returns a query executor for the
	// ledger of the supplied channel.
	// That's useful for system chaincodes that require unfettered
	// access to the ledger
	GetQueryExecutorForLedger(cid string) (ledger.QueryExecutor, error)
}

SystemChaincodeProvider provides an abstraction layer that is used for different packages to interact with code in the system chaincode package without importing it; more methods should be added below if necessary

func GetSystemChaincodeProvider

func GetSystemChaincodeProvider() SystemChaincodeProvider

GetSystemChaincodeProvider returns instances of SystemChaincodeProvider; the actual implementation is controlled by the factory that is registered via RegisterSystemChaincodeProviderFactory

type SystemChaincodeProviderFactory

type SystemChaincodeProviderFactory interface {
	NewSystemChaincodeProvider() SystemChaincodeProvider
}

SystemChaincodeProviderFactory defines a factory interface so that the actual implementation can be injected

Jump to

Keyboard shortcuts

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