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

package lscc

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


Package Files

deployedcc_infoprovider.go errors.go lscc.go support.go


const (

    // INSTALL install command
    INSTALL = "install"

    // DEPLOY deploy command
    DEPLOY = "deploy"

    // UPGRADE upgrade chaincode
    UPGRADE = "upgrade"

    // CCEXISTS get chaincode
    CCEXISTS = "getid"

    // CHAINCODEEXISTS get chaincode alias
    CHAINCODEEXISTS = "ChaincodeExists"

    // GETDEPSPEC get ChaincodeDeploymentSpec
    GETDEPSPEC = "getdepspec"

    // GETDEPLOYMENTSPEC get ChaincodeDeploymentSpec alias
    GETDEPLOYMENTSPEC = "GetDeploymentSpec"

    // GETCCDATA get ChaincodeData
    GETCCDATA = "getccdata"

    // GETCHAINCODEDATA get ChaincodeData alias
    GETCHAINCODEDATA = "GetChaincodeData"

    // GETCHAINCODES gets the instantiated chaincodes on a channel
    GETCHAINCODES = "getchaincodes"

    // GETCHAINCODESALIAS gets the instantiated chaincodes on a channel
    GETCHAINCODESALIAS = "GetChaincodes"

    // GETINSTALLEDCHAINCODES gets the installed chaincodes on a peer
    GETINSTALLEDCHAINCODES = "getinstalledchaincodes"

    // GETINSTALLEDCHAINCODESALIAS gets the installed chaincodes on a peer

    // GETCOLLECTIONSCONFIG gets the collections config for a chaincode
    GETCOLLECTIONSCONFIG = "GetCollectionsConfig"

    // GETCOLLECTIONSCONFIGALIAS gets the collections config for a chaincode
    GETCOLLECTIONSCONFIGALIAS = "getcollectionsconfig"


var (
    ChaincodeNameRegExp    = regexp.MustCompile("^[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*$")
    ChaincodeVersionRegExp = regexp.MustCompile("^[A-Za-z0-9_.+-]+$")

type ChaincodeMismatchErr Uses

type ChaincodeMismatchErr string

ChaincodeMismatchErr chaincode name from two places don't match

func (ChaincodeMismatchErr) Error Uses

func (f ChaincodeMismatchErr) Error() string

type CollectionsConfigUpgradesNotAllowed Uses

type CollectionsConfigUpgradesNotAllowed string

CollectionsConfigUpgradesNotAllowed when V1_2 capability is not enabled

func (CollectionsConfigUpgradesNotAllowed) Error Uses

func (f CollectionsConfigUpgradesNotAllowed) Error() string

type DeployedCCInfoProvider Uses

type DeployedCCInfoProvider struct {

DeployedCCInfoProvider implements ineterface ledger.DeployedChaincodeInfoProvider

func (*DeployedCCInfoProvider) ChaincodeInfo Uses

func (p *DeployedCCInfoProvider) ChaincodeInfo(chaincodeName string, qe ledger.SimpleQueryExecutor) (*ledger.DeployedChaincodeInfo, error)

ChaincodeInfo implements function in interface ledger.DeployedChaincodeInfoProvider

func (*DeployedCCInfoProvider) CollectionInfo Uses

func (p *DeployedCCInfoProvider) CollectionInfo(chaincodeName, collectionName string, qe ledger.SimpleQueryExecutor) (*common.StaticCollectionConfig, error)

CollectionInfo implements function in interface ledger.DeployedChaincodeInfoProvider

func (*DeployedCCInfoProvider) Namespaces Uses

func (p *DeployedCCInfoProvider) Namespaces() []string

Namespaces implements function in interface ledger.DeployedChaincodeInfoProvider

func (*DeployedCCInfoProvider) UpdatedChaincodes Uses

func (p *DeployedCCInfoProvider) UpdatedChaincodes(stateUpdates map[string][]*kvrwset.KVWrite) ([]*ledger.ChaincodeLifecycleInfo, error)

UpdatedChaincodes implements function in interface ledger.DeployedChaincodeInfoProvider

type ExistsErr Uses

type ExistsErr string

ExistsErr chaincode exists error

func (ExistsErr) Error Uses

func (t ExistsErr) Error() string

type FilesystemSupport Uses

type FilesystemSupport interface {
    // PutChaincodeToLocalStorage stores the supplied chaincode
    // package to local storage (i.e. the file system)
    PutChaincodeToLocalStorage(ccprovider.CCPackage) error

    // GetChaincodeFromLocalStorage retrieves the chaincode package
    // for the requested chaincode, specified by name and version
    GetChaincodeFromLocalStorage(ccname string, ccversion string) (ccprovider.CCPackage, error)

    // GetChaincodesFromLocalStorage returns an array of all chaincode
    // data that have previously been persisted to local storage
    GetChaincodesFromLocalStorage() (*pb.ChaincodeQueryResponse, error)

    // GetInstantiationPolicy returns the instantiation policy for the
    // supplied chaincode (or the channel's default if none was specified)
    GetInstantiationPolicy(channel string, ccpack ccprovider.CCPackage) ([]byte, error)

    // CheckInstantiationPolicy checks whether the supplied signed proposal
    // complies with the supplied instantiation policy
    CheckInstantiationPolicy(signedProposal *pb.SignedProposal, chainName string, instantiationPolicy []byte) error

FilesystemSupport contains functions that LSCC requires to execute its tasks

type IdenticalVersionErr Uses

type IdenticalVersionErr string

IdenticalVersionErr trying to upgrade to same version of Chaincode

func (IdenticalVersionErr) Error Uses

func (f IdenticalVersionErr) Error() string

type InstantiationPolicyMissing Uses

type InstantiationPolicyMissing string

InstantiationPolicyMissing when no existing instantiation policy is found when upgrading CC

func (InstantiationPolicyMissing) Error Uses

func (f InstantiationPolicyMissing) Error() string

type InvalidArgsLenErr Uses

type InvalidArgsLenErr int

InvalidArgsLenErr invalid arguments length error

func (InvalidArgsLenErr) Error Uses

func (i InvalidArgsLenErr) Error() string

type InvalidCCOnFSError Uses

type InvalidCCOnFSError string

InvalidCCOnFSError error due to mismatch between fingerprint on lscc and installed CC

func (InvalidCCOnFSError) Error Uses

func (f InvalidCCOnFSError) Error() string

type InvalidChaincodeNameErr Uses

type InvalidChaincodeNameErr string

InvalidChaincodeNameErr invalid chaincode name error

func (InvalidChaincodeNameErr) Error Uses

func (f InvalidChaincodeNameErr) Error() string

type InvalidChannelNameErr Uses

type InvalidChannelNameErr string

InvalidChannelNameErr invalid channel name error

func (InvalidChannelNameErr) Error Uses

func (f InvalidChannelNameErr) Error() string

type InvalidDeploymentSpecErr Uses

type InvalidDeploymentSpecErr string

InvalidDeploymentSpecErr invalid chaincode deployment spec error

func (InvalidDeploymentSpecErr) Error Uses

func (f InvalidDeploymentSpecErr) Error() string

type InvalidFunctionErr Uses

type InvalidFunctionErr string

InvalidFunctionErr invalid function error

func (InvalidFunctionErr) Error Uses

func (f InvalidFunctionErr) Error() string

type InvalidStatedbArtifactsErr Uses

type InvalidStatedbArtifactsErr string

InvalidStatedbArtifactsErr invalid state database artifacts error

func (InvalidStatedbArtifactsErr) Error Uses

func (f InvalidStatedbArtifactsErr) Error() string

type InvalidVersionErr Uses

type InvalidVersionErr string

InvalidVersionErr invalid version error

func (InvalidVersionErr) Error Uses

func (f InvalidVersionErr) Error() string

type LifeCycleSysCC Uses

type LifeCycleSysCC struct {
    // aclProvider is responsible for access control evaluation
    ACLProvider aclmgmt.ACLProvider

    // SCCProvider is the interface which is passed into system chaincodes
    // to access other parts of the system
    SCCProvider sysccprovider.SystemChaincodeProvider

    // PolicyChecker is the interface used to perform
    // access control
    PolicyChecker policy.PolicyChecker

    // Support provides the implementation of several
    // static functions
    Support FilesystemSupport

    PlatformRegistry *platforms.Registry

LifeCycleSysCC implements chaincode lifecycle and policies around it

func New Uses

func New(sccp sysccprovider.SystemChaincodeProvider, ACLProvider aclmgmt.ACLProvider, platformRegistry *platforms.Registry) *LifeCycleSysCC

New creates a new instance of the LSCC Typically there is only one of these per peer

func (*LifeCycleSysCC) Chaincode Uses

func (lscc *LifeCycleSysCC) Chaincode() shim.Chaincode

func (*LifeCycleSysCC) ChaincodeContainerInfo Uses

func (lscc *LifeCycleSysCC) ChaincodeContainerInfo(chaincodeName string, qe ledger.QueryExecutor) (*ccprovider.ChaincodeContainerInfo, error)

func (*LifeCycleSysCC) ChaincodeDefinition Uses

func (lscc *LifeCycleSysCC) ChaincodeDefinition(chaincodeName string, qe ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)

func (*LifeCycleSysCC) Enabled Uses

func (lscc *LifeCycleSysCC) Enabled() bool

func (*LifeCycleSysCC) Init Uses

func (lscc *LifeCycleSysCC) Init(stub shim.ChaincodeStubInterface) pb.Response

Init is mostly useless for SCC

func (*LifeCycleSysCC) InitArgs Uses

func (lscc *LifeCycleSysCC) InitArgs() [][]byte

func (*LifeCycleSysCC) InvokableCC2CC Uses

func (lscc *LifeCycleSysCC) InvokableCC2CC() bool

func (*LifeCycleSysCC) InvokableExternal Uses

func (lscc *LifeCycleSysCC) InvokableExternal() bool

func (*LifeCycleSysCC) Invoke Uses

func (lscc *LifeCycleSysCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response

Invoke implements lifecycle functions "deploy", "start", "stop", "upgrade". Deploy's arguments - {[]byte("deploy"), []byte(<chainname>), <unmarshalled pb.ChaincodeDeploymentSpec>}

Invoke also implements some query-like functions Get chaincode arguments - {[]byte("getid"), []byte(<chainname>), []byte(<chaincodename>)}

func (*LifeCycleSysCC) Name Uses

func (lscc *LifeCycleSysCC) Name() string

func (*LifeCycleSysCC) Path Uses

func (lscc *LifeCycleSysCC) Path() string

type MarshallErr Uses

type MarshallErr string

MarshallErr error marshaling/unmarshalling

func (MarshallErr) Error Uses

func (m MarshallErr) Error() string

type NotFoundErr Uses

type NotFoundErr string

NotFoundErr chaincode not registered with LSCC error

func (NotFoundErr) Error Uses

func (t NotFoundErr) Error() string

type PrivateChannelDataNotAvailable Uses

type PrivateChannelDataNotAvailable string

PrivateChannelDataNotAvailable when V1_2 or later capability is not enabled

func (PrivateChannelDataNotAvailable) Error Uses

func (f PrivateChannelDataNotAvailable) Error() string

type TXNotFoundErr Uses

type TXNotFoundErr string

TXNotFoundErr transaction not found error

func (TXNotFoundErr) Error Uses

func (t TXNotFoundErr) Error() string


mockCode generated by counterfeiter.

Package lscc imports 26 packages (graph) and is imported by 15 packages. Updated 2019-07-12. Refresh now. Tools for package owners.