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 ¶ added in v2.3.0
type BlockElapsedTime struct {
// contains filtered or unexported fields
}
func (*BlockElapsedTime) AddTxElapsedTime ¶ added in v2.3.0
func (b *BlockElapsedTime) AddTxElapsedTime(t *TxElapsedTime)
todo add lock
func (*BlockElapsedTime) ToString ¶ added in v2.3.0
func (b *BlockElapsedTime) ToString() string
type ClientManager ¶ added in v2.2.2
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 ¶ added in v2.3.0
func (m *DockerManager) AfterSchedule(blockFingerprint string, blockHeight uint64)
func (*DockerManager) BeforeSchedule ¶ added in v2.3.0
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 ¶ added in v2.3.0
type RequestMgr struct { RequestMap map[string]*BlockElapsedTime // contains filtered or unexported fields }
func NewRequestMgr ¶ added in v2.3.0
func NewRequestMgr() *RequestMgr
func (*RequestMgr) AddRequest ¶ added in v2.3.0
func (r *RequestMgr) AddRequest(requestId string)
func (*RequestMgr) AddTx ¶ added in v2.3.0
func (r *RequestMgr) AddTx(requestId string, txTime *TxElapsedTime)
AddTx if add tx to tx request map need lock
func (*RequestMgr) PrintBlockElapsedTime ¶ added in v2.3.0
func (r *RequestMgr) PrintBlockElapsedTime(requestId string) string
func (*RequestMgr) RemoveRequest ¶ added in v2.3.0
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 ¶ added in v2.3.0
type SysCallElapsedTime struct { OpType protogo.CDMType StartTime int64 //EndTime int64 TotalTime int64 StorageTimeInSysCall int64 }
func NewSysCallElapsedTime ¶ added in v2.3.0
func (*SysCallElapsedTime) ToString ¶ added in v2.3.0
func (s *SysCallElapsedTime) ToString() string
type TxElapsedTime ¶ added in v2.3.0
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 ¶ added in v2.3.0
func NewTxElapsedTime(txId string, startTime int64) *TxElapsedTime
func (*TxElapsedTime) Add ¶ added in v2.3.0
func (e *TxElapsedTime) Add(t *TxElapsedTime)
func (*TxElapsedTime) AddContingentSysCall ¶ added in v2.3.0
func (e *TxElapsedTime) AddContingentSysCall(spend int64)
func (*TxElapsedTime) AddSysCallElapsedTime ¶ added in v2.3.0
func (e *TxElapsedTime) AddSysCallElapsedTime(sysCallElapsedTime *SysCallElapsedTime)
todo add lock (maybe do not need)
func (*TxElapsedTime) AddToSysCallList ¶ added in v2.3.0
func (e *TxElapsedTime) AddToSysCallList(sysCallElapsedTime *SysCallElapsedTime)
todo add lock (maybe do not need)
func (*TxElapsedTime) PrintSysCallList ¶ added in v2.3.0
func (e *TxElapsedTime) PrintSysCallList() string
func (*TxElapsedTime) ToString ¶ added in v2.3.0
func (e *TxElapsedTime) ToString() string
Click to show internal directories.
Click to hide internal directories.