Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseVM ¶
type BaseVM interface {
// Type return the vm type.
Type() string
// Close close vm.
Close()
}
BaseVM is the part interface of VM that will be called in both master and worker
type MasterVM ¶
type MasterVM interface {
// BeforeDeploy will call before deploy contract.
BeforeDeploy() error
// DeployContract deploy contract.
DeployContract() error
// BeforeGet will call before get context.
BeforeGet() error
// GetContext generate context for execute tx in vm.
GetContext() ([]byte, error)
// Statistic statistic remote execute info.
Statistic(from, to *fcom.ChainInfo) (*fcom.RemoteStatistic, error)
// LogStatus records blockheight and time
LogStatus() (*fcom.ChainInfo, error)
}
MasterVM is the part interface of VM that will be called in master
type Type ¶
type Type string
Type is the ext name of script file
const ( // LUA vm type of lua. LUA Type = "lua" )
type WorkerVM ¶
type WorkerVM interface {
// BeforeSet will call before set context.
BeforeSet() error
// SetContext set context for execute tx in vm, the ctx is generated by GetContext.
SetContext(ctx []byte) error
// BeforeRun will call once before run.
BeforeRun() error
// Run create and send tx to client.
Run(ctx fcom.TxContext) (*fcom.Result, error)
// Verify check the relative time of transaction
Verify(*fcom.Result, ...fcom.Option) *fcom.Result
// AfterRun will call once after run.
AfterRun() error
}
WorkerVM is the part interface of VM that will be called in worker
Click to show internal directories.
Click to hide internal directories.