scc

package
v0.0.0-...-6bf75d6 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginConfig

type PluginConfig struct {
	Enabled           bool   `mapstructure:"enabled" yaml:"enabled"`
	Name              string `mapstructure:"name" yaml:"name"`
	Path              string `mapstructure:"path" yaml:"path"`
	InvokableExternal bool   `mapstructure:"invokableExternal" yaml:"invokableExternal"`
	InvokableCC2CC    bool   `mapstructure:"invokableCC2CC" yaml:"invokableCC2CC"`
}

PluginConfig SCC plugin configuration

type Provider

type Provider struct {
	Peer        peer.Operations
	PeerSupport peer.Support
	Registrar   Registrar
	SysCCs      []SelfDescribingSysCC
}

Provider implements sysccprovider.SystemChaincodeProvider

func NewProvider

func NewProvider(pOps peer.Operations, pSup peer.Support, r Registrar) *Provider

NewProvider creates a new Provider instance

func (*Provider) DeDeploySysCCs

func (p *Provider) DeDeploySysCCs(chainID string, ccp ccprovider.ChaincodeProvider)

DeDeploySysCCs is used in unit tests to stop and remove the system chaincodes before restarting them in the same process. This allows clean start of the system in the same process

func (*Provider) DeploySysCCs

func (p *Provider) DeploySysCCs(chainID string, ccp ccprovider.ChaincodeProvider)

DeploySysCCs is the hook for system chaincodes where system chaincodes are registered with the fabric note the chaincode must still be deployed and launched like a user chaincode will be

func (*Provider) GetApplicationConfig

func (p *Provider) GetApplicationConfig(cid string) (channelconfig.Application, bool)

GetApplicationConfig returns the configtxapplication.SharedConfig for the channel and whether the Application config exists

func (*Provider) GetQueryExecutorForLedger

func (p *Provider) GetQueryExecutorForLedger(cid string) (ledger.QueryExecutor, error)

GetQueryExecutorForLedger returns a query executor for the specified channel

func (*Provider) IsSysCC

func (p *Provider) IsSysCC(name string) bool

IsSysCC returns true if the supplied chaincode is a system chaincode

func (*Provider) IsSysCCAndNotInvokableCC2CC

func (p *Provider) IsSysCCAndNotInvokableCC2CC(name string) bool

IsSysCCAndNotInvokableCC2CC returns true if the chaincode is a system chaincode and *CANNOT* be invoked through a cc2cc invocation

func (*Provider) IsSysCCAndNotInvokableExternal

func (p *Provider) IsSysCCAndNotInvokableExternal(name string) bool

IsSysCCAndNotInvokableExternal returns true if the chaincode is a system chaincode and *CANNOT* be invoked through a proposal to this peer

func (*Provider) PolicyManager

func (p *Provider) PolicyManager(channelID string) (policies.Manager, bool)

Returns the policy manager associated to the passed channel and whether the policy manager exists

func (*Provider) RegisterSysCC

func (p *Provider) RegisterSysCC(scc SelfDescribingSysCC)

RegisterSysCC registers a system chaincode with the syscc provider.

type Registrar

type Registrar interface {
	// Register registers a system chaincode
	Register(ccid *ccintf.CCID, cc shim.Chaincode) error
}

Registrar provides a way for system chaincodes to be registered

type SelfDescribingSysCC

type SelfDescribingSysCC interface {
	//Unique name of the system chaincode
	Name() string

	//Path to the system chaincode; currently not used
	Path() string

	//InitArgs initialization arguments to startup the system chaincode
	InitArgs() [][]byte

	// Chaincode returns the underlying chaincode
	Chaincode() shim.Chaincode

	// InvokableExternal keeps track of whether
	// this system chaincode can be invoked
	// through a proposal sent to this peer
	InvokableExternal() bool

	// InvokableCC2CC keeps track of whether
	// this system chaincode can be invoked
	// by way of a chaincode-to-chaincode
	// invocation
	InvokableCC2CC() bool

	// Enabled a convenient switch to enable/disable system chaincode without
	// having to remove entry from importsysccs.go
	Enabled() bool
}

func CreatePluginSysCCs

func CreatePluginSysCCs(p *Provider) []SelfDescribingSysCC

CreatePluginSysCCs creates all of the system chaincodes which are compiled into fabric

type SysCCWrapper

type SysCCWrapper struct {
	SCC *SystemChaincode
}

func (*SysCCWrapper) Chaincode

func (sccw *SysCCWrapper) Chaincode() shim.Chaincode

func (*SysCCWrapper) Enabled

func (sccw *SysCCWrapper) Enabled() bool

func (*SysCCWrapper) InitArgs

func (sccw *SysCCWrapper) InitArgs() [][]byte

func (*SysCCWrapper) InvokableCC2CC

func (sccw *SysCCWrapper) InvokableCC2CC() bool

func (*SysCCWrapper) InvokableExternal

func (sccw *SysCCWrapper) InvokableExternal() bool

func (*SysCCWrapper) Name

func (sccw *SysCCWrapper) Name() string

func (*SysCCWrapper) Path

func (sccw *SysCCWrapper) Path() string

type SystemChaincode

type SystemChaincode struct {
	//Unique name of the system chaincode
	Name string

	//Path to the system chaincode; currently not used
	Path string

	//InitArgs initialization arguments to startup the system chaincode
	InitArgs [][]byte

	// Chaincode holds the actual chaincode instance
	Chaincode shim.Chaincode

	// InvokableExternal keeps track of whether
	// this system chaincode can be invoked
	// through a proposal sent to this peer
	InvokableExternal bool

	// InvokableCC2CC keeps track of whether
	// this system chaincode can be invoked
	// by way of a chaincode-to-chaincode
	// invocation
	InvokableCC2CC bool

	// Enabled a convenient switch to enable/disable system chaincode without
	// having to remove entry from importsysccs.go
	Enabled bool
}

SystemChaincode defines the metadata needed to initialize system chaincode when the fabric comes up. SystemChaincodes are installed by adding an entry in importsysccs.go

Directories

Path Synopsis
Package cscc chaincode configer provides functions to manage configuration transactions as the network is being reconfigured.
Package cscc chaincode configer provides functions to manage configuration transactions as the network is being reconfigured.
mock
Code generated by counterfeiter.
Code generated by counterfeiter.
mock
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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