Documentation ¶
Index ¶
- Constants
- func CustomLevelEncoder(level zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func EnterNextStep(msg *protogo.DockerVMMessage, stepType protogo.StepType, log string)
- func GetAllStackMsg() string
- func GetClientStream(conn *grpc.ClientConn) (protogo.DockerVMRpc_DockerVMCommunicateClient, error)
- func PrintTxSteps(msg *protogo.DockerVMMessage) string
- func PrintTxStepsWithTime(msg *protogo.DockerVMMessage, untilDuration time.Duration) (string, bool)
- func Start(contract sdk.Contract) error
- type Conf
- type ContractEngineClient
- type ContractEngineClientConf
- type PRCProtocolType
- type RuntimeClient
- type RuntimeClientConf
- type SysCallDuration
- type TxDuration
- func (t *TxDuration) EndSysCall(msg *protogo.DockerVMMessage) error
- func (t *TxDuration) GetLatestSysCall() (*SysCallDuration, error)
- func (t *TxDuration) PrintSysCallList() string
- func (t *TxDuration) Reset(tx *protogo.DockerVMMessage, startTime int64)
- func (t *TxDuration) StartSysCall(msg *protogo.DockerVMMessage)
- func (t *TxDuration) ToString() string
- type TxHandler
- func (h *TxHandler) PutMsg(msg *protogo.DockerVMMessage)
- func (h *TxHandler) PutMsgWithNotify(msg *protogo.DockerVMMessage, ...)
- func (h *TxHandler) RegisterSyscallMsgSendFunc(f func(msg *protogo.DockerVMMessage, ...))
- func (h *TxHandler) RegisterTxFinishMsgNotifyFunc(txFinishMsgNotifyFunc func(msg *protogo.DockerVMMessage))
- func (h *TxHandler) Start() error
- type TxStatus
Constants ¶
const ( SHOWLINE = false LEVEL_DEBUG = "DEBUG" LEVEL_INFO = "INFO" LEVEL_WARN = "WARN" LEVEL_ERROR = "ERROR" MODULE_SANDBOX = "Sandbox" MODULE_CONTRACT = "Contract" )
const ( ExitCode_UNKNOWN = 1 ExitCode_SIGINT = 128 + 2 ExitCode_SIGTERM = 128 + 15 )
Variables ¶
This section is empty.
Functions ¶
func CustomLevelEncoder ¶
func CustomLevelEncoder(level zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
func CustomTimeEncoder ¶
func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
func EnterNextStep ¶
func EnterNextStep(msg *protogo.DockerVMMessage, stepType protogo.StepType, log string)
EnterNextStep enter next duration tx step
func GetAllStackMsg ¶
func GetAllStackMsg() string
func GetClientStream ¶
func GetClientStream(conn *grpc.ClientConn) (protogo.DockerVMRpc_DockerVMCommunicateClient, error)
GetClientStream get rpc stream
func PrintTxSteps ¶
func PrintTxSteps(msg *protogo.DockerVMMessage) string
PrintTxSteps print all duration tx steps
func PrintTxStepsWithTime ¶
PrintTxStepsWithTime print all duration tx steps with time limt
Types ¶
type Conf ¶
type Conf struct { ProcessName string ContractName string LogLevel string ContractEngineClient *ContractEngineClientConf RuntimeClient *RuntimeClientConf }
type ContractEngineClient ¶
type ContractEngineClient struct {
// contains filtered or unexported fields
}
func (*ContractEngineClient) PutFinishMsg ¶
func (c *ContractEngineClient) PutFinishMsg(msg *protogo.DockerVMMessage)
func (*ContractEngineClient) RegisterTxRequestPutFunc ¶
func (c *ContractEngineClient) RegisterTxRequestPutFunc(txRequestPutFunc func(msg *protogo.DockerVMMessage, txFinishMsgNotifyFunc func(signal *protogo.DockerVMMessage)))
RegisterTxRequestPutFunc register put func to send txRequest to txHandler with a callback fun that returns a finish signal
func (*ContractEngineClient) Start ¶
func (c *ContractEngineClient) Start() error
type RuntimeClient ¶
type RuntimeClient struct {
// contains filtered or unexported fields
}
func (*RuntimeClient) PutMsg ¶
func (r *RuntimeClient) PutMsg(msg *protogo.DockerVMMessage)
PutMsg put msg to send channel
func (*RuntimeClient) PutMsgWithNotify ¶
func (r *RuntimeClient) PutMsgWithNotify(msg *protogo.DockerVMMessage, syscallResponseNotifyFunc func(msg *protogo.DockerVMMessage))
PutMsgWithNotify put msg nad register call back func for sys_call response
func (*RuntimeClient) RegisterResponseNotifier ¶
func (r *RuntimeClient) RegisterResponseNotifier(syscallResponseNotifyFunc func(msg *protogo.DockerVMMessage))
RegisterResponseNotifier register callback func for sys_call response
func (*RuntimeClient) Start ¶
func (r *RuntimeClient) Start() error
type RuntimeClientConf ¶
type SysCallDuration ¶
type SysCallDuration struct { OpType protogo.DockerVMType StartTime int64 TotalDuration int64 }
func (*SysCallDuration) ToString ¶
func (s *SysCallDuration) ToString() string
type TxDuration ¶
type TxDuration struct { Tx *protogo.DockerVMMessage StartTime int64 EndTime int64 TotalDuration int64 SysCallCnt int32 SysCallDuration int64 CrossCallCnt int32 CrossCallDuration int64 SysCallList []*SysCallDuration }
func NewTxDuration ¶
func NewTxDuration(tx *protogo.DockerVMMessage, startTime int64) *TxDuration
func (*TxDuration) EndSysCall ¶
func (t *TxDuration) EndSysCall(msg *protogo.DockerVMMessage) error
EndSysCall close new sys call
func (*TxDuration) GetLatestSysCall ¶
func (t *TxDuration) GetLatestSysCall() (*SysCallDuration, error)
GetLatestSysCall returns latest sys call
func (*TxDuration) PrintSysCallList ¶
func (t *TxDuration) PrintSysCallList() string
func (*TxDuration) Reset ¶
func (t *TxDuration) Reset(tx *protogo.DockerVMMessage, startTime int64)
func (*TxDuration) StartSysCall ¶
func (t *TxDuration) StartSysCall(msg *protogo.DockerVMMessage)
StartSysCall start new sys call
func (*TxDuration) ToString ¶
func (t *TxDuration) ToString() string
type TxHandler ¶
type TxHandler struct {
// contains filtered or unexported fields
}
func (*TxHandler) PutMsg ¶
func (h *TxHandler) PutMsg(msg *protogo.DockerVMMessage)
PutMsg put txRequest to pendingQueue
func (*TxHandler) PutMsgWithNotify ¶
func (h *TxHandler) PutMsgWithNotify(msg *protogo.DockerVMMessage, txFinishMsgNotifyFunc func(msg *protogo.DockerVMMessage))
PutMsgWithNotify put tx request to handler and register finish signal callback func
func (*TxHandler) RegisterSyscallMsgSendFunc ¶
func (h *TxHandler) RegisterSyscallMsgSendFunc(f func(msg *protogo.DockerVMMessage, syscallResponseNotifyFunc func(msg *protogo.DockerVMMessage)))
RegisterSyscallMsgSendFunc register runtime client syscall func with call back func
func (*TxHandler) RegisterTxFinishMsgNotifyFunc ¶
func (h *TxHandler) RegisterTxFinishMsgNotifyFunc(txFinishMsgNotifyFunc func(msg *protogo.DockerVMMessage))
RegisterTxFinishMsgNotifyFunc register func to send tx finish msg to engine
type TxStatus ¶
type TxStatus string
const ( BeforeListening TxStatus = "before listening" BeforeReceive TxStatus = "before receive" BeforeExecute TxStatus = "before execute" Executing TxStatus = "executing" WaitingSysCallResponse TxStatus = "waiting syscall response" AfterExecuted TxStatus = "after executed" AfterSendResponse TxStatus = "after send response" Finished TxStatus = "finished" )