fabric: github.com/hyperledger/fabric/core/scc Index | Files | Directories

package scc

import "github.com/hyperledger/fabric/core/scc"

Index

Package Files

importsysccs.go loadsysccs.go register.go sccproviderimpl.go sysccapi.go

type PluginConfig Uses

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 Uses

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

Provider implements sysccprovider.SystemChaincodeProvider

func NewProvider Uses

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

NewProvider creates a new Provider instance

func (*Provider) DeDeploySysCCs Uses

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 Uses

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 Uses

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 Uses

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

GetQueryExecutorForLedger returns a query executor for the specified channel

func (*Provider) IsSysCC Uses

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

IsSysCC returns true if the supplied chaincode is a system chaincode

func (*Provider) IsSysCCAndNotInvokableCC2CC Uses

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 Uses

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 Uses

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 Uses

func (p *Provider) RegisterSysCC(scc SelfDescribingSysCC)

RegisterSysCC registers a system chaincode with the syscc provider.

type Registrar Uses

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 Uses

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 Uses

func CreatePluginSysCCs(p *Provider) []SelfDescribingSysCC

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

type SysCCWrapper Uses

type SysCCWrapper struct {
    SCC *SystemChaincode
}

func (*SysCCWrapper) Chaincode Uses

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

func (*SysCCWrapper) Enabled Uses

func (sccw *SysCCWrapper) Enabled() bool

func (*SysCCWrapper) InitArgs Uses

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

func (*SysCCWrapper) InvokableCC2CC Uses

func (sccw *SysCCWrapper) InvokableCC2CC() bool

func (*SysCCWrapper) InvokableExternal Uses

func (sccw *SysCCWrapper) InvokableExternal() bool

func (*SysCCWrapper) Name Uses

func (sccw *SysCCWrapper) Name() string

func (*SysCCWrapper) Path Uses

func (sccw *SysCCWrapper) Path() string

type SystemChaincode Uses

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

PathSynopsis
csccPackage cscc chaincode configer provides functions to manage configuration transactions as the network is being reconfigured.
cscc/mockCode generated by counterfeiter.
lscc
lscc/mockCode generated by counterfeiter.
qscc

Package scc imports 19 packages (graph) and is imported by 14 packages. Updated 2019-07-12. Refresh now. Tools for package owners.