manger

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: GPL-3.0, GPL-3.0 Imports: 32 Imported by: 0

Documentation

Overview

* @author PalletOne core developers <dev@pallet.one> * @date 2018

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deinit

func Deinit() error

func Deploy

func Deploy(jA string, rwM rwset.TxManager, idag dag.IDag, chainID string, templateId []byte, txId string, args [][]byte, timeout time.Duration) (deployId []byte, deployPayload *md.ContractDeployPayload, e error)

func GetBytesChaincodeEvent

func GetBytesChaincodeEvent(event *pb.ChaincodeEvent) ([]byte, error)

func GetBytesProposal

func GetBytesProposal(prop *peer.Proposal) ([]byte, error)

func GetChaincode added in v1.0.3

func GetChaincode(dag dag.IDag, contractId common.Address) (*cclist.CCInfo, error)

func GetChaincodes added in v1.0.3

func GetChaincodes(dag dag.IDag) ([]*cclist.CCInfo, error)

func GetSysCCList

func GetSysCCList() (ccInf []cclist.CCInfo, ccCount int, errs error)

func Init

func Init(dag dag.IDag, jury core.IAdapterJury) error

contract manger module init

func InitNoSysCCC

func InitNoSysCCC(jury core.IAdapterJury) error

func Install

func Install(dag dag.IDag, chainID, ccName, ccPath, ccVersion, ccDescription, ccAbi, ccLanguage string) (payload *md.ContractTplPayload, err error)

install but not into db

func Invoke

func Invoke(rwM rwset.TxManager, idag dag.IDag, chainID string, deployId []byte, txid string, args [][]byte, timeout time.Duration) (*md.ContractInvokeResult, error)

ccName can be contract Id func Invoke(chainID string, deployId []byte, txid string, args [][]byte, timeout time.Duration) (*peer.ContractInvokePayload, error) {

func NewEndorserServer

func NewEndorserServer(s Support) pb.EndorserServer

NewEndorserServer creates and returns a new Endorser server instance.

func RemoveExpiredContainers added in v1.0.3

func RemoveExpiredContainers(client *docker.Client, dag dag.IDag, rmExpConFromSysParam bool, con []docker.APIContainers)

删除所有过期容器

func RestartContainer added in v1.0.1

func RestartContainer(idag dag.IDag, chainID string, addr common.Address, txId string) ([]byte, error)

func RestartContainers added in v1.0.3

func RestartContainers(dag dag.IDag, cons []docker.APIContainers, jury core.IAdapterJury)

func RwTxResult2DagDeployUnit

func RwTxResult2DagDeployUnit(tx rwset.TxSimulator, templateId []byte, nm string, contractId []byte, args [][]byte, timeout time.Duration) (*md.ContractDeployPayload, error)

func RwTxResult2DagDeployUnit(tx rwset.TxSimulator, txid string, nm string, fun []byte) (*pb.ContractDeployPayload, error) {

func RwTxResult2DagInvokeUnit

func RwTxResult2DagInvokeUnit(tx rwset.TxSimulator, txid string, nm string, deployId []byte, args [][]byte, timeout time.Duration) (*md.ContractInvokeResult, error)

func SaveChaincode added in v1.0.3

func SaveChaincode(dag dag.IDag, contractId common.Address, chaincode *cclist.CCInfo) error

func SignedEndorserProposa added in v1.0.1

func SignedEndorserProposa(chainID string, txid string, cs *peer.ChaincodeSpec, creator, signature []byte) (*peer.SignedProposal, *peer.Proposal, error)

func Stop

func Stop(rwM rwset.TxManager, idag dag.IDag, contractid []byte, chainID string, txid string, deleteImage bool, dontRmCon bool) (*md.ContractStopPayload, error)

func StopByName

func StopByName(contractid []byte, chainID string, txid string, usercc *cclist.CCInfo, deleteImage bool, dontRmCon bool) (*md.ContractStopPayload, error)

Types

type Endorser

type Endorser struct {
	// contains filtered or unexported fields
}

Endorser provides the Endorser service ProcessProposal

func (*Endorser) ProcessProposal

func (e *Endorser) ProcessProposal(rwM rwset.TxManager, idag dag.IDag, deployId []byte, ctx context.Context, signedProp *pb.SignedProposal, prop *pb.Proposal, chainID string, cid *pb.ChaincodeID, tmout time.Duration) (*pb.ProposalResponse, *modules.ContractInvokeResult, error)

ProcessProposal process the Proposal func (e *Endorser) ProcessProposal(ctx context.Context, signedProp *pb.SignedProposal) (*pb.ProposalResponse, error) {

type Support

type Support interface {
	IsSysCCAndNotInvokableExternal(name string) bool
	// GetTxSimulator returns the transaction simulator ,they are made unique
	// by way of the supplied txid
	GetTxSimulator(rwM rwset.TxManager, idag dag.IDag, chainid string, txid string) (rwset.TxSimulator, error)

	IsSysCC(name string) bool

	Execute(contractid []byte, ctxt context.Context, cid, name, version, txid string, syscc bool, signedProp *pb.SignedProposal, prop *pb.Proposal, spec interface{}, timeout time.Duration) (*pb.Response, *pb.ChaincodeEvent, error)
}

Support contains functions that the endorser requires to execute its tasks

type SupportImpl

type SupportImpl struct {
}

SupportImpl provides an implementation of the endorser.Support interface issuing calls to various static methods of the peer

func (*SupportImpl) Execute

func (s *SupportImpl) Execute(contractid []byte, ctxt context.Context, cid, name, version, txid string, syscc bool, signedProp *pb.SignedProposal, prop *pb.Proposal, spec interface{}, timeout time.Duration) (*pb.Response, *pb.ChaincodeEvent, error)

Execute - execute proposal, return original response of chaincode

func (*SupportImpl) GetTxSimulator

func (s *SupportImpl) GetTxSimulator(rwM rwset.TxManager, idag dag.IDag, chainid string, txid string) (rwset.TxSimulator, error)

GetTxSimulator returns the transaction simulator for the specified ledger a client may obtain more than one such simulator; they are made unique by way of the supplied txid

func (*SupportImpl) IsSysCC

func (s *SupportImpl) IsSysCC(name string) bool

IsSysCC returns true if the name matches a system chaincode's system chaincode names are system, chain wide

func (*SupportImpl) IsSysCCAndNotInvokableExternal

func (s *SupportImpl) IsSysCCAndNotInvokableExternal(name string) bool

IsSysCCAndNotInvokableExternal returns true if the supplied chaincode is ia system chaincode and it NOT invokable

Jump to

Keyboard shortcuts

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