ccprovider

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: 24 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

This section is empty.

Variables

This section is empty.

Functions

func ChaincodePackageExists

func ChaincodePackageExists(ccname string, ccversion string) (bool, error)

func ExtractFileEntries

func ExtractFileEntries(tarBytes []byte, databaseType string) (map[string][]*TarFileEntry, error)

func ExtractStatedbArtifactsForChaincode

func ExtractStatedbArtifactsForChaincode(ccNameVersion string) (installed bool, statedbArtifactsTar []byte, err error)

func ExtractStatedbArtifactsFromCCPackage

func ExtractStatedbArtifactsFromCCPackage(ccpackage CCPackage) (statedbArtifactsTar []byte, err error)

func GetChaincodePackageFromPath

func GetChaincodePackageFromPath(ccNameVersion string, ccInstallPath string) ([]byte, error)

func GetInstalledChaincodes

func GetInstalledChaincodes() (*pb.ChaincodeQueryResponse, error)

func IsChaincodeDeployed

func IsChaincodeDeployed(chainid, ccName, ccVersion string, ccHash []byte, sccp sysccprovider.SystemChaincodeProvider) (bool, error)

func MetadataAsTarEntries

func MetadataAsTarEntries(code []byte) ([]byte, error)

func NewCCInfoCache

func NewCCInfoCache(cs CCCacheSupport) *ccInfoCacheImpl

func SetChaincodesPath

func SetChaincodesPath(path string)

Types

type CCCacheSupport

type CCCacheSupport interface {
	GetChaincode(ccNameVersion string) (CCPackage, error)
}

type CCInfoFSImpl

type CCInfoFSImpl struct {
	GetHasher GetHasher
}

func (*CCInfoFSImpl) GetChaincode

func (cifs *CCInfoFSImpl) GetChaincode(ccNameVersion string) (CCPackage, error)

func (*CCInfoFSImpl) GetChaincodeCodePackage

func (cifs *CCInfoFSImpl) GetChaincodeCodePackage(ccNameVersion string) ([]byte, error)

func (*CCInfoFSImpl) GetChaincodeDepSpec

func (cifs *CCInfoFSImpl) GetChaincodeDepSpec(ccNameVersion string) (*pb.ChaincodeDeploymentSpec, error)

func (*CCInfoFSImpl) GetChaincodeFromPath

func (cifs *CCInfoFSImpl) GetChaincodeFromPath(ccNameVersion string, path string) (CCPackage, error)

func (*CCInfoFSImpl) GetChaincodeInstallPath

func (*CCInfoFSImpl) GetChaincodeInstallPath() string

func (*CCInfoFSImpl) ListInstalledChaincodes

func (cifs *CCInfoFSImpl) ListInstalledChaincodes(dir string, ls DirEnumerator, ccFromPath ChaincodeExtractor) ([]chaincode.InstalledChaincode, error)

func (*CCInfoFSImpl) PutChaincode

func (cifs *CCInfoFSImpl) PutChaincode(depSpec *pb.ChaincodeDeploymentSpec) (CCPackage, error)

type CCPackage

type CCPackage interface {
	InitFromBuffer(buf []byte) (*ChaincodeData, error)

	PutChaincodeToFS() error

	GetDepSpec() *pb.ChaincodeDeploymentSpec

	GetDepSpecBytes() []byte

	ValidateCC(ccdata *ChaincodeData) error

	GetPackageObject() proto.Message

	GetChaincodeData() *ChaincodeData

	GetId() []byte
}

func GetCCPackage

func GetCCPackage(buf []byte, bccsp bccsp.BCCSP) (CCPackage, error)

func GetChaincodeFromFS

func GetChaincodeFromFS(ccNameVersion string) (CCPackage, error)

func LoadPackage

func LoadPackage(ccNameVersion string, path string, getHasher GetHasher) (CCPackage, error)

type CDSData

type CDSData struct {
	CodeHash []byte `protobuf:"bytes,1,opt,name=codehash,proto3"`

	MetaDataHash []byte `protobuf:"bytes,2,opt,name=metadatahash,proto3"`
}

func (*CDSData) Equals

func (data *CDSData) Equals(other *CDSData) bool

func (*CDSData) ProtoMessage

func (*CDSData) ProtoMessage()

func (*CDSData) Reset

func (data *CDSData) Reset()

func (*CDSData) String

func (data *CDSData) String() string

type CDSPackage

type CDSPackage struct {
	GetHasher GetHasher
	// contains filtered or unexported fields
}

func (*CDSPackage) GetChaincodeData

func (ccpack *CDSPackage) GetChaincodeData() *ChaincodeData

func (*CDSPackage) GetDepSpec

func (ccpack *CDSPackage) GetDepSpec() *pb.ChaincodeDeploymentSpec

func (*CDSPackage) GetDepSpecBytes

func (ccpack *CDSPackage) GetDepSpecBytes() []byte

func (*CDSPackage) GetId

func (ccpack *CDSPackage) GetId() []byte

func (*CDSPackage) GetPackageObject

func (ccpack *CDSPackage) GetPackageObject() proto.Message

func (*CDSPackage) InitFromBuffer

func (ccpack *CDSPackage) InitFromBuffer(buf []byte) (*ChaincodeData, error)

func (*CDSPackage) InitFromFS

func (ccpack *CDSPackage) InitFromFS(ccNameVersion string) ([]byte, *pb.ChaincodeDeploymentSpec, error)

func (*CDSPackage) InitFromPath

func (ccpack *CDSPackage) InitFromPath(ccNameVersion string, path string) ([]byte, *pb.ChaincodeDeploymentSpec, error)

func (*CDSPackage) PutChaincodeToFS

func (ccpack *CDSPackage) PutChaincodeToFS() error

func (*CDSPackage) ValidateCC

func (ccpack *CDSPackage) ValidateCC(ccdata *ChaincodeData) error

type ChaincodeData

type ChaincodeData struct {
	Name string `protobuf:"bytes,1,opt,name=name"`

	Version string `protobuf:"bytes,2,opt,name=version"`

	Escc string `protobuf:"bytes,3,opt,name=escc"`

	Vscc string `protobuf:"bytes,4,opt,name=vscc"`

	Policy []byte `protobuf:"bytes,5,opt,name=policy,proto3"`

	Data []byte `protobuf:"bytes,6,opt,name=data,proto3"`

	Id []byte `protobuf:"bytes,7,opt,name=id,proto3"`

	InstantiationPolicy []byte `protobuf:"bytes,8,opt,name=instantiation_policy,proto3"`
}

func GetChaincodeData

func GetChaincodeData(ccNameVersion string) (*ChaincodeData, error)

func (*ChaincodeData) ChaincodeID

func (cd *ChaincodeData) ChaincodeID() string

func (*ChaincodeData) ProtoMessage

func (*ChaincodeData) ProtoMessage()

func (*ChaincodeData) Reset

func (cd *ChaincodeData) Reset()

func (*ChaincodeData) String

func (cd *ChaincodeData) String() string

type ChaincodeExtractor

type ChaincodeExtractor func(ccNameVersion string, path string, getHasher GetHasher) (CCPackage, error)

type DirEnumerator

type DirEnumerator func(string) ([]os.FileInfo, error)

type GetHasher

type GetHasher interface {
	GetHash(opts bccsp.HashOpts) (h hash.Hash, err error)
}

type PersistenceAdapter

type PersistenceAdapter func([]byte) ([]byte, error)

func (PersistenceAdapter) GetDBArtifacts

func (pa PersistenceAdapter) GetDBArtifacts(codePackage []byte) ([]byte, error)

type SignedCDSData

type SignedCDSData struct {
	CodeHash      []byte `protobuf:"bytes,1,opt,name=hash"`
	MetaDataHash  []byte `protobuf:"bytes,2,opt,name=metadatahash"`
	SignatureHash []byte `protobuf:"bytes,3,opt,name=signaturehash"`
}

func (*SignedCDSData) Equals

func (data *SignedCDSData) Equals(other *SignedCDSData) bool

func (*SignedCDSData) ProtoMessage

func (*SignedCDSData) ProtoMessage()

func (*SignedCDSData) Reset

func (data *SignedCDSData) Reset()

func (*SignedCDSData) String

func (data *SignedCDSData) String() string

type SignedCDSPackage

type SignedCDSPackage struct {
	GetHasher GetHasher
	// contains filtered or unexported fields
}

func (*SignedCDSPackage) GetChaincodeData

func (ccpack *SignedCDSPackage) GetChaincodeData() *ChaincodeData

func (*SignedCDSPackage) GetDepSpec

func (ccpack *SignedCDSPackage) GetDepSpec() *pb.ChaincodeDeploymentSpec

func (*SignedCDSPackage) GetDepSpecBytes

func (ccpack *SignedCDSPackage) GetDepSpecBytes() []byte

func (*SignedCDSPackage) GetId

func (ccpack *SignedCDSPackage) GetId() []byte

func (*SignedCDSPackage) GetInstantiationPolicy

func (ccpack *SignedCDSPackage) GetInstantiationPolicy() []byte

func (*SignedCDSPackage) GetPackageObject

func (ccpack *SignedCDSPackage) GetPackageObject() proto.Message

func (*SignedCDSPackage) InitFromBuffer

func (ccpack *SignedCDSPackage) InitFromBuffer(buf []byte) (*ChaincodeData, error)

func (*SignedCDSPackage) InitFromFS

func (ccpack *SignedCDSPackage) InitFromFS(ccNameVersion string) ([]byte, *pb.ChaincodeDeploymentSpec, error)

func (*SignedCDSPackage) InitFromPath

func (ccpack *SignedCDSPackage) InitFromPath(ccNameVersion string, path string) ([]byte, *pb.ChaincodeDeploymentSpec, error)

func (*SignedCDSPackage) PutChaincodeToFS

func (ccpack *SignedCDSPackage) PutChaincodeToFS() error

func (*SignedCDSPackage) ValidateCC

func (ccpack *SignedCDSPackage) ValidateCC(ccdata *ChaincodeData) error

type TarFileEntry

type TarFileEntry struct {
	FileHeader  *tar.Header
	FileContent []byte
}

type TransactionParams

type TransactionParams struct {
	TxID                 string
	ChannelID            string
	NamespaceID          string
	SignedProp           *pb.SignedProposal
	Proposal             *pb.Proposal
	TXSimulator          ledger.TxSimulator
	HistoryQueryExecutor ledger.HistoryQueryExecutor
	CollectionStore      privdata.CollectionStore
	IsInitTransaction    bool

	ProposalDecorations map[string][]byte
}

Jump to

Keyboard shortcuts

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