lifecycle

package
v0.0.0-...-95b87ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 34 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 ProtoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem()
View Source
var SequenceMatcher = regexp.MustCompile("^" + NamespacesName + "/fields/([^/]+)/Sequence$")

Functions

func FieldKey

func FieldKey(namespace, name, field string) string

func GenerateImplicitCollectionForOrg

func GenerateImplicitCollectionForOrg(mspid string) *cb.StaticCollectionConfig

func ImplicitCollectionNameForOrg

func ImplicitCollectionNameForOrg(mspid string) string

func MetadataKey

func MetadataKey(namespace, name string) string

func OrgFromImplicitCollectionName

func OrgFromImplicitCollectionName(name string) string

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 (c *Cache) InitializeLocalChaincodes() error

func (*Cache) InitializeMetadata

func (c *Cache) InitializeMetadata(channel string)

func (*Cache) InterestedInNamespaces

func (c *Cache) InterestedInNamespaces() []string

func (*Cache) ListInstalledChaincodes

func (c *Cache) ListInstalledChaincodes() []*chaincode.InstalledChaincode

func (*Cache) RegisterListener

func (c *Cache) RegisterListener(channelID string, listener ledger.ChaincodeLifecycleEventListener)

func (*Cache) StateCommitDone

func (c *Cache) StateCommitDone(channelName string)

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 ChaincodeInstallInfo struct {
	PackageID string
	Type      string
	Path      string
	Label     string
}

type ChaincodeLocalPackage

type ChaincodeLocalPackage struct {
	PackageID string
}

type ChaincodeParameters

type ChaincodeParameters struct {
	EndorsementInfo *lb.ChaincodeEndorsementInfo
	ValidationInfo  *lb.ChaincodeValidationInfo
	Collections     *cb.CollectionConfigPackage
}

func (*ChaincodeParameters) Equal

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)

func (*ChaincodePrivateLedgerShim) PutState

func (cls *ChaincodePrivateLedgerShim) PutState(key string, value []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

type ChaincodeStore

type ChaincodeStore interface {
	Save(label string, ccInstallPkg []byte) (string, error)
	ListInstalledChaincodes() ([]chaincode.InstalledChaincode, error)
	Load(packageID string) (ccInstallPkg []byte, err error)
}

type ChannelCache

type ChannelCache struct {
	Chaincodes map[string]*CachedChaincodeDefinition

	InterestingHashes map[string]string
}

type ChannelConfigSource

type ChannelConfigSource interface {
	GetStableChannelConfig(channelID string) channelconfig.Resources
}

type ChannelPolicyReferenceProvider

type ChannelPolicyReferenceProvider interface {
	NewPolicy(channelID, channelConfigPolicyReference string) (policies.Policy, error)
}

type DummyQueryExecutorShim

type DummyQueryExecutorShim struct {
}

func (*DummyQueryExecutorShim) GetState

func (*DummyQueryExecutorShim) GetState(key string) ([]byte, error)

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 LegacyMetadataProvider interface {
	Metadata(channel string, cc string, includeCollections bool) *chaincode.Metadata
}

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 Marshaler

type Marshaler func(proto.Message) ([]byte, error)

func (Marshaler) Marshal

func (m Marshaler) Marshal(msg proto.Message) ([]byte, error)

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 (*MetadataProvider) Metadata

func (mp *MetadataProvider) Metadata(channel string, ccName string, includeCollections bool) *chaincode.Metadata

type MetadataUpdateListener

type MetadataUpdateListener interface {
	HandleMetadataUpdate(channel string, metadata chaincode.MetadataSet)
}

type OpaqueState

type OpaqueState interface {
	GetStateHash(key string) (value []byte, err error)
	CollectionName() string
}

type PackageParser

type PackageParser interface {
	Parse(data []byte) (*persistence.ChaincodePackage, error)
}

type PrivateQueryExecutor

type PrivateQueryExecutor interface {
	GetPrivateDataHash(namespace, collection, key string) (value []byte, err error)
}

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 Protobuf

type Protobuf interface {
	Marshal(msg proto.Message) (marshaled []byte, err error)
	Unmarshal(marshaled []byte, msg proto.Message) error
}

type ProtobufImpl

type ProtobufImpl struct{}

func (ProtobufImpl) Marshal

func (p ProtobufImpl) Marshal(msg proto.Message) ([]byte, error)

func (ProtobufImpl) Unmarshal

func (p ProtobufImpl) Unmarshal(marshaled []byte, msg proto.Message) error

type QueryExecutorProvider

type QueryExecutorProvider interface {
	TxQueryExecutor(channelID, txID string) ledger.SimpleQueryExecutor
}

type RangeableState

type RangeableState interface {
	GetStateRange(prefix string) (map[string][]byte, error)
}

type ReadWritableState

type ReadWritableState interface {
	ReadableState
	PutState(key string, value []byte) error
	DelState(key string) error
}

type ReadableState

type ReadableState interface {
	GetState(key string) (value []byte, err error)
}

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
}

func (*SCC) Chaincode

func (scc *SCC) Chaincode() shim.Chaincode

func (*SCC) Init

func (scc *SCC) Init(stub shim.ChaincodeStubInterface) pb.Response

func (*SCC) Invoke

func (scc *SCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response

func (*SCC) Name

func (scc *SCC) Name() string

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
}

func (*ValidatorStateShim) GetState

func (vss *ValidatorStateShim) GetState(key string) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL