Versions in this module Expand all Collapse all v1 v1.0.0 Jun 15, 2026 Changes in this version + const ApproveChaincodeDefinitionForMyOrgFuncName + const ChaincodeDefinitionType + const ChaincodeLocalPackageType + const ChaincodeParametersType + const ChaincodeSourcesName + const CheckCommitReadinessFuncName + const CommitChaincodeDefinitionFuncName + const DefaultEndorsementPolicyRef + const FieldsInfix + const FriendlyChaincodeDefinitionType + const InstallChaincodeFuncName + const LifecycleEndorsementPolicyRef + const LifecycleNamespace + const MetadataInfix + const NamespacesName + const QueryApprovedChaincodeDefinitionFuncName + const QueryChaincodeDefinitionFuncName + const QueryChaincodeDefinitionsFuncName + const QueryInstalledChaincodeFuncName + const QueryInstalledChaincodesFuncName + var ChaincodeNameRegExp = regexp.MustCompile("^[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*$") + var ChaincodeVersionRegExp = regexp.MustCompile("^[A-Za-z0-9_.+-]+$") + var DefaultEndorsementPolicyBytes = protoutil.MarshalOrPanic(&pb.ApplicationPolicy{ ... }) + var LifecycleDefaultEndorsementPolicyBytes = protoutil.MarshalOrPanic(&cb.ApplicationPolicy{ ... }) + var ProtoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem() + var SequenceMatcher = regexp.MustCompile("^" + NamespacesName + "/fields/([^/]+)/Sequence$") + func FieldKey(namespace, name, field string) string + func MetadataKey(namespace, name string) string + func StateIteratorToMap(itr StateIterator) (map[string][]byte, error) + type ApprovedChaincodeDefinition struct + Collections *pb.CollectionConfigPackage + EndorsementInfo *lb.ChaincodeEndorsementInfo + Sequence int64 + Source *lb.ChaincodeSource + ValidationInfo *lb.ChaincodeValidationInfo + type Cache struct + MetadataHandler MetadataHandler + MyOrgMSPID string + Resources *Resources + func NewCache(resources *Resources, myOrgMSPID string, metadataManager MetadataHandler, ...) *Cache + func (c *Cache) ChaincodeInfo(channelID, name string) (*LocalChaincodeInfo, error) + func (c *Cache) GetInstalledChaincode(packageID string) (*chaincode.InstalledChaincode, error) + func (c *Cache) HandleChaincodeInstalled(md *persistence.ChaincodePackageMetadata, packageID string) + func (c *Cache) HandleStateUpdates(trigger *ledger.StateUpdateTrigger) error + func (c *Cache) Initialize(channelID string, qe ledger.SimpleQueryExecutor) error + func (c *Cache) InitializeLocalChaincodes() error + func (c *Cache) InitializeMetadata(channel string) + func (c *Cache) InterestedInNamespaces() []string + func (c *Cache) ListInstalledChaincodes() []*chaincode.InstalledChaincode + func (c *Cache) Name() string + func (c *Cache) RegisterListener(channelID string, listener ledger.ChaincodeLifecycleEventListener, ...) error + func (c *Cache) StateCommitDone(channelName string) + type CachedChaincodeDefinition struct + Approved bool + Definition *ChaincodeDefinition + Hashes []string + InstallInfo *ChaincodeInstallInfo + type ChaincodeBuilder interface + Build func(ccid string) error + type ChaincodeCustodian struct + func NewChaincodeCustodian() *ChaincodeCustodian + func (cc *ChaincodeCustodian) Close() + func (cc *ChaincodeCustodian) NotifyInstalled(chaincodeID string) + func (cc *ChaincodeCustodian) NotifyInstalledAndRunnable(chaincodeID string) + func (cc *ChaincodeCustodian) NotifyStoppable(chaincodeID string) + func (cc *ChaincodeCustodian) Work(buildRegistry *container.BuildRegistry, builder ChaincodeBuilder, ...) + type ChaincodeDefinition struct + Collections *pb.CollectionConfigPackage + EndorsementInfo *lb.ChaincodeEndorsementInfo + Sequence int64 + ValidationInfo *lb.ChaincodeValidationInfo + func (cd *ChaincodeDefinition) Parameters() *ChaincodeParameters + func (cd *ChaincodeDefinition) String() string + type ChaincodeEndorsementInfo struct + ChaincodeID string + EndorsementPlugin string + EnforceInit bool + Version string + type ChaincodeEndorsementInfoSource struct + BuiltinSCCs scc.BuiltinSCCs + Cache ChaincodeInfoCache + LegacyImpl Lifecycle + Resources *Resources + UserRunsCC bool + func (cei *ChaincodeEndorsementInfoSource) CachedChaincodeInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*LocalChaincodeInfo, bool, error) + func (cei *ChaincodeEndorsementInfoSource) ChaincodeEndorsementInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ChaincodeEndorsementInfo, error) + type ChaincodeInfoCache interface + ChaincodeInfo func(channelID, chaincodeName string) (definition *LocalChaincodeInfo, err error) + type ChaincodeInfoProvider interface + ChaincodeInfo func(channelID, name string) (*LocalChaincodeInfo, error) + type ChaincodeInstallInfo struct + Label string + PackageID string + Path string + Type string + type ChaincodeLauncher interface + Launch func(ccid string) error + Stop func(ccid string) error + type ChaincodeLocalPackage struct + PackageID string + type ChaincodeParameters struct + Collections *pb.CollectionConfigPackage + EndorsementInfo *lb.ChaincodeEndorsementInfo + ValidationInfo *lb.ChaincodeValidationInfo + func (cp *ChaincodeParameters) Equal(ocp *ChaincodeParameters) error + type ChaincodePrivateLedgerShim struct + Collection string + Stub shim.ChaincodeStubInterface + func (cls *ChaincodePrivateLedgerShim) CollectionName() string + func (cls *ChaincodePrivateLedgerShim) DelState(key string) error + func (cls *ChaincodePrivateLedgerShim) GetState(key string) ([]byte, error) + func (cls *ChaincodePrivateLedgerShim) GetStateHash(key string) ([]byte, error) + func (cls *ChaincodePrivateLedgerShim) GetStateRange(prefix string) (map[string][]byte, error) + func (cls *ChaincodePrivateLedgerShim) PutState(key string, value []byte) error + type ChaincodePublicLedgerShim struct + func (cls *ChaincodePublicLedgerShim) GetStateRange(prefix string) (map[string][]byte, error) + type ChaincodeResultIteratorShim struct + ResultsIterator shim.StateQueryIteratorInterface + func (cris *ChaincodeResultIteratorShim) Close() error + func (cris *ChaincodeResultIteratorShim) Next() (*queryresult.KV, error) + type ChaincodeStore interface + Delete func(packageID string) error + ListInstalledChaincodes func() ([]chaincode.InstalledChaincode, error) + Load func(packageID string) (ccInstallPkg []byte, err error) + Save func(label string, ccInstallPkg []byte) (string, error) + type ChannelCache struct + Chaincodes map[string]*CachedChaincodeDefinition + InterestingHashes map[string]string + type ChannelConfigSource interface + GetStableChannelConfig func(channelID string) channelconfig.Resources + type ChannelPolicyReferenceProvider interface + NewPolicy func(channelID, channelConfigPolicyReference string) (policies.Policy, error) + type DummyQueryExecutorShim struct + func (*DummyQueryExecutorShim) GetState(key string) ([]byte, error) + type ErrNamespaceNotDefined struct + Namespace string + func (e ErrNamespaceNotDefined) Error() string + type EventBroker struct + func NewEventBroker(chaincodeStore ChaincodeStore, pkgParser PackageParser, ...) *EventBroker + func (b *EventBroker) ApproveOrDefineCommitted(channelID string) + func (b *EventBroker) ProcessApproveOrDefineEvent(channelID string, chaincodeName string, ...) + func (b *EventBroker) ProcessInstallEvent(localChaincode *LocalChaincode) + func (b *EventBroker) RegisterListener(channelID string, listener ledger.ChaincodeLifecycleEventListener, ...) + type ExternalFunctions struct + BuildLocks map[string]*sync.Mutex + BuildRegistry *container.BuildRegistry + ChaincodeBuilder ChaincodeBuilder + InstallListener InstallListener + InstalledChaincodesLister InstalledChaincodesLister + Resources *Resources + func (ef *ExternalFunctions) ApproveChaincodeDefinitionForOrg(chname, ccname string, cd *ChaincodeDefinition, packageID string, ...) error + func (ef *ExternalFunctions) CheckCommitReadiness(chname, ccname string, cd *ChaincodeDefinition, publicState ReadWritableState, ...) (map[string]bool, error) + func (ef *ExternalFunctions) CommitChaincodeDefinition(chname, ccname string, cd *ChaincodeDefinition, publicState ReadWritableState, ...) (map[string]bool, error) + func (ef *ExternalFunctions) DefaultEndorsementPolicyAsBytes(channelID string) ([]byte, error) + func (ef *ExternalFunctions) GetInstalledChaincodePackage(packageID string) ([]byte, error) + func (ef *ExternalFunctions) InstallChaincode(chaincodeInstallPackage []byte) (*chaincode.InstalledChaincode, error) + func (ef *ExternalFunctions) QueryApprovedChaincodeDefinition(chname, ccname string, sequence int64, publicState ReadableState, ...) (*ApprovedChaincodeDefinition, error) + func (ef *ExternalFunctions) QueryChaincodeDefinition(name string, publicState ReadableState) (*ChaincodeDefinition, error) + func (ef *ExternalFunctions) QueryInstalledChaincode(packageID string) (*chaincode.InstalledChaincode, error) + func (ef *ExternalFunctions) QueryInstalledChaincodes() []*chaincode.InstalledChaincode + func (ef *ExternalFunctions) QueryNamespaceDefinitions(publicState RangeableState) (map[string]string, error) + func (ef *ExternalFunctions) QueryOrgApprovals(name string, cd *ChaincodeDefinition, orgStates []OpaqueState) (map[string]bool, error) + func (ef *ExternalFunctions) SetChaincodeDefinitionDefaults(chname string, cd *ChaincodeDefinition) error + type HandleMetadataUpdateFunc func(channel string, metadata chaincode.MetadataSet) + func (handleMetadataUpdate HandleMetadataUpdateFunc) HandleMetadataUpdate(channel string, metadata chaincode.MetadataSet) + type InstallListener interface + HandleChaincodeInstalled func(md *persistence.ChaincodePackageMetadata, packageID string) + type InstalledChaincodesLister interface + GetInstalledChaincode func(packageID string) (*chaincode.InstalledChaincode, error) + ListInstalledChaincodes func() []*chaincode.InstalledChaincode + type Invocation struct + ApplicationConfig channelconfig.Application + ChannelID string + SCC *SCC + Stub shim.ChaincodeStubInterface + func (i *Invocation) ApproveChaincodeDefinitionForMyOrg(input *lb.ApproveChaincodeDefinitionForMyOrgArgs) (proto.Message, error) + func (i *Invocation) CheckCommitReadiness(input *lb.CheckCommitReadinessArgs) (proto.Message, error) + func (i *Invocation) CommitChaincodeDefinition(input *lb.CommitChaincodeDefinitionArgs) (proto.Message, error) + func (i *Invocation) GetInstalledChaincodePackage(input *lb.GetInstalledChaincodePackageArgs) (proto.Message, error) + func (i *Invocation) InstallChaincode(input *lb.InstallChaincodeArgs) (proto.Message, error) + func (i *Invocation) QueryApprovedChaincodeDefinition(input *lb.QueryApprovedChaincodeDefinitionArgs) (proto.Message, error) + func (i *Invocation) QueryChaincodeDefinition(input *lb.QueryChaincodeDefinitionArgs) (proto.Message, error) + func (i *Invocation) QueryChaincodeDefinitions(input *lb.QueryChaincodeDefinitionsArgs) (proto.Message, error) + func (i *Invocation) QueryInstalledChaincode(input *lb.QueryInstalledChaincodeArgs) (proto.Message, error) + func (i *Invocation) QueryInstalledChaincodes(input *lb.QueryInstalledChaincodesArgs) (proto.Message, error) + type LegacyDeployedCCInfoProvider interface + type LegacyMetadataProvider interface + Metadata func(channel string, cc string, collections ...string) *chaincode.Metadata + type Lifecycle interface + ChaincodeEndorsementInfo func(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ChaincodeEndorsementInfo, error) + type LocalChaincode struct + Info *ChaincodeInstallInfo + References map[string]map[string]*CachedChaincodeDefinition + func (l *LocalChaincode) ToInstalledChaincode() *chaincode.InstalledChaincode + type LocalChaincodeInfo struct + Approved bool + Definition *ChaincodeDefinition + InstallInfo *ChaincodeInstallInfo + type Marshaler func(proto.Message) ([]byte, error) + func (m Marshaler) Marshal(msg proto.Message) ([]byte, error) + type MetadataHandler interface + InitializeMetadata func(channel string, chaincodes chaincode.MetadataSet) + UpdateMetadata func(channel string, chaincodes chaincode.MetadataSet) + type MetadataManager struct + LegacyMetadataSet map[string]chaincode.MetadataSet + MetadataSet map[string]chaincode.MetadataSet + func NewMetadataManager() *MetadataManager + func (m *MetadataManager) AddListener(listener MetadataUpdateListener) + func (m *MetadataManager) HandleMetadataUpdate(channel string, metadata chaincode.MetadataSet) + func (m *MetadataManager) InitializeMetadata(channel string, metadata chaincode.MetadataSet) + func (m *MetadataManager) UpdateMetadata(channel string, metadata chaincode.MetadataSet) + type MetadataProvider struct + ChaincodeInfoProvider ChaincodeInfoProvider + ChannelPolicyReferenceProvider ChannelPolicyReferenceProvider + LegacyMetadataProvider LegacyMetadataProvider + func NewMetadataProvider(cip ChaincodeInfoProvider, lmp LegacyMetadataProvider, ccs ChannelConfigSource) *MetadataProvider + func (mp *MetadataProvider) Metadata(channel string, ccName string, collections ...string) *chaincode.Metadata + type MetadataUpdateListener interface + HandleMetadataUpdate func(channel string, metadata chaincode.MetadataSet) + type OpaqueState interface + CollectionName func() string + GetStateHash func(key string) (value []byte, err error) + type PackageParser interface + Parse func(data []byte) (*persistence.ChaincodePackage, error) + type PrivateQueryExecutor interface + GetPrivateDataHash func(namespace, collection, key string) (value []byte, err error) + type PrivateQueryExecutorShim struct + Collection string + Namespace string + State PrivateQueryExecutor + func (pqes *PrivateQueryExecutorShim) CollectionName() string + func (pqes *PrivateQueryExecutorShim) GetStateHash(key string) ([]byte, error) + type QueryExecutorProvider interface + TxQueryExecutor func(channelID, txID string) ledger.SimpleQueryExecutor + type RangeableState interface + GetStateRange func(prefix string) (map[string][]byte, error) + type ReadWritableState interface + DelState func(key string) error + PutState func(key string, value []byte) error + type ReadableState interface + GetState func(key string) (value []byte, err error) + type Resources struct + ChaincodeStore ChaincodeStore + ChannelConfigSource ChannelConfigSource + PackageParser PackageParser + Serializer *Serializer + func (r *Resources) ChaincodeDefinitionIfDefined(chaincodeName string, state ReadableState) (bool, *ChaincodeDefinition, error) + func (r *Resources) LifecycleEndorsementPolicyAsBytes(channelID string) ([]byte, error) + type ResultsIteratorShim struct + ResultsIterator commonledger.ResultsIterator + func (ris *ResultsIteratorShim) Close() error + func (ris *ResultsIteratorShim) Next() (*queryresult.KV, error) + type SCC struct + ACLProvider aclmgmt.ACLProvider + ChannelConfigSource ChannelConfigSource + DeployedCCInfoProvider ledger.DeployedChaincodeInfoProvider + Dispatcher *dispatcher.Dispatcher + Functions SCCFunctions + OrgMSPID string + QueryExecutorProvider QueryExecutorProvider + func (scc *SCC) Chaincode() shim.Chaincode + func (scc *SCC) Init(stub shim.ChaincodeStubInterface) pb.Response + func (scc *SCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response + func (scc *SCC) Name() string + type SCCFunctions interface + ApproveChaincodeDefinitionForOrg func(chname, ccname string, cd *ChaincodeDefinition, packageID string, ...) error + CheckCommitReadiness func(chname, ccname string, cd *ChaincodeDefinition, publicState ReadWritableState, ...) (map[string]bool, error) + CommitChaincodeDefinition func(chname, ccname string, cd *ChaincodeDefinition, publicState ReadWritableState, ...) (map[string]bool, error) + GetInstalledChaincodePackage func(packageID string) ([]byte, error) + InstallChaincode func([]byte) (*chaincode.InstalledChaincode, error) + QueryApprovedChaincodeDefinition func(chname, ccname string, sequence int64, publicState ReadableState, ...) (*ApprovedChaincodeDefinition, error) + QueryChaincodeDefinition func(name string, publicState ReadableState) (*ChaincodeDefinition, error) + QueryInstalledChaincode func(packageID string) (*chaincode.InstalledChaincode, error) + QueryInstalledChaincodes func() []*chaincode.InstalledChaincode + QueryNamespaceDefinitions func(publicState RangeableState) (map[string]string, error) + QueryOrgApprovals func(name string, cd *ChaincodeDefinition, orgStates []OpaqueState) (map[string]bool, error) + type Serializer struct + Marshaler Marshaler + func (s *Serializer) Deserialize(namespace, name string, metadata *lb.StateMetadata, structure interface{}, ...) error + func (s *Serializer) DeserializeAllMetadata(namespace string, state RangeableState) (map[string]*lb.StateMetadata, error) + func (s *Serializer) DeserializeField(namespace, name, field string, state ReadableState) (*lb.StateData, error) + func (s *Serializer) DeserializeFieldAsBytes(namespace, name, field string, state ReadableState) ([]byte, error) + func (s *Serializer) DeserializeFieldAsInt64(namespace, name, field string, state ReadableState) (int64, error) + func (s *Serializer) DeserializeFieldAsProto(namespace, name, field string, state ReadableState, msg proto.Message) error + func (s *Serializer) DeserializeFieldAsString(namespace, name, field string, state ReadableState) (string, error) + func (s *Serializer) DeserializeMetadata(namespace, name string, state ReadableState) (*lb.StateMetadata, bool, error) + func (s *Serializer) IsMetadataSerialized(namespace, name string, structure interface{}, state OpaqueState) (bool, error) + func (s *Serializer) IsSerialized(namespace, name string, structure interface{}, state OpaqueState) (bool, error) + func (s *Serializer) SerializableChecks(structure interface{}) (reflect.Value, []string, error) + func (s *Serializer) Serialize(namespace, name string, structure interface{}, state ReadWritableState) error + type SimpleQueryExecutorShim struct + Namespace string + SimpleQueryExecutor ledger.SimpleQueryExecutor + func (sqes *SimpleQueryExecutorShim) GetState(key string) ([]byte, error) + func (sqes *SimpleQueryExecutorShim) GetStateRange(prefix string) (map[string][]byte, error) + type StateIterator interface + Close func() error + Next func() (*queryresult.KV, error) + type ValidatorCommitter struct + CoreConfig *peer.Config + LegacyDeployedCCInfoProvider LegacyDeployedCCInfoProvider + PrivdataConfig *privdata.PrivdataConfig + Resources *Resources + func (vc *ValidatorCommitter) AllChaincodesInfo(channelName string, sqe ledger.SimpleQueryExecutor) (map[string]*ledger.DeployedChaincodeInfo, error) + func (vc *ValidatorCommitter) AllCollectionsConfigPkg(channelName, chaincodeName string, qe ledger.SimpleQueryExecutor) (*pb.CollectionConfigPackage, error) + func (vc *ValidatorCommitter) ChaincodeImplicitCollections(channelName string) ([]*pb.StaticCollectionConfig, error) + func (vc *ValidatorCommitter) ChaincodeInfo(channelName, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ledger.DeployedChaincodeInfo, error) + func (vc *ValidatorCommitter) CollectionInfo(channelName, chaincodeName, collectionName string, ...) (*pb.StaticCollectionConfig, error) + func (vc *ValidatorCommitter) CollectionValidationInfo(channelID, chaincodeName, collectionName string, state validationState.State) (args []byte, unexpectedErr, validationErr error) + func (vc *ValidatorCommitter) GenerateImplicitCollectionForOrg(mspid string) *pb.StaticCollectionConfig + func (vc *ValidatorCommitter) ImplicitCollectionEndorsementPolicyAsBytes(channelID, orgMSPID string) (policy []byte, unexpectedErr, validationErr error) + func (vc *ValidatorCommitter) ImplicitCollections(channelName, chaincodeName string, qe ledger.SimpleQueryExecutor) ([]*pb.StaticCollectionConfig, error) + func (vc *ValidatorCommitter) Namespaces() []string + func (vc *ValidatorCommitter) UpdatedChaincodes(stateUpdates map[string][]*kvrwset.KVWrite) ([]*ledger.ChaincodeLifecycleInfo, error) + func (vc *ValidatorCommitter) ValidationInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (plugin string, args []byte, unexpectedErr error, validationErr error) + type ValidatorStateShim struct + Namespace string + ValidatorState validatorstate.State + func (vss *ValidatorStateShim) GetState(key string) ([]byte, error)