scc

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginConfig added in v1.1.1

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 added in v1.3.0

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

Provider implements sysccprovider.SystemChaincodeProvider

func NewProvider added in v1.3.0

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

NewProvider creates a new Provider instance

func (*Provider) DeDeploySysCCs added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

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

GetQueryExecutorForLedger returns a query executor for the specified channel

func (*Provider) IsSysCC added in v1.3.0

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

IsSysCC returns true if the supplied chaincode is a system chaincode

func (*Provider) IsSysCCAndNotInvokableCC2CC added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

func (p *Provider) RegisterSysCC(scc *SystemChaincode)

RegisterSysCC registers a system chaincode with the syscc provider.

type Registrar added in v1.3.0

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 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 can be invoked to create 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

func CreateSysCCs

func CreateSysCCs(ccp ccprovider.ChaincodeProvider, p *Provider, aclProvider aclmgmt.ACLProvider) []*SystemChaincode

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

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.

Jump to

Keyboard shortcuts

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