lifecycle

package
v1.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChaincodeStore

type ChaincodeStore interface {
	Save(name, version string, ccInstallPkg []byte) (hash []byte, err error)
}

ChaincodeStore provides a way to persist chaincodes

type Lifecycle

type Lifecycle struct {
	ChaincodeStore ChaincodeStore
	PackageParser  PackageParser
}

Lifecycle implements the lifecycle operations which are invoked by the SCC as well as internally

func (*Lifecycle) InstallChaincode

func (l *Lifecycle) InstallChaincode(name, version string, chaincodeInstallPackage []byte) ([]byte, error)

InstallChaincode installs a given chaincode to the peer's chaincode store. It returns the hash to reference the chaincode by or an error on failure.

type PackageParser

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

type SCC

type SCC struct{}

SCC implements the required methods to satisfy the chaincode interface. It routes the invocation calls to the backing implementations.

func (*SCC) Chaincode

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

Chaincode returns a reference to itself

func (*SCC) Enabled

func (scc *SCC) Enabled() bool

Enabled returns true

func (*SCC) Init

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

Init is mostly useless for system chaincodes and always returns success

func (*SCC) InitArgs

func (scc *SCC) InitArgs() [][]byte

InitArgs returns nil

func (*SCC) InvokableCC2CC

func (scc *SCC) InvokableCC2CC() bool

InvokableCC2CC returns true

func (*SCC) InvokableExternal

func (scc *SCC) InvokableExternal() bool

InvokableExternal returns true

func (*SCC) Invoke

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

Invoke takes chaincode invocation arguments and routes them to the correct underlying lifecycle operation.

func (*SCC) Name

func (scc *SCC) Name() string

Name returns "+lifecycle"

func (*SCC) Path

func (scc *SCC) Path() string

Path returns "github.com/hyperledger/fabric/core/chaincode/lifecycle"

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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