rpc

package
v2.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientStream

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

func (*ContractEngineClient) Start

func (c *ContractEngineClient) Start() error

Start .

func (*ContractEngineClient) Stop

func (c *ContractEngineClient) Stop()

Stop .

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

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

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

Jump to

Keyboard shortcuts

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