Documentation ¶
Overview ¶
* @author PalletOne core developers <dev@pallet.one> * @date 2018
Index ¶
- func Deinit() error
- func Deploy(jA string, rwM rwset.TxManager, idag dag.IDag, chainID string, ...) (deployId []byte, deployPayload *md.ContractDeployPayload, e error)
- func GetBytesChaincodeEvent(event *pb.ChaincodeEvent) ([]byte, error)
- func GetBytesProposal(prop *peer.Proposal) ([]byte, error)
- func GetChaincode(dag dag.IDag, contractId common.Address) (*cclist.CCInfo, error)
- func GetChaincodes(dag dag.IDag) ([]*cclist.CCInfo, error)
- func GetSysCCList() (ccInf []cclist.CCInfo, ccCount int, errs error)
- func Init(dag dag.IDag, jury core.IAdapterJury) error
- func InitNoSysCCC(jury core.IAdapterJury) error
- func Install(dag dag.IDag, ...) (payload *md.ContractTplPayload, err error)
- func Invoke(rwM rwset.TxManager, idag dag.IDag, chainID string, deployId []byte, ...) (*md.ContractInvokeResult, error)
- func NewEndorserServer(s Support) pb.EndorserServer
- func RemoveExpiredContainers(client *docker.Client, dag dag.IDag, rmExpConFromSysParam bool, ...)
- func RestartContainer(idag dag.IDag, chainID string, addr common.Address, txId string) ([]byte, error)
- func RestartContainers(dag dag.IDag, cons []docker.APIContainers, jury core.IAdapterJury)
- func RwTxResult2DagDeployUnit(tx rwset.TxSimulator, templateId []byte, nm string, contractId []byte, ...) (*md.ContractDeployPayload, error)
- func RwTxResult2DagInvokeUnit(tx rwset.TxSimulator, txid string, nm string, deployId []byte, args [][]byte, ...) (*md.ContractInvokeResult, error)
- func SaveChaincode(dag dag.IDag, contractId common.Address, chaincode *cclist.CCInfo) error
- func SignedEndorserProposa(chainID string, txid string, cs *peer.ChaincodeSpec, creator, signature []byte) (*peer.SignedProposal, *peer.Proposal, error)
- func Stop(rwM rwset.TxManager, idag dag.IDag, contractid []byte, chainID string, ...) (*md.ContractStopPayload, error)
- func StopByName(contractid []byte, chainID string, txid string, usercc *cclist.CCInfo, ...) (*md.ContractStopPayload, error)
- type Endorser
- type Support
- type SupportImpl
- func (s *SupportImpl) Execute(contractid []byte, ctxt context.Context, cid, name, version, txid string, ...) (*pb.Response, *pb.ChaincodeEvent, error)
- func (s *SupportImpl) GetTxSimulator(rwM rwset.TxManager, idag dag.IDag, chainid string, txid string) (rwset.TxSimulator, error)
- func (s *SupportImpl) IsSysCC(name string) bool
- func (s *SupportImpl) IsSysCCAndNotInvokableExternal(name string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBytesChaincodeEvent ¶
func GetBytesChaincodeEvent(event *pb.ChaincodeEvent) ([]byte, error)
func GetChaincode ¶ added in v1.0.3
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 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 SaveChaincode ¶ added in v1.0.3
func SignedEndorserProposa ¶ added in v1.0.1
func SignedEndorserProposa(chainID string, txid string, cs *peer.ChaincodeSpec, creator, signature []byte) (*peer.SignedProposal, *peer.Proposal, 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