Documentation
¶
Index ¶
- Constants
- Variables
- func FieldKey(namespace, name, field string) string
- func GenerateImplicitCollectionForOrg(mspid string) *cb.StaticCollectionConfig
- func ImplicitCollectionNameForOrg(mspid string) string
- func MetadataKey(namespace, name string) string
- func OrgFromImplicitCollectionName(name string) string
- func StateIteratorToMap(itr StateIterator) (map[string][]byte, error)
- type 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) RegisterListener(channelID string, listener ledger.ChaincodeLifecycleEventListener)
- func (c *Cache) StateCommitDone(channelName string)
- type CachedChaincodeDefinition
- type ChaincodeDefinition
- type ChaincodeEndorsementInfo
- func (cei *ChaincodeEndorsementInfo) CachedChaincodeInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*LocalChaincodeInfo, bool, error)
- func (cei *ChaincodeEndorsementInfo) ChaincodeDefinition(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (ccprovider.ChaincodeDefinition, error)
- type ChaincodeEndorsementInfoSource
- 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
- type ChaincodeInfoProvider
- type ChaincodeInstallInfo
- type ChaincodeLocalPackage
- type ChaincodeParameters
- type ChaincodePrivateLedgerShim
- 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
- type ChaincodeResultIteratorShim
- type ChaincodeStore
- type ChannelCache
- type ChannelConfigSource
- type ChannelPolicyReferenceProvider
- type DummyQueryExecutorShim
- type ErrNamespaceNotDefined
- type 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
- 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) 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
- type InstallListener
- type InstalledChaincodesLister
- type Invocation
- 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) 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 LegacyDefinition
- type LegacyDeployedCCInfoProvider
- type LegacyLifecycle
- type LegacyMetadataProvider
- type Lifecycle
- type LocalChaincode
- type LocalChaincodeInfo
- type Marshaler
- type MetadataHandler
- type 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
- type MetadataUpdateListener
- type OpaqueState
- type PackageParser
- type PrivateQueryExecutor
- type PrivateQueryExecutorShim
- type Protobuf
- type ProtobufImpl
- type QueryExecutorProvider
- type RangeableState
- type ReadWritableState
- type ReadableState
- type Resources
- type ResultsIteratorShim
- type SCC
- type SCCFunctions
- type Serializer
- 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
- type StateIterator
- type ValidatorCommitter
- func (vc *ValidatorCommitter) ChaincodeImplicitCollections(channelName string) ([]*cb.StaticCollectionConfig, error)
- func (vc *ValidatorCommitter) ChaincodeInfo(channelName, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ledger.DeployedChaincodeInfo, error)
- func (vc *ValidatorCommitter) CollectionInfo(channelName, chaincodeName, collectionName string, ...) (*cb.StaticCollectionConfig, error)
- func (vc *ValidatorCommitter) CollectionValidationInfo(channelID, chaincodeName, collectionName string, state validationState.State) (args []byte, unexpectedErr, validationErr error)
- func (vc *ValidatorCommitter) ImplicitCollectionEndorsementPolicyAsBytes(channelID, orgMSPID string) (policy []byte, unexpectedErr, validationErr error)
- func (vc *ValidatorCommitter) ImplicitCollections(channelName, chaincodeName string, qe ledger.SimpleQueryExecutor) ([]*cb.StaticCollectionConfig, error)
- func (vc *ValidatorCommitter) LifecycleEndorsementPolicyAsBytes(channelID string) ([]byte, 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
Constants ¶
View Source
const ( NamespacesName = "namespaces" ChaincodeSourcesName = "chaincode-sources" ChaincodeDefinitionType = "ChaincodeDefinition" FriendlyChaincodeDefinitionType = "Chaincode" DefaultEndorsementPolicyRef = "/Channel/Application/Endorsement" )
View Source
const ( LifecycleNamespace = "_lifecycle" InstallChaincodeFuncName = "InstallChaincode" QueryInstalledChaincodeFuncName = "QueryInstalledChaincode" QueryInstalledChaincodesFuncName = "QueryInstalledChaincodes" ApproveChaincodeDefinitionForMyOrgFuncName = "ApproveChaincodeDefinitionForMyOrg" CheckCommitReadinessFuncName = "CheckCommitReadiness" CommitChaincodeDefinitionFuncName = "CommitChaincodeDefinition" QueryChaincodeDefinitionFuncName = "QueryChaincodeDefinition" QueryChaincodeDefinitionsFuncName = "QueryChaincodeDefinitions" )
View Source
const ( MetadataInfix = "metadata" FieldsInfix = "fields" )
View Source
const (
LifecycleEndorsementPolicyRef = "/Channel/Application/LifecycleEndorsement"
)
Variables ¶
View Source
var ( ChaincodeNameRegExp = regexp.MustCompile("^[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*$") ChaincodeVersionRegExp = regexp.MustCompile("^[A-Za-z0-9_.+-]+$") )
View Source
var ( DefaultEndorsementPolicyBytes = protoutil.MarshalOrPanic(&pb.ApplicationPolicy{ Type: &pb.ApplicationPolicy_ChannelConfigPolicyReference{ ChannelConfigPolicyReference: DefaultEndorsementPolicyRef, }, }) )
View Source
var ImplicitCollectionMatcher = regexp.MustCompile("^" + ImplicitCollectionNameForOrg("(.+)") + "$")
View Source
var ( LifecycleDefaultEndorsementPolicyBytes = protoutil.MarshalOrPanic(&pb.ApplicationPolicy{ Type: &pb.ApplicationPolicy_ChannelConfigPolicyReference{ ChannelConfigPolicyReference: LifecycleEndorsementPolicyRef, }, }) )
View Source
var SequenceMatcher = regexp.MustCompile("^" + NamespacesName + "/fields/([^/]+)/Sequence$")
Functions ¶
func GenerateImplicitCollectionForOrg ¶
func GenerateImplicitCollectionForOrg(mspid string) *cb.StaticCollectionConfig
func MetadataKey ¶
func StateIteratorToMap ¶
func StateIteratorToMap(itr StateIterator) (map[string][]byte, error)
Types ¶
type Cache ¶
type Cache struct { Resources *Resources MyOrgMSPID string MetadataHandler MetadataHandler // contains filtered or unexported fields }
func NewCache ¶
func NewCache(resources *Resources, myOrgMSPID string, metadataManager MetadataHandler) *Cache
func (*Cache) ChaincodeInfo ¶
func (c *Cache) ChaincodeInfo(channelID, name string) (*LocalChaincodeInfo, error)
func (*Cache) GetInstalledChaincode ¶
func (c *Cache) GetInstalledChaincode(packageID string) (*chaincode.InstalledChaincode, error)
func (*Cache) HandleChaincodeInstalled ¶
func (c *Cache) HandleChaincodeInstalled(md *persistence.ChaincodePackageMetadata, packageID string)
func (*Cache) HandleStateUpdates ¶
func (c *Cache) HandleStateUpdates(trigger *ledger.StateUpdateTrigger) error
func (*Cache) Initialize ¶
func (c *Cache) Initialize(channelID string, qe ledger.SimpleQueryExecutor) error
func (*Cache) InitializeLocalChaincodes ¶
func (*Cache) InitializeMetadata ¶
func (*Cache) InterestedInNamespaces ¶
func (*Cache) ListInstalledChaincodes ¶
func (c *Cache) ListInstalledChaincodes() []*chaincode.InstalledChaincode
func (*Cache) RegisterListener ¶
func (c *Cache) RegisterListener(channelID string, listener ledger.ChaincodeLifecycleEventListener)
func (*Cache) StateCommitDone ¶
type CachedChaincodeDefinition ¶
type CachedChaincodeDefinition struct { Definition *ChaincodeDefinition Approved bool InstallInfo *ChaincodeInstallInfo Hashes []string }
type ChaincodeDefinition ¶
type ChaincodeDefinition struct { Sequence int64 EndorsementInfo *lb.ChaincodeEndorsementInfo ValidationInfo *lb.ChaincodeValidationInfo Collections *cb.CollectionConfigPackage }
func (*ChaincodeDefinition) Parameters ¶
func (cd *ChaincodeDefinition) Parameters() *ChaincodeParameters
func (*ChaincodeDefinition) String ¶
func (cd *ChaincodeDefinition) String() string
type ChaincodeEndorsementInfo ¶
type ChaincodeEndorsementInfo struct { Resources *Resources Cache ChaincodeInfoCache LegacyImpl LegacyLifecycle BuiltinSCCs scc.BuiltinSCCs }
func (*ChaincodeEndorsementInfo) CachedChaincodeInfo ¶
func (cei *ChaincodeEndorsementInfo) CachedChaincodeInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*LocalChaincodeInfo, bool, error)
func (*ChaincodeEndorsementInfo) ChaincodeDefinition ¶
func (cei *ChaincodeEndorsementInfo) ChaincodeDefinition(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (ccprovider.ChaincodeDefinition, error)
type ChaincodeEndorsementInfoSource ¶
type ChaincodeEndorsementInfoSource struct { Resources *Resources Cache ChaincodeInfoCache LegacyImpl Lifecycle BuiltinSCCs scc.BuiltinSCCs }
func (*ChaincodeEndorsementInfoSource) CachedChaincodeInfo ¶
func (cei *ChaincodeEndorsementInfoSource) CachedChaincodeInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*LocalChaincodeInfo, bool, error)
func (*ChaincodeEndorsementInfoSource) ChaincodeEndorsementInfo ¶
func (cei *ChaincodeEndorsementInfoSource) ChaincodeEndorsementInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ChaincodeEndorsementInfo, error)
type ChaincodeInfoCache ¶
type ChaincodeInfoCache interface {
ChaincodeInfo(channelID, chaincodeName string) (definition *LocalChaincodeInfo, err error)
}
type ChaincodeInfoProvider ¶
type ChaincodeInfoProvider interface {
ChaincodeInfo(channelID, name string) (*LocalChaincodeInfo, error)
}
type ChaincodeInstallInfo ¶
type ChaincodeLocalPackage ¶
type ChaincodeLocalPackage struct {
PackageID string
}
type ChaincodeParameters ¶
type ChaincodeParameters struct { EndorsementInfo *lb.ChaincodeEndorsementInfo ValidationInfo *lb.ChaincodeValidationInfo Collections *cb.CollectionConfigPackage }
func (*ChaincodeParameters) Equal ¶
func (cp *ChaincodeParameters) Equal(ocp *ChaincodeParameters) error
type ChaincodePrivateLedgerShim ¶
type ChaincodePrivateLedgerShim struct { Stub shim.ChaincodeStubInterface Collection string }
func (*ChaincodePrivateLedgerShim) CollectionName ¶
func (cls *ChaincodePrivateLedgerShim) CollectionName() string
func (*ChaincodePrivateLedgerShim) DelState ¶
func (cls *ChaincodePrivateLedgerShim) DelState(key string) error
func (*ChaincodePrivateLedgerShim) GetState ¶
func (cls *ChaincodePrivateLedgerShim) GetState(key string) ([]byte, error)
func (*ChaincodePrivateLedgerShim) GetStateHash ¶
func (cls *ChaincodePrivateLedgerShim) GetStateHash(key string) ([]byte, error)
func (*ChaincodePrivateLedgerShim) GetStateRange ¶
func (cls *ChaincodePrivateLedgerShim) GetStateRange(prefix string) (map[string][]byte, error)
type ChaincodePublicLedgerShim ¶
type ChaincodePublicLedgerShim struct {
shim.ChaincodeStubInterface
}
func (*ChaincodePublicLedgerShim) GetStateRange ¶
func (cls *ChaincodePublicLedgerShim) GetStateRange(prefix string) (map[string][]byte, error)
type ChaincodeResultIteratorShim ¶
type ChaincodeResultIteratorShim struct {
ResultsIterator shim.StateQueryIteratorInterface
}
func (*ChaincodeResultIteratorShim) Close ¶
func (cris *ChaincodeResultIteratorShim) Close() error
func (*ChaincodeResultIteratorShim) Next ¶
func (cris *ChaincodeResultIteratorShim) Next() (*queryresult.KV, error)
type ChaincodeStore ¶
type ChannelCache ¶
type ChannelCache struct { Chaincodes map[string]*CachedChaincodeDefinition InterestingHashes map[string]string }
type ChannelConfigSource ¶
type ChannelConfigSource interface {
GetStableChannelConfig(channelID string) channelconfig.Resources
}
type DummyQueryExecutorShim ¶
type DummyQueryExecutorShim struct { }
type ErrNamespaceNotDefined ¶
type ErrNamespaceNotDefined struct {
Namespace string
}
func (ErrNamespaceNotDefined) Error ¶
func (e ErrNamespaceNotDefined) Error() string
type EventBroker ¶
type EventBroker struct {
// contains filtered or unexported fields
}
func NewEventBroker ¶
func NewEventBroker(chaincodeStore ChaincodeStore, pkgParser PackageParser) *EventBroker
func (*EventBroker) ApproveOrDefineCommitted ¶
func (b *EventBroker) ApproveOrDefineCommitted(channelID string)
func (*EventBroker) ProcessApproveOrDefineEvent ¶
func (b *EventBroker) ProcessApproveOrDefineEvent(channelID string, chaincodeName string, cachedChaincode *CachedChaincodeDefinition)
func (*EventBroker) ProcessInstallEvent ¶
func (b *EventBroker) ProcessInstallEvent(localChaincode *LocalChaincode)
func (*EventBroker) RegisterListener ¶
func (b *EventBroker) RegisterListener(channelID string, listener ledger.ChaincodeLifecycleEventListener)
type ExternalFunctions ¶
type ExternalFunctions struct { Resources *Resources InstallListener InstallListener InstalledChaincodesLister InstalledChaincodesLister }
func (*ExternalFunctions) ApproveChaincodeDefinitionForOrg ¶
func (ef *ExternalFunctions) ApproveChaincodeDefinitionForOrg(chname, ccname string, cd *ChaincodeDefinition, packageID string, publicState ReadableState, orgState ReadWritableState) error
func (*ExternalFunctions) CheckCommitReadiness ¶
func (ef *ExternalFunctions) CheckCommitReadiness(chname, ccname string, cd *ChaincodeDefinition, publicState ReadWritableState, orgStates []OpaqueState) (map[string]bool, error)
func (*ExternalFunctions) CommitChaincodeDefinition ¶
func (ef *ExternalFunctions) CommitChaincodeDefinition(chname, ccname string, cd *ChaincodeDefinition, publicState ReadWritableState, orgStates []OpaqueState) (map[string]bool, error)
func (*ExternalFunctions) DefaultEndorsementPolicyAsBytes ¶
func (ef *ExternalFunctions) DefaultEndorsementPolicyAsBytes(channelID string) ([]byte, error)
func (*ExternalFunctions) GetInstalledChaincodePackage ¶
func (ef *ExternalFunctions) GetInstalledChaincodePackage(packageID string) ([]byte, error)
func (*ExternalFunctions) InstallChaincode ¶
func (ef *ExternalFunctions) InstallChaincode(chaincodeInstallPackage []byte) (*chaincode.InstalledChaincode, error)
func (*ExternalFunctions) QueryChaincodeDefinition ¶
func (ef *ExternalFunctions) QueryChaincodeDefinition(name string, publicState ReadableState) (*ChaincodeDefinition, error)
func (*ExternalFunctions) QueryInstalledChaincode ¶
func (ef *ExternalFunctions) QueryInstalledChaincode(packageID string) (*chaincode.InstalledChaincode, error)
func (*ExternalFunctions) QueryInstalledChaincodes ¶
func (ef *ExternalFunctions) QueryInstalledChaincodes() []*chaincode.InstalledChaincode
func (*ExternalFunctions) QueryNamespaceDefinitions ¶
func (ef *ExternalFunctions) QueryNamespaceDefinitions(publicState RangeableState) (map[string]string, error)
func (*ExternalFunctions) QueryOrgApprovals ¶
func (ef *ExternalFunctions) QueryOrgApprovals(name string, cd *ChaincodeDefinition, orgStates []OpaqueState) (map[string]bool, error)
func (*ExternalFunctions) SetChaincodeDefinitionDefaults ¶
func (ef *ExternalFunctions) SetChaincodeDefinitionDefaults(chname string, cd *ChaincodeDefinition) error
type HandleMetadataUpdateFunc ¶
type HandleMetadataUpdateFunc func(channel string, metadata chaincode.MetadataSet)
func (HandleMetadataUpdateFunc) HandleMetadataUpdate ¶
func (handleMetadataUpdate HandleMetadataUpdateFunc) HandleMetadataUpdate(channel string, metadata chaincode.MetadataSet)
type InstallListener ¶
type InstallListener interface {
HandleChaincodeInstalled(md *persistence.ChaincodePackageMetadata, packageID string)
}
type InstalledChaincodesLister ¶
type InstalledChaincodesLister interface { ListInstalledChaincodes() []*chaincode.InstalledChaincode GetInstalledChaincode(packageID string) (*chaincode.InstalledChaincode, error) }
type Invocation ¶
type Invocation struct { ChannelID string ApplicationConfig channelconfig.Application Stub shim.ChaincodeStubInterface SCC *SCC }
func (*Invocation) ApproveChaincodeDefinitionForMyOrg ¶
func (i *Invocation) ApproveChaincodeDefinitionForMyOrg(input *lb.ApproveChaincodeDefinitionForMyOrgArgs) (proto.Message, error)
func (*Invocation) CheckCommitReadiness ¶
func (i *Invocation) CheckCommitReadiness(input *lb.CheckCommitReadinessArgs) (proto.Message, error)
func (*Invocation) CommitChaincodeDefinition ¶
func (i *Invocation) CommitChaincodeDefinition(input *lb.CommitChaincodeDefinitionArgs) (proto.Message, error)
func (*Invocation) GetInstalledChaincodePackage ¶
func (i *Invocation) GetInstalledChaincodePackage(input *lb.GetInstalledChaincodePackageArgs) (proto.Message, error)
func (*Invocation) InstallChaincode ¶
func (i *Invocation) InstallChaincode(input *lb.InstallChaincodeArgs) (proto.Message, error)
func (*Invocation) QueryChaincodeDefinition ¶
func (i *Invocation) QueryChaincodeDefinition(input *lb.QueryChaincodeDefinitionArgs) (proto.Message, error)
func (*Invocation) QueryChaincodeDefinitions ¶
func (i *Invocation) QueryChaincodeDefinitions(input *lb.QueryChaincodeDefinitionsArgs) (proto.Message, error)
func (*Invocation) QueryInstalledChaincode ¶
func (i *Invocation) QueryInstalledChaincode(input *lb.QueryInstalledChaincodeArgs) (proto.Message, error)
func (*Invocation) QueryInstalledChaincodes ¶
func (i *Invocation) QueryInstalledChaincodes(input *lb.QueryInstalledChaincodesArgs) (proto.Message, error)
type LegacyDefinition ¶
type LegacyDefinition struct { Version string EndorsementPlugin string RequiresInitField bool ChaincodeIDField string }
func (*LegacyDefinition) CCVersion ¶
func (ld *LegacyDefinition) CCVersion() string
func (*LegacyDefinition) ChaincodeID ¶
func (ld *LegacyDefinition) ChaincodeID() string
func (*LegacyDefinition) Endorsement ¶
func (ld *LegacyDefinition) Endorsement() string
func (*LegacyDefinition) RequiresInit ¶
func (ld *LegacyDefinition) RequiresInit() bool
type LegacyDeployedCCInfoProvider ¶
type LegacyDeployedCCInfoProvider interface { ledger.DeployedChaincodeInfoProvider }
type LegacyLifecycle ¶
type LegacyLifecycle interface {
ChaincodeDefinition(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (ccprovider.ChaincodeDefinition, error)
}
type LegacyMetadataProvider ¶
type Lifecycle ¶
type Lifecycle interface {
ChaincodeEndorsementInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ChaincodeEndorsementInfo, error)
}
type LocalChaincode ¶
type LocalChaincode struct { Info *ChaincodeInstallInfo References map[string]map[string]*CachedChaincodeDefinition }
func (*LocalChaincode) ToInstalledChaincode ¶
func (l *LocalChaincode) ToInstalledChaincode() *chaincode.InstalledChaincode
type LocalChaincodeInfo ¶
type LocalChaincodeInfo struct { Definition *ChaincodeDefinition Approved bool InstallInfo *ChaincodeInstallInfo }
type MetadataHandler ¶
type MetadataHandler interface { InitializeMetadata(channel string, chaincodes chaincode.MetadataSet) UpdateMetadata(channel string, chaincodes chaincode.MetadataSet) }
type MetadataManager ¶
type MetadataManager struct { LegacyMetadataSet map[string]chaincode.MetadataSet MetadataSet map[string]chaincode.MetadataSet // contains filtered or unexported fields }
func NewMetadataManager ¶
func NewMetadataManager() *MetadataManager
func (*MetadataManager) AddListener ¶
func (m *MetadataManager) AddListener(listener MetadataUpdateListener)
func (*MetadataManager) HandleMetadataUpdate ¶
func (m *MetadataManager) HandleMetadataUpdate(channel string, metadata chaincode.MetadataSet)
func (*MetadataManager) InitializeMetadata ¶
func (m *MetadataManager) InitializeMetadata(channel string, metadata chaincode.MetadataSet)
func (*MetadataManager) UpdateMetadata ¶
func (m *MetadataManager) UpdateMetadata(channel string, metadata chaincode.MetadataSet)
type MetadataProvider ¶
type MetadataProvider struct { ChaincodeInfoProvider ChaincodeInfoProvider LegacyMetadataProvider LegacyMetadataProvider ChannelPolicyReferenceProvider ChannelPolicyReferenceProvider }
func NewMetadataProvider ¶
func NewMetadataProvider(cip ChaincodeInfoProvider, lmp LegacyMetadataProvider, ccs ChannelConfigSource) *MetadataProvider
type MetadataUpdateListener ¶
type MetadataUpdateListener interface {
HandleMetadataUpdate(channel string, metadata chaincode.MetadataSet)
}
type OpaqueState ¶
type PackageParser ¶
type PackageParser interface {
Parse(data []byte) (*persistence.ChaincodePackage, error)
}
type PrivateQueryExecutor ¶
type PrivateQueryExecutorShim ¶
type PrivateQueryExecutorShim struct { Namespace string Collection string State PrivateQueryExecutor }
func (*PrivateQueryExecutorShim) CollectionName ¶
func (pqes *PrivateQueryExecutorShim) CollectionName() string
func (*PrivateQueryExecutorShim) GetStateHash ¶
func (pqes *PrivateQueryExecutorShim) GetStateHash(key string) ([]byte, error)
type ProtobufImpl ¶
type ProtobufImpl struct{}
type QueryExecutorProvider ¶
type QueryExecutorProvider interface {
TxQueryExecutor(channelID, txID string) ledger.SimpleQueryExecutor
}
type RangeableState ¶
type ReadWritableState ¶
type ReadableState ¶
type Resources ¶
type Resources struct { ChannelConfigSource ChannelConfigSource ChaincodeStore ChaincodeStore PackageParser PackageParser Serializer *Serializer }
func (*Resources) ChaincodeDefinitionIfDefined ¶
func (r *Resources) ChaincodeDefinitionIfDefined(chaincodeName string, state ReadableState) (bool, *ChaincodeDefinition, error)
type ResultsIteratorShim ¶
type ResultsIteratorShim struct {
ResultsIterator commonledger.ResultsIterator
}
func (*ResultsIteratorShim) Close ¶
func (ris *ResultsIteratorShim) Close() error
func (*ResultsIteratorShim) Next ¶
func (ris *ResultsIteratorShim) Next() (*queryresult.KV, error)
type SCC ¶
type SCC struct { OrgMSPID string ACLProvider aclmgmt.ACLProvider ChannelConfigSource ChannelConfigSource DeployedCCInfoProvider ledger.DeployedChaincodeInfoProvider QueryExecutorProvider QueryExecutorProvider Functions SCCFunctions Dispatcher *dispatcher.Dispatcher }
type SCCFunctions ¶
type SCCFunctions interface { InstallChaincode([]byte) (*chaincode.InstalledChaincode, error) QueryInstalledChaincode(packageID string) (*chaincode.InstalledChaincode, error) GetInstalledChaincodePackage(packageID string) ([]byte, error) QueryInstalledChaincodes() []*chaincode.InstalledChaincode ApproveChaincodeDefinitionForOrg(chname, ccname string, cd *ChaincodeDefinition, packageID string, publicState ReadableState, orgState ReadWritableState) error CheckCommitReadiness(chname, ccname string, cd *ChaincodeDefinition, publicState ReadWritableState, orgStates []OpaqueState) (map[string]bool, error) CommitChaincodeDefinition(chname, ccname string, cd *ChaincodeDefinition, publicState ReadWritableState, orgStates []OpaqueState) (map[string]bool, error) QueryChaincodeDefinition(name string, publicState ReadableState) (*ChaincodeDefinition, error) QueryOrgApprovals(name string, cd *ChaincodeDefinition, orgStates []OpaqueState) (map[string]bool, error) QueryNamespaceDefinitions(publicState RangeableState) (map[string]string, error) }
type Serializer ¶
type Serializer struct {
Marshaler Marshaler
}
func (*Serializer) Deserialize ¶
func (s *Serializer) Deserialize(namespace, name string, metadata *lb.StateMetadata, structure interface{}, state ReadableState) error
func (*Serializer) DeserializeAllMetadata ¶
func (s *Serializer) DeserializeAllMetadata(namespace string, state RangeableState) (map[string]*lb.StateMetadata, error)
func (*Serializer) DeserializeField ¶
func (s *Serializer) DeserializeField(namespace, name, field string, state ReadableState) (*lb.StateData, error)
func (*Serializer) DeserializeFieldAsBytes ¶
func (s *Serializer) DeserializeFieldAsBytes(namespace, name, field string, state ReadableState) ([]byte, error)
func (*Serializer) DeserializeFieldAsInt64 ¶
func (s *Serializer) DeserializeFieldAsInt64(namespace, name, field string, state ReadableState) (int64, error)
func (*Serializer) DeserializeFieldAsProto ¶
func (s *Serializer) DeserializeFieldAsProto(namespace, name, field string, state ReadableState, msg proto.Message) error
func (*Serializer) DeserializeFieldAsString ¶
func (s *Serializer) DeserializeFieldAsString(namespace, name, field string, state ReadableState) (string, error)
func (*Serializer) DeserializeMetadata ¶
func (s *Serializer) DeserializeMetadata(namespace, name string, state ReadableState) (*lb.StateMetadata, bool, error)
func (*Serializer) IsMetadataSerialized ¶
func (s *Serializer) IsMetadataSerialized(namespace, name string, structure interface{}, state OpaqueState) (bool, error)
func (*Serializer) IsSerialized ¶
func (s *Serializer) IsSerialized(namespace, name string, structure interface{}, state OpaqueState) (bool, error)
func (*Serializer) SerializableChecks ¶
func (s *Serializer) SerializableChecks(structure interface{}) (reflect.Value, []string, error)
func (*Serializer) Serialize ¶
func (s *Serializer) Serialize(namespace, name string, structure interface{}, state ReadWritableState) error
type SimpleQueryExecutorShim ¶
type SimpleQueryExecutorShim struct { Namespace string SimpleQueryExecutor ledger.SimpleQueryExecutor }
func (*SimpleQueryExecutorShim) GetState ¶
func (sqes *SimpleQueryExecutorShim) GetState(key string) ([]byte, error)
func (*SimpleQueryExecutorShim) GetStateRange ¶
func (sqes *SimpleQueryExecutorShim) GetStateRange(prefix string) (map[string][]byte, error)
type StateIterator ¶
type StateIterator interface { Close() error Next() (*queryresult.KV, error) }
type ValidatorCommitter ¶
type ValidatorCommitter struct { Resources *Resources LegacyDeployedCCInfoProvider LegacyDeployedCCInfoProvider }
func (*ValidatorCommitter) ChaincodeImplicitCollections ¶
func (vc *ValidatorCommitter) ChaincodeImplicitCollections(channelName string) ([]*cb.StaticCollectionConfig, error)
func (*ValidatorCommitter) ChaincodeInfo ¶
func (vc *ValidatorCommitter) ChaincodeInfo(channelName, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ledger.DeployedChaincodeInfo, error)
func (*ValidatorCommitter) CollectionInfo ¶
func (vc *ValidatorCommitter) CollectionInfo(channelName, chaincodeName, collectionName string, qe ledger.SimpleQueryExecutor) (*cb.StaticCollectionConfig, error)
func (*ValidatorCommitter) CollectionValidationInfo ¶
func (vc *ValidatorCommitter) CollectionValidationInfo(channelID, chaincodeName, collectionName string, state validationState.State) (args []byte, unexpectedErr, validationErr error)
func (*ValidatorCommitter) ImplicitCollectionEndorsementPolicyAsBytes ¶
func (vc *ValidatorCommitter) ImplicitCollectionEndorsementPolicyAsBytes(channelID, orgMSPID string) (policy []byte, unexpectedErr, validationErr error)
func (*ValidatorCommitter) ImplicitCollections ¶
func (vc *ValidatorCommitter) ImplicitCollections(channelName, chaincodeName string, qe ledger.SimpleQueryExecutor) ([]*cb.StaticCollectionConfig, error)
func (*ValidatorCommitter) LifecycleEndorsementPolicyAsBytes ¶
func (vc *ValidatorCommitter) LifecycleEndorsementPolicyAsBytes(channelID string) ([]byte, error)
func (*ValidatorCommitter) Namespaces ¶
func (vc *ValidatorCommitter) Namespaces() []string
func (*ValidatorCommitter) UpdatedChaincodes ¶
func (vc *ValidatorCommitter) UpdatedChaincodes(stateUpdates map[string][]*kvrwset.KVWrite) ([]*ledger.ChaincodeLifecycleInfo, error)
func (*ValidatorCommitter) ValidationInfo ¶
func (vc *ValidatorCommitter) ValidationInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (plugin string, args []byte, unexpectedErr error, validationErr error)
type ValidatorStateShim ¶
type ValidatorStateShim struct { ValidatorState validatorstate.State Namespace string }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.