Documentation ¶
Index ¶
- func NewInstancesManager(chainId string, logger protocol.Logger, commonConfig map[string]interface{}, ...) (protocol.VmInstancesManager, error)
- type InstancesManager
- func (m *InstancesManager) AfterSchedule(blockFingerprint string, blockHeight uint64)
- func (m *InstancesManager) BeforeSchedule(blockFingerprint string, blockHeight uint64)
- func (m *InstancesManager) NewRuntimeInstance(txSimContext protocol.TxSimContext, chainId, method, codePath string, ...) (protocol.RuntimeInstance, error)
- func (m *InstancesManager) StartVM() error
- func (m *InstancesManager) StopVM() error
- type RuntimeInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InstancesManager ¶
type InstancesManager struct { BlockDurationMgr *utils.BlockTxsDurationMgr // contains filtered or unexported fields }
InstancesManager manager all sandbox instances
func (*InstancesManager) AfterSchedule ¶
func (m *InstancesManager) AfterSchedule(blockFingerprint string, blockHeight uint64)
AfterSchedule print tx log after block schedule
func (*InstancesManager) BeforeSchedule ¶
func (m *InstancesManager) BeforeSchedule(blockFingerprint string, blockHeight uint64)
BeforeSchedule add request before block schedule
func (*InstancesManager) NewRuntimeInstance ¶
func (m *InstancesManager) NewRuntimeInstance(txSimContext protocol.TxSimContext, chainId, method, codePath string, contract *commonPb.Contract, byteCode []byte, logger protocol.Logger) (protocol.RuntimeInstance, error)
NewRuntimeInstance returns new runtime instance
func (*InstancesManager) StartVM ¶
func (m *InstancesManager) StartVM() error
StartVM Start Docker VM TODO: 多链时不共用同一个实例,chainId的作用
type RuntimeInstance ¶
type RuntimeInstance struct { DockerManager *InstancesManager // 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
Click to show internal directories.
Click to hide internal directories.