{"modulePath":"github.com/2lambda123/hyperledger-fabric","version":"v2.1.1+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package chaincode\n\n## Types\n\n```go\ntype InstalledChaincode struct {\n\tPackageID string\n\tHash      []byte\n\tLabel     string\n\t// References is a map of channel name to chaincode\n\t// metadata. This represents the channels and chaincode\n\t// definitions that use this installed chaincode package.\n\tReferences map[string][]*Metadata\n\n\t// FIXME: we should remove these two\n\t// fields since they are not properties\n\t// of the chaincode (FAB-14561)\n\tName    string\n\tVersion string\n}\n```\nInstalledChaincode defines metadata about an installed chaincode\n\n```go\ntype Metadata struct {\n\tName    string\n\tVersion string\n\tPolicy  []byte\n\t// CollectionPolicies will only be set for _lifecycle\n\t// chaincodes and stores a map from collection name to\n\t// that collection's endorsement policy if one exists.\n\tCollectionPolicies map[string][]byte\n\tId                 []byte\n\tCollectionsConfig  *peer.CollectionConfigPackage\n\t// These two fields (Approved, Installed) are only set for\n\t// _lifecycle chaincodes. They are used to ensure service\n\t// discovery doesn't publish a stale chaincode definition\n\t// when the _lifecycle definition exists but has not yet\n\t// been installed or approved by the peer's org.\n\tApproved  bool\n\tInstalled bool\n}\n```\nMetadata defines channel-scoped metadata of a chaincode\n\n```go\ntype MetadataMapping struct {\n\tsync.RWMutex\n\t// contains filtered or unexported fields\n}\n```\nMetadataMapping defines a mapping from chaincode name to Metadata\n\n```go\nfunc NewMetadataMapping() *MetadataMapping\n```\nNewMetadataMapping creates a new metadata mapping\n\n```go\nfunc (m *MetadataMapping) Aggregate() MetadataSet\n```\nAggregate aggregates all Metadata to a MetadataSet\n\n```go\nfunc (m *MetadataMapping) Lookup(cc string) (Metadata, bool)\n```\nLookup returns the Metadata that is associated with the given chaincode\n\n```go\nfunc (m *MetadataMapping) Update(ccMd Metadata)\n```\nUpdate updates the chaincode metadata in the mapping\n\n```go\ntype MetadataSet []Metadata\n```\nMetadataSet defines an aggregation of Metadata\n\n```go\nfunc (ccs MetadataSet) AsChaincodes() []*gossip.Chaincode\n```\nAsChaincodes converts this MetadataSet to a slice of gossip.Chaincodes\n\n","path":"github.com/2lambda123/hyperledger-fabric/common/chaincode","name":"chaincode","synopsis":"","isRedistributable":true}
