Documentation ¶
Index ¶
- func GetClientStream(conn *grpc.ClientConn) (protogo.DockerVMRpc_DockerVMCommunicateClient, error)
- func NewClientManager(logger protocol.Logger, vmConfig *config.DockerVMConfig) interfaces.ContractEngineClientMgr
- type ContractEngineClient
- type ContractEngineClientManager
- func (cm *ContractEngineClientManager) DeleteNotify(chainId, txId string) bool
- func (cm *ContractEngineClientManager) GetByteCodeRespChLen() int
- func (cm *ContractEngineClientManager) GetByteCodeRespSendCh() chan *protogo.DockerVMMessage
- func (cm *ContractEngineClientManager) GetReceiveNotify(chainId, txId string) func(msg *protogo.DockerVMMessage)
- func (cm *ContractEngineClientManager) GetTxSendCh() chan *protogo.DockerVMMessage
- func (cm *ContractEngineClientManager) GetTxSendChLen() int
- func (cm *ContractEngineClientManager) GetUniqueTxKey(txId string) string
- func (cm *ContractEngineClientManager) GetVMConfig() *config.DockerVMConfig
- func (cm *ContractEngineClientManager) HasActiveConnections() bool
- func (cm *ContractEngineClientManager) NeedSendContractByteCode() bool
- func (cm *ContractEngineClientManager) PutByteCodeResp(getByteCodeResp *protogo.DockerVMMessage)
- func (cm *ContractEngineClientManager) PutEvent(event *interfaces.Event)
- func (cm *ContractEngineClientManager) PutTxRequestWithNotify(txRequest *protogo.DockerVMMessage, chainId string, ...) error
- func (cm *ContractEngineClientManager) Start() error
- func (cm *ContractEngineClientManager) Stop() error
- type RuntimeServer
- type RuntimeService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientStream ¶
func GetClientStream(conn *grpc.ClientConn) (protogo.DockerVMRpc_DockerVMCommunicateClient, error)
GetClientStream get rpc stream
func NewClientManager ¶
func NewClientManager( logger protocol.Logger, vmConfig *config.DockerVMConfig, ) interfaces.ContractEngineClientMgr
NewClientManager returns new client manager
Types ¶
type ContractEngineClient ¶
type ContractEngineClient struct {
// contains filtered or unexported fields
}
ContractEngineClient .
func NewContractEngineClient ¶
func NewContractEngineClient( id uint64, logger protocol.Logger, cm interfaces.ContractEngineClientMgr, ) *ContractEngineClient
NewContractEngineClient .
func (*ContractEngineClient) NewClientConn ¶
func (c *ContractEngineClient) NewClientConn() (*grpc.ClientConn, error)
NewClientConn create rpc connection
type ContractEngineClientManager ¶
type ContractEngineClientManager struct {
// contains filtered or unexported fields
}
ContractEngineClientManager manager all contract engine clients
func (*ContractEngineClientManager) DeleteNotify ¶
func (cm *ContractEngineClientManager) DeleteNotify(chainId, txId string) bool
DeleteNotify delete notify
func (*ContractEngineClientManager) GetByteCodeRespChLen ¶
func (cm *ContractEngineClientManager) GetByteCodeRespChLen() int
GetByteCodeRespChLen returns bytecode resp chan length
func (*ContractEngineClientManager) GetByteCodeRespSendCh ¶
func (cm *ContractEngineClientManager) GetByteCodeRespSendCh() chan *protogo.DockerVMMessage
GetByteCodeRespSendCh returns bytecode resp send ch
func (*ContractEngineClientManager) GetReceiveNotify ¶
func (cm *ContractEngineClientManager) GetReceiveNotify(chainId, txId string) func(msg *protogo.DockerVMMessage)
GetReceiveNotify returns receive notify
func (*ContractEngineClientManager) GetTxSendCh ¶
func (cm *ContractEngineClientManager) GetTxSendCh() chan *protogo.DockerVMMessage
GetTxSendCh returns tx send channel
func (*ContractEngineClientManager) GetTxSendChLen ¶
func (cm *ContractEngineClientManager) GetTxSendChLen() int
GetTxSendChLen returns tx send chan length
func (*ContractEngineClientManager) GetUniqueTxKey ¶
func (cm *ContractEngineClientManager) GetUniqueTxKey(txId string) string
GetUniqueTxKey returns unique tx key
func (*ContractEngineClientManager) GetVMConfig ¶
func (cm *ContractEngineClientManager) GetVMConfig() *config.DockerVMConfig
GetVMConfig returns vm config
func (*ContractEngineClientManager) HasActiveConnections ¶
func (cm *ContractEngineClientManager) HasActiveConnections() bool
HasActiveConnections returns the alive client map length
func (*ContractEngineClientManager) NeedSendContractByteCode ¶
func (cm *ContractEngineClientManager) NeedSendContractByteCode() bool
NeedSendContractByteCode judge whether it need to send contract bytecode
func (*ContractEngineClientManager) PutByteCodeResp ¶
func (cm *ContractEngineClientManager) PutByteCodeResp(getByteCodeResp *protogo.DockerVMMessage)
PutByteCodeResp put butecode resp into bytecode resp channel
func (*ContractEngineClientManager) PutEvent ¶
func (cm *ContractEngineClientManager) PutEvent(event *interfaces.Event)
PutEvent put event into event channel
func (*ContractEngineClientManager) PutTxRequestWithNotify ¶
func (cm *ContractEngineClientManager) PutTxRequestWithNotify( txRequest *protogo.DockerVMMessage, chainId string, notify func(msg *protogo.DockerVMMessage), ) error
PutTxRequestWithNotify put tx request with notify into tx send channel
func (*ContractEngineClientManager) Start ¶
func (cm *ContractEngineClientManager) Start() error
Start establish connections
func (*ContractEngineClientManager) Stop ¶
func (cm *ContractEngineClientManager) Stop() error
Stop all connectiosn
type RuntimeServer ¶
type RuntimeServer struct {
// contains filtered or unexported fields
}
RuntimeServer server for sandbox
func NewRuntimeServer ¶
func NewRuntimeServer(logger protocol.Logger, vmConfig *config.DockerVMConfig) (*RuntimeServer, error)
NewRuntimeServer .
func (*RuntimeServer) StartRuntimeServer ¶
func (s *RuntimeServer) StartRuntimeServer(runtimeService *RuntimeService) error
StartRuntimeServer .
func (*RuntimeServer) StopRuntimeServer ¶
func (s *RuntimeServer) StopRuntimeServer()
StopRuntimeServer stops runtime server
type RuntimeService ¶
type RuntimeService struct {
// contains filtered or unexported fields
}
RuntimeService is the sandbox - chainmaker service
func NewRuntimeService ¶
func NewRuntimeService(logger protocol.Logger) *RuntimeService
NewRuntimeService returns runtime service
func (*RuntimeService) DeleteSandboxMsgNotify ¶
func (s *RuntimeService) DeleteSandboxMsgNotify(chainId, txId string) bool
DeleteSandboxMsgNotify delete sandbox msg notify
func (*RuntimeService) DockerVMCommunicate ¶
func (s *RuntimeService) DockerVMCommunicate(stream protogo.DockerVMRpc_DockerVMCommunicateServer) error
DockerVMCommunicate is the runtime docker vm communicate stream
func (*RuntimeService) RegisterSandboxMsgNotify ¶
func (s *RuntimeService) RegisterSandboxMsgNotify(chainId, txKey string, respNotify func(msg *protogo.DockerVMMessage, sendF func(*protogo.DockerVMMessage))) error
RegisterSandboxMsgNotify register sandbox msg notify