Documentation ¶
Overview ¶
* @author PalletOne core developers <dev@pallet.one> * @date 2018
Index ¶
- func Deinit() error
- func Deploy(rwM rwset.TxManager, idag dboperation.IContractDag, chainID string, ...) (deployId []byte, deployPayload *md.ContractDeployPayload, e error)
- func GetBytesChaincodeEvent(event *pb.PtnChaincodeEvent) ([]byte, error)
- func GetBytesProposal(prop *peer.PtnProposal) ([]byte, error)
- func GetSysCCList() (ccInf []cclist.CCInfo, ccCount int, errs error)
- func Init(dag dboperation.IContractDag, jury core.IAdapterJury) error
- func InitNoSysCCC(jury core.IAdapterJury) error
- func Install(dag dboperation.IContractDag, ...) (payload *md.ContractTplPayload, err error)
- func Invoke(rwM rwset.TxManager, idag dboperation.IContractDag, chainID string, ...) (*md.ContractInvokeResult, error)
- func NewEndorserServer(s Support) pb.EndorserServer
- func RestartContainer(idag dboperation.IContractDag, chainID string, addr common.Address, ...) ([]byte, error)
- 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 SignedEndorserProposa(chainID string, txid string, cs *peer.PtnChaincodeSpec, ...) (*peer.PtnSignedProposal, *peer.PtnProposal, error)
- func Stop(rwM rwset.TxManager, idag dboperation.IContractDag, contractid []byte, ...) (*md.ContractStopPayload, error)
- func StopByName(contractid []byte, chainID string, txid string, usercc *md.Contract, ...) (*md.ContractStopPayload, error)
- type Endorser
- type Support
- type SupportImpl
- func (s *SupportImpl) Execute(contractid []byte, ctxt context.Context, cid, name, version, txid string, ...) (*pb.PtnResponse, *pb.PtnChaincodeEvent, error)
- func (s *SupportImpl) GetTxSimulator(rwM rwset.TxManager, idag dboperation.IContractDag, 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 Deploy ¶
func Deploy(rwM rwset.TxManager, idag dboperation.IContractDag, chainID string, templateId []byte, txId string, args [][]byte, timeout time.Duration) ( deployId []byte, deployPayload *md.ContractDeployPayload, e error)
func GetBytesChaincodeEvent ¶
func GetBytesChaincodeEvent(event *pb.PtnChaincodeEvent) ([]byte, error)
func GetBytesProposal ¶
func GetBytesProposal(prop *peer.PtnProposal) ([]byte, error)
func Init ¶
func Init(dag dboperation.IContractDag, jury core.IAdapterJury) error
contract manger module init
func InitNoSysCCC ¶
func InitNoSysCCC(jury core.IAdapterJury) error
func Install ¶
func Install(dag dboperation.IContractDag, chainID, ccName, ccPath, ccVersion, ccLanguage string) (payload *md.ContractTplPayload, err error)
install but not into db
func Invoke ¶
func Invoke(rwM rwset.TxManager, idag dboperation.IContractDag, 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 RestartContainer ¶ added in v1.0.1
func RestartContainer(idag dboperation.IContractDag, chainID string, addr common.Address, txId string) ([]byte, error)
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 SignedEndorserProposa ¶ added in v1.0.1
func SignedEndorserProposa(chainID string, txid string, cs *peer.PtnChaincodeSpec, creator, signature []byte) (*peer.PtnSignedProposal, *peer.PtnProposal, error)
func Stop ¶
func Stop(rwM rwset.TxManager, idag dboperation.IContractDag, contractid []byte, chainID string, txid string, 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 dboperation.IContractDag, deployId []byte, ctx context.Context, signedProp *pb.PtnSignedProposal, prop *pb.PtnProposal, chainID string, cid *pb.PtnChaincodeID, tmout time.Duration) ( *pb.PtnProposalResponse, *modules.ContractInvokeResult, error)
ProcessProposal process the Proposal func (e *Endorser) ProcessProposal(ctx context.Context, signedProp *pb.PtnSignedProposal) (*pb.PtnProposalResponse, 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 dboperation.IContractDag, txId string) (rwset.TxSimulator, error) IsSysCC(name string) bool Execute(contractid []byte, ctxt context.Context, cid, name, version, txid string, syscc bool, signedProp *pb.PtnSignedProposal, prop *pb.PtnProposal, spec interface{}, timeout time.Duration) (*pb.PtnResponse, *pb.PtnChaincodeEvent, 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.PtnSignedProposal, prop *pb.PtnProposal, spec interface{}, timeout time.Duration) (*pb.PtnResponse, *pb.PtnChaincodeEvent, error)
Execute - execute proposal, return original response of chaincode
func (*SupportImpl) GetTxSimulator ¶
func (s *SupportImpl) GetTxSimulator(rwM rwset.TxManager, idag dboperation.IContractDag, 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