fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/core/common/ccprovider Index | Files

package ccprovider

import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/core/common/ccprovider"

Index

Package Files

ccprovider.go cdspackage.go

type CCPackage Uses

type CCPackage interface {
    //InitFromBuffer initialize the package from bytes
    InitFromBuffer(buf []byte) (*ChaincodeData, error)

    // PutChaincodeToFS writes the chaincode to the filesystem
    PutChaincodeToFS() error

    // GetDepSpec gets the ChaincodeDeploymentSpec from the package
    GetDepSpec() *pb.ChaincodeDeploymentSpec

    // GetDepSpecBytes gets the serialized ChaincodeDeploymentSpec from the package
    GetDepSpecBytes() []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 launching
    ValidateCC(ccdata *ChaincodeData) error

    // GetPackageObject gets the object as a proto.Message
    GetPackageObject() proto.Message

    // GetChaincodeData gets the ChaincodeData
    GetChaincodeData() *ChaincodeData

    // GetId gets the fingerprint of the chaincode based on package computation
    GetId() []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 CDSData Uses

type CDSData struct {
    //CodeHash hash of CodePackage from ChaincodeDeploymentSpec
    CodeHash []byte `protobuf:"bytes,1,opt,name=codehash,proto3"`

    //MetaDataHash hash of Name and Version from ChaincodeDeploymentSpec
    MetaDataHash []byte `protobuf:"bytes,2,opt,name=metadatahash,proto3"`
}

CDSData is data stored in the LSCC on instantiation of a CC for CDSPackage. This needs to be serialized for ChaincodeData hence the protobuf format

func (*CDSData) ProtoMessage Uses

func (*CDSData) ProtoMessage()

ProtoMessage just exists to make proto happy

func (*CDSData) Reset Uses

func (data *CDSData) Reset()

Reset resets

func (*CDSData) String Uses

func (data *CDSData) String() string

String converts to string

type ChaincodeData Uses

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

    // Version of the chaincode
    Version string `protobuf:"bytes,2,opt,name=version"`

    // Escc for the chaincode instance
    Escc string `protobuf:"bytes,3,opt,name=escc"`

    // Vscc for the chaincode instance
    Vscc string `protobuf:"bytes,4,opt,name=vscc"`

    // Policy endorsement policy for the chaincode instance
    Policy []byte `protobuf:"bytes,5,opt,name=policy,proto3"`

    // Data data specific to the package
    Data []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 eyecatcher
    Id  []byte `protobuf:"bytes,7,opt,name=id,proto3"`

    // InstantiationPolicy for the chaincode
    InstantiationPolicy []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)

func (*ChaincodeData) ProtoMessage Uses

func (*ChaincodeData) ProtoMessage()

ProtoMessage just exists to make proto happy

func (*ChaincodeData) Reset Uses

func (cd *ChaincodeData) Reset()

Reset resets

func (*ChaincodeData) String Uses

func (cd *ChaincodeData) String() string

String converts to string

Package ccprovider imports 2 packages (graph). Updated 2019-09-09. Refresh now. Tools for package owners.