ExtractFileEntries extract file entries from the given `tarBytes`. A file entry is included in the
returned results only if it is located in a directory under the indicated databaseType directory
Example for chaincode indexes:
"META-INF/statedb/couchdb/indexes/indexColorSortName.json"
Example for collection scoped indexes:
"META-INF/statedb/couchdb/collections/collectionMarbles/indexes/indexCollMarbles.json"
An empty string will have the effect of returning all statedb metadata. This is useful in validating an
archive in the future with multiple database types

ExtractStatedbArtifactsAsTarbytes extracts the statedb artifacts from the code package tar and create a statedb artifact tar.
The state db artifacts are expected to contain state db specific artifacts such as index specification in the case of couchdb.
This function is intented to be used during chaincode instantiate/upgrade so that statedb artifacts can be created.

ExtractStatedbArtifactsFromCCPackage extracts the statedb artifacts from the code package tar and create a statedb artifact tar.
The state db artifacts are expected to contain state db specific artifacts such as index specification in the case of couchdb.
This function is called during chaincode instantiate/upgrade (from above), and from install, so that statedb artifacts can be created.

GetInstalledChaincodes returns a map whose key is the chaincode id and
value is the ChaincodeDeploymentSpec struct for that chaincodes that have
been installed (but not necessarily instantiated) on the peer by searching
the chaincode install path

type CCPackage interface {
//InitFromBuffer initialize the package from bytesInitFromBuffer(buf []byte) (*ChaincodeData, error)
// InitFromFS gets the chaincode from the filesystem (includes the raw bytes too)InitFromFS(ccname string, ccversion string) ([]byte, *pb.ChaincodeDeploymentSpec, error)
// PutChaincodeToFS writes the chaincode to the filesystemPutChaincodeToFS() error// GetDepSpec gets the ChaincodeDeploymentSpec from the packageGetDepSpec() *pb.ChaincodeDeploymentSpec// GetDepSpecBytes gets the serialized ChaincodeDeploymentSpec from the packageGetDepSpecBytes() []byte// ValidateCC validates and returns the chaincode deployment spec corresponding to
// ChaincodeData. The validation is based on the metadata from ChaincodeData
// One use of this method is to validate the chaincode before launchingValidateCC(ccdata *ChaincodeData) error// GetPackageObject gets the object as a proto.MessageGetPackageObject() proto.Message// GetChaincodeData gets the ChaincodeDataGetChaincodeData() *ChaincodeData// GetId gets the fingerprint of the chaincode based on package computationGetId() []byte
}

CCPackage encapsulates a chaincode package which can be

raw ChaincodeDeploymentSpec
SignedChaincodeDeploymentSpec

Attempt to keep the interface at a level with minimal
interface for possible generalization.

type ChaincodeContainerInfo struct {
NamestringVersionstringPathstringTypestringCodePackage []byte// ContainerType is not a great name, but 'DOCKER' and 'SYSTEM' are the valid typesContainerTypestring
}

ChaincodeContainerInfo is yet another synonym for the data required to start/stop a chaincode.

type ChaincodeData struct {
// Name of the chaincodeNamestring `protobuf:"bytes,1,opt,name=name"`
// Version of the chaincodeVersionstring `protobuf:"bytes,2,opt,name=version"`
// Escc for the chaincode instanceEsccstring `protobuf:"bytes,3,opt,name=escc"`
// Vscc for the chaincode instanceVsccstring `protobuf:"bytes,4,opt,name=vscc"`
// Policy endorsement policy for the chaincode instancePolicy []byte `protobuf:"bytes,5,opt,name=policy,proto3"`
// Data data specific to the packageData []byte `protobuf:"bytes,6,opt,name=data,proto3"`
// Id of the chaincode that's the unique fingerprint for the CC This is not
// currently used anywhere but serves as a good eyecatcherId []byte `protobuf:"bytes,7,opt,name=id,proto3"`
// InstantiationPolicy for the chaincodeInstantiationPolicy []byte `protobuf:"bytes,8,opt,name=instantiation_policy,proto3"`
}

ChaincodeData defines the datastructure for chaincodes to be serialized by proto
Type provides an additional check by directing to use a specific package after instantiation
Data is Type specifc (see CDSPackage and SignedCDSPackage)

Validation returns how to validate transactions for this chaincode.
The string returned is the name of the validation method (usually 'vscc')
and the bytes returned are the argument to the validation (in the case of
'vscc', this is a marshaled pb.VSCCArgs message).

type ChaincodeDefinition interface {
// CCName returns the name of this chaincode (the name it was put in the ChaincodeRegistry with).CCName() string// Hash returns the hash of the chaincode.Hash() []byte// CCVersion returns the version of the chaincode.CCVersion() string// Validation returns how to validate transactions for this chaincode.
// The string returned is the name of the validation method (usually 'vscc')
// and the bytes returned are the argument to the validation (in the case of
// 'vscc', this is a marshaled pb.VSCCArgs message).Validation() (string, []byte)
// Endorsement returns how to endorse proposals for this chaincode.
// The string returns is the name of the endorsement method (usually 'escc').Endorsement() string
}

-------- ChaincodeDefinition - interface for ChaincodeData ------
ChaincodeDefinition describes all of the necessary information for a peer to decide whether to endorse
a proposal and whether to validate a transaction, for a particular chaincode.