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

package cclifecycle

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

Index

Package Files

lifecycle.go subscription.go util.go

Variables

var (
    // Logger is the logging instance for this package.
    // It's exported because the tests override its backend
    Logger = flogging.MustGetLogger("discovery.lifecycle")
)

func DeployedChaincodes Uses

func DeployedChaincodes(q Query, filter ChaincodePredicate, loadCollections bool, chaincodes ...string) (chaincode.MetadataSet, error)

DeployedChaincodes retrieves the metadata of the given deployed chaincodes

type ChaincodePredicate Uses

type ChaincodePredicate func(cc chaincode.Metadata) bool

ChaincodePredicate accepts or rejects chaincode based on its metadata

var (
    // AcceptAll returns a predicate that accepts all Metadata
    AcceptAll ChaincodePredicate = func(cc chaincode.Metadata) bool {
        return true
    }
)

type EnumerateFunc Uses

type EnumerateFunc func() ([]chaincode.InstalledChaincode, error)

EnumerateFunc enumerates installed chaincodes

func (EnumerateFunc) Enumerate Uses

func (enumerate EnumerateFunc) Enumerate() ([]chaincode.InstalledChaincode, error)

Enumerate enumerates chaincodes

type Enumerator Uses

type Enumerator interface {
    // Enumerate returns the installed chaincodes
    Enumerate() ([]chaincode.InstalledChaincode, error)
}

Enumerator enumerates chaincodes

type HandleMetadataUpdateFunc Uses

type HandleMetadataUpdateFunc func(channel string, chaincodes chaincode.MetadataSet)

HandleMetadataUpdateFunc is triggered upon a change in the chaincode lifecycle

func (HandleMetadataUpdateFunc) HandleMetadataUpdate Uses

func (handleMetadataUpdate HandleMetadataUpdateFunc) HandleMetadataUpdate(channel string, chaincodes chaincode.MetadataSet)

HandleMetadataUpdate runs whenever there is a change to the metadata of a chaincode in the context of a specific channel

type MetadataChangeListener Uses

type MetadataChangeListener interface {
    HandleMetadataUpdate(channel string, chaincodes chaincode.MetadataSet)
}

MetadataChangeListener runs whenever there is a change to the metadata of a chaincode in the context of a specific channel

type MetadataManager Uses

type MetadataManager struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

MetadataManager manages information about lscc chaincodes.

func NewMetadataManager Uses

func NewMetadataManager(installedChaincodes Enumerator) (*MetadataManager, error)

NewMetadataManager creates a metadata manager for lscc chaincodes.

func (*MetadataManager) AddListener Uses

func (m *MetadataManager) AddListener(listener MetadataChangeListener)

AddListener registers the given listener to be triggered upon a lifecycle change

func (*MetadataManager) Metadata Uses

func (m *MetadataManager) Metadata(channel string, cc string, collections bool) *chaincode.Metadata

Metadata returns the metadata of the chaincode on the given channel, or nil if not found or an error occurred at retrieving it

func (*MetadataManager) NewChannelSubscription Uses

func (m *MetadataManager) NewChannelSubscription(channel string, queryCreator QueryCreator) (*Subscription, error)

NewChannelSubscription subscribes to a channel

type Query Uses

type Query interface {
    // GetState gets the value for given namespace and key. For a chaincode, the namespace corresponds to the chaincodeId
    GetState(namespace string, key string) ([]byte, error)

    // Done releases resources occupied by the QueryExecutor
    Done()
}

Query queries the state

type QueryCreator Uses

type QueryCreator interface {
    // NewQuery creates a new Query, or error on failure
    NewQuery() (Query, error)
}

QueryCreator creates queries

type QueryCreatorFunc Uses

type QueryCreatorFunc func() (Query, error)

QueryCreatorFunc creates a new query

func (QueryCreatorFunc) NewQuery Uses

func (queryCreator QueryCreatorFunc) NewQuery() (Query, error)

NewQuery creates a new Query, or error on failure

type Subscription Uses

type Subscription struct {
    sync.Mutex
    // contains filtered or unexported fields
}

Subscription channels information flow about a specific channel into the Lifecycle.

func (*Subscription) ChaincodeDeployDone Uses

func (sub *Subscription) ChaincodeDeployDone(succeeded bool)

ChaincodeDeployDone gets invoked when the chaincode deploy transaction or chaincode install (the context in which the above function was invoked).

func (*Subscription) HandleChaincodeDeploy Uses

func (sub *Subscription) HandleChaincodeDeploy(chaincodeDefinition *cceventmgmt.ChaincodeDefinition, dbArtifactsTar []byte) error

HandleChaincodeDeploy is expected to be invoked when a chaincode is deployed via a deploy transaction and the chaincode was already installed on the peer. This also gets invoked when an already deployed chaincode is installed on the peer.

Directories

PathSynopsis
mocks

Package cclifecycle imports 9 packages (graph) and is imported by 4 packages. Updated 2019-12-05. Refresh now. Tools for package owners.