...

Package lscc

import "github.com/hyperledger/fabric/core/scc/lscc"
Overview
Index
Subdirectories

Overview ▾

Index ▾

Constants
Variables
type ChaincodeMismatchErr
    func (f ChaincodeMismatchErr) Error() string
type CollectionsConfigUpgradesNotAllowed
    func (f CollectionsConfigUpgradesNotAllowed) Error() string
type DeployedCCInfoProvider
    func (p *DeployedCCInfoProvider) ChaincodeInfo(chaincodeName string, qe ledger.SimpleQueryExecutor) (*ledger.DeployedChaincodeInfo, error)
    func (p *DeployedCCInfoProvider) CollectionInfo(chaincodeName, collectionName string, qe ledger.SimpleQueryExecutor) (*common.StaticCollectionConfig, error)
    func (p *DeployedCCInfoProvider) Namespaces() []string
    func (p *DeployedCCInfoProvider) UpdatedChaincodes(stateUpdates map[string][]*kvrwset.KVWrite) ([]*ledger.ChaincodeLifecycleInfo, error)
type ExistsErr
    func (t ExistsErr) Error() string
type FilesystemSupport
type IdenticalVersionErr
    func (f IdenticalVersionErr) Error() string
type InstantiationPolicyMissing
    func (f InstantiationPolicyMissing) Error() string
type InvalidArgsLenErr
    func (i InvalidArgsLenErr) Error() string
type InvalidCCOnFSError
    func (f InvalidCCOnFSError) Error() string
type InvalidChaincodeNameErr
    func (f InvalidChaincodeNameErr) Error() string
type InvalidChannelNameErr
    func (f InvalidChannelNameErr) Error() string
type InvalidDeploymentSpecErr
    func (f InvalidDeploymentSpecErr) Error() string
type InvalidFunctionErr
    func (f InvalidFunctionErr) Error() string
type InvalidStatedbArtifactsErr
    func (f InvalidStatedbArtifactsErr) Error() string
type InvalidVersionErr
    func (f InvalidVersionErr) Error() string
type LifeCycleSysCC
    func New(sccp sysccprovider.SystemChaincodeProvider, ACLProvider aclmgmt.ACLProvider, platformRegistry *platforms.Registry) *LifeCycleSysCC
    func (lscc *LifeCycleSysCC) Chaincode() shim.Chaincode
    func (lscc *LifeCycleSysCC) ChaincodeContainerInfo(chaincodeName string, qe ledger.QueryExecutor) (*ccprovider.ChaincodeContainerInfo, error)
    func (lscc *LifeCycleSysCC) ChaincodeDefinition(chaincodeName string, qe ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)
    func (lscc *LifeCycleSysCC) Enabled() bool
    func (lscc *LifeCycleSysCC) Init(stub shim.ChaincodeStubInterface) pb.Response
    func (lscc *LifeCycleSysCC) InitArgs() [][]byte
    func (lscc *LifeCycleSysCC) InvokableCC2CC() bool
    func (lscc *LifeCycleSysCC) InvokableExternal() bool
    func (lscc *LifeCycleSysCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response
    func (lscc *LifeCycleSysCC) Name() string
    func (lscc *LifeCycleSysCC) Path() string
type MarshallErr
    func (m MarshallErr) Error() string
type NotFoundErr
    func (t NotFoundErr) Error() string
type PrivateChannelDataNotAvailable
    func (f PrivateChannelDataNotAvailable) Error() string
type TXNotFoundErr
    func (t TXNotFoundErr) Error() string

Package files

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

Constants

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
    GETINSTALLEDCHAINCODESALIAS = "GetInstalledChaincodes"

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

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

Variables

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

type ChaincodeMismatchErr

ChaincodeMismatchErr chaincode name from two places don't match

type ChaincodeMismatchErr string

func (ChaincodeMismatchErr) Error

func (f ChaincodeMismatchErr) Error() string

type CollectionsConfigUpgradesNotAllowed

CollectionsConfigUpgradesNotAllowed when V1_2 capability is not enabled

type CollectionsConfigUpgradesNotAllowed string

func (CollectionsConfigUpgradesNotAllowed) Error

func (f CollectionsConfigUpgradesNotAllowed) Error() string

type DeployedCCInfoProvider

DeployedCCInfoProvider implements ineterface ledger.DeployedChaincodeInfoProvider

type DeployedCCInfoProvider struct {
}

func (*DeployedCCInfoProvider) ChaincodeInfo

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

ChaincodeInfo implements function in interface ledger.DeployedChaincodeInfoProvider

func (*DeployedCCInfoProvider) CollectionInfo

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

CollectionInfo implements function in interface ledger.DeployedChaincodeInfoProvider

func (*DeployedCCInfoProvider) Namespaces

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

Namespaces implements function in interface ledger.DeployedChaincodeInfoProvider

func (*DeployedCCInfoProvider) UpdatedChaincodes

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

UpdatedChaincodes implements function in interface ledger.DeployedChaincodeInfoProvider

type ExistsErr

ExistsErr chaincode exists error

type ExistsErr string

func (ExistsErr) Error

func (t ExistsErr) Error() string

type FilesystemSupport

FilesystemSupport contains functions that LSCC requires to execute its tasks

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
}

type IdenticalVersionErr

IdenticalVersionErr trying to upgrade to same version of Chaincode

type IdenticalVersionErr string

func (IdenticalVersionErr) Error

func (f IdenticalVersionErr) Error() string

type InstantiationPolicyMissing

InstantiationPolicyMissing when no existing instantiation policy is found when upgrading CC

type InstantiationPolicyMissing string

func (InstantiationPolicyMissing) Error

func (f InstantiationPolicyMissing) Error() string

type InvalidArgsLenErr

InvalidArgsLenErr invalid arguments length error

type InvalidArgsLenErr int

func (InvalidArgsLenErr) Error

func (i InvalidArgsLenErr) Error() string

type InvalidCCOnFSError

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

type InvalidCCOnFSError string

func (InvalidCCOnFSError) Error

func (f InvalidCCOnFSError) Error() string

type InvalidChaincodeNameErr

InvalidChaincodeNameErr invalid chaincode name error

type InvalidChaincodeNameErr string

func (InvalidChaincodeNameErr) Error

func (f InvalidChaincodeNameErr) Error() string

type InvalidChannelNameErr

InvalidChannelNameErr invalid channel name error

type InvalidChannelNameErr string

func (InvalidChannelNameErr) Error

func (f InvalidChannelNameErr) Error() string

type InvalidDeploymentSpecErr

InvalidDeploymentSpecErr invalid chaincode deployment spec error

type InvalidDeploymentSpecErr string

func (InvalidDeploymentSpecErr) Error

func (f InvalidDeploymentSpecErr) Error() string

type InvalidFunctionErr

InvalidFunctionErr invalid function error

type InvalidFunctionErr string

func (InvalidFunctionErr) Error

func (f InvalidFunctionErr) Error() string

type InvalidStatedbArtifactsErr

InvalidStatedbArtifactsErr invalid state database artifacts error

type InvalidStatedbArtifactsErr string

func (InvalidStatedbArtifactsErr) Error

func (f InvalidStatedbArtifactsErr) Error() string

type InvalidVersionErr

InvalidVersionErr invalid version error

type InvalidVersionErr string

func (InvalidVersionErr) Error

func (f InvalidVersionErr) Error() string

type LifeCycleSysCC

LifeCycleSysCC implements chaincode lifecycle and policies around it

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
}

func New

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

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

func (*LifeCycleSysCC) ChaincodeContainerInfo

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

func (*LifeCycleSysCC) ChaincodeDefinition

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

func (*LifeCycleSysCC) Enabled

func (lscc *LifeCycleSysCC) Enabled() bool

func (*LifeCycleSysCC) Init

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

Init is mostly useless for SCC

func (*LifeCycleSysCC) InitArgs

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

func (*LifeCycleSysCC) InvokableCC2CC

func (lscc *LifeCycleSysCC) InvokableCC2CC() bool

func (*LifeCycleSysCC) InvokableExternal

func (lscc *LifeCycleSysCC) InvokableExternal() bool

func (*LifeCycleSysCC) Invoke

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

func (lscc *LifeCycleSysCC) Name() string

func (*LifeCycleSysCC) Path

func (lscc *LifeCycleSysCC) Path() string

type MarshallErr

MarshallErr error marshaling/unmarshalling

type MarshallErr string

func (MarshallErr) Error

func (m MarshallErr) Error() string

type NotFoundErr

NotFoundErr chaincode not registered with LSCC error

type NotFoundErr string

func (NotFoundErr) Error

func (t NotFoundErr) Error() string

type PrivateChannelDataNotAvailable

PrivateChannelDataNotAvailable when V1_2 or later capability is not enabled

type PrivateChannelDataNotAvailable string

func (PrivateChannelDataNotAvailable) Error

func (f PrivateChannelDataNotAvailable) Error() string

type TXNotFoundErr

TXNotFoundErr transaction not found error

type TXNotFoundErr string

func (TXNotFoundErr) Error

func (t TXNotFoundErr) Error() string

Subdirectories

Name Synopsis
..
mock Code generated by counterfeiter.