Documentation ¶
Overview ¶
Copyright (C) THL A29 Limited, a Tencent company. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Index ¶
- func NewDockerManager(chainId string, vmConfig map[string]interface{}) protocol.VmInstancesManager
- type BlockElapsedTime
- type ClientManager
- type DockerManager
- func (m *DockerManager) AfterSchedule(blockFingerprint string, blockHeight uint64)
- func (m *DockerManager) BeforeSchedule(blockFingerprint string, blockHeight uint64)
- func (m *DockerManager) NewRuntimeInstance(txSimContext protocol.TxSimContext, chainId, method, codePath string, ...) (protocol.RuntimeInstance, error)
- func (m *DockerManager) StartVM() error
- func (m *DockerManager) StopVM() error
- type RequestMgr
- type RuntimeInstance
- type SysCallElapsedTime
- type TxElapsedTime
- func (e *TxElapsedTime) Add(t *TxElapsedTime)
- func (e *TxElapsedTime) AddContingentSysCall(spend int64)
- func (e *TxElapsedTime) AddSysCallElapsedTime(sysCallElapsedTime *SysCallElapsedTime)
- func (e *TxElapsedTime) AddToSysCallList(sysCallElapsedTime *SysCallElapsedTime)
- func (e *TxElapsedTime) PrintSysCallList() string
- func (e *TxElapsedTime) ToString() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockElapsedTime ¶
type BlockElapsedTime struct {
// contains filtered or unexported fields
}
func (*BlockElapsedTime) AddTxElapsedTime ¶
func (b *BlockElapsedTime) AddTxElapsedTime(t *TxElapsedTime)
todo add lock
func (*BlockElapsedTime) ToString ¶
func (b *BlockElapsedTime) ToString() string
type ClientManager ¶
type ClientManager interface { PutTxRequest(txRequest *protogo.CDMMessage) PutSysCallResponse(sysCallResp *protogo.CDMMessage) RegisterReceiveChan(chainId, txId string, receiveCh chan *protogo.CDMMessage) error DeleteReceiveChan(chainId, txId string) bool GetVMConfig() *config.DockerVMConfig GetUniqueTxKey(txId string) string NeedSendContractByteCode() bool HasActiveConnections() bool }
type DockerManager ¶
type DockerManager struct { RequestMgr *RequestMgr // contains filtered or unexported fields }
func (*DockerManager) AfterSchedule ¶
func (m *DockerManager) AfterSchedule(blockFingerprint string, blockHeight uint64)
func (*DockerManager) BeforeSchedule ¶
func (m *DockerManager) BeforeSchedule(blockFingerprint string, blockHeight uint64)
func (*DockerManager) NewRuntimeInstance ¶
func (*DockerManager) StopVM ¶
func (m *DockerManager) StopVM() error
StopVM stop docker vm and remove container, image
type RequestMgr ¶
type RequestMgr struct { RequestMap map[string]*BlockElapsedTime // contains filtered or unexported fields }
func NewRequestMgr ¶
func NewRequestMgr() *RequestMgr
func (*RequestMgr) AddRequest ¶
func (r *RequestMgr) AddRequest(requestId string)
func (*RequestMgr) AddTx ¶
func (r *RequestMgr) AddTx(requestId string, txTime *TxElapsedTime)
AddTx if add tx to tx request map need lock
func (*RequestMgr) PrintBlockElapsedTime ¶
func (r *RequestMgr) PrintBlockElapsedTime(requestId string) string
func (*RequestMgr) RemoveRequest ¶
func (r *RequestMgr) RemoveRequest(requestId string)
type RuntimeInstance ¶
type RuntimeInstance struct { ChainId string // chain id ClientManager ClientManager Log protocol.Logger DockerManager *DockerManager // contains filtered or unexported fields }
RuntimeInstance docker-go runtime
func (*RuntimeInstance) Invoke ¶
func (r *RuntimeInstance) Invoke(contract *commonPb.Contract, method string, byteCode []byte, parameters map[string][]byte, txSimContext protocol.TxSimContext, gasUsed uint64) (contractResult *commonPb.ContractResult, execOrderTxType protocol.ExecOrderTxType)
Invoke process one tx in docker and return result nolint: gocyclo, revive
type SysCallElapsedTime ¶
type SysCallElapsedTime struct { OpType protogo.CDMType StartTime int64 //EndTime int64 TotalTime int64 StorageTimeInSysCall int64 }
func NewSysCallElapsedTime ¶
func (*SysCallElapsedTime) ToString ¶
func (s *SysCallElapsedTime) ToString() string
type TxElapsedTime ¶
type TxElapsedTime struct { TxId string StartTime int64 EndTime int64 TotalTime int64 SysCallCnt int32 SysCallTime int64 StorageTimeInSysCall int64 ContingentSysCallCnt int32 ContingentSysCallTime int64 CrossCallCnt int32 CrossCallTime int64 SysCallList []*SysCallElapsedTime }
func NewTxElapsedTime ¶
func NewTxElapsedTime(txId string, startTime int64) *TxElapsedTime
func (*TxElapsedTime) Add ¶
func (e *TxElapsedTime) Add(t *TxElapsedTime)
func (*TxElapsedTime) AddContingentSysCall ¶
func (e *TxElapsedTime) AddContingentSysCall(spend int64)
func (*TxElapsedTime) AddSysCallElapsedTime ¶
func (e *TxElapsedTime) AddSysCallElapsedTime(sysCallElapsedTime *SysCallElapsedTime)
todo add lock (maybe do not need)
func (*TxElapsedTime) AddToSysCallList ¶
func (e *TxElapsedTime) AddToSysCallList(sysCallElapsedTime *SysCallElapsedTime)
todo add lock (maybe do not need)
func (*TxElapsedTime) PrintSysCallList ¶
func (e *TxElapsedTime) PrintSysCallList() string
func (*TxElapsedTime) ToString ¶
func (e *TxElapsedTime) ToString() string
Click to show internal directories.
Click to hide internal directories.