Documentation ¶
Index ¶
- func Register(name string, driver NewInstanceCreatorFunc)
- type CodeHandle
- type CodeManager
- type ContractCode
- type InstanceCreator
- type NewInstanceCreatorFunc
- type VMManager
- func (v *VMManager) DeployContract(args map[string][]byte) (*pb.Response, gas.Limits, error)
- func (v *VMManager) InvokeContract(method string, args map[string][]byte) (*pb.Response, gas.Limits, error)
- func (v *VMManager) NewCreatorInstance(ctx *bridge.ContractState) (bridge.Instance, error)
- func (v *VMManager) RegisterSyscallService(syscall *bridge.SyscallService)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, driver NewInstanceCreatorFunc)
Register makes a wasm driver available by the provided name
Types ¶
type CodeHandle ¶
type CodeHandle interface { GetExecCode(name string) (*ContractCode, error) RemoveCode(name string) }
type CodeManager ¶
type CodeManager struct {
// contains filtered or unexported fields
}
func NewCodeManager ¶
func NewCodeManager(makeExec makeExecCodeFunc) *CodeManager
func (*CodeManager) GetExecCode ¶
func (c *CodeManager) GetExecCode(name string) (*ContractCode, error)
func (*CodeManager) RemoveCode ¶
func (c *CodeManager) RemoveCode(name string)
type ContractCode ¶
type InstanceCreator ¶
type InstanceCreator interface { // CreateInstance instances a wasm virtual machine instance which can run a single contract call CreateInstance(ctx *bridge.ContractState) (bridge.Instance, error) RemoveCache(name string) }
InstanceCreator is the creator of wasm virtual machine instance
func Open ¶
func Open(name string, syscallService *bridge.SyscallService, db db.Database) (InstanceCreator, error)
Open opens a wasm virtual machine specified by its driver name
type NewInstanceCreatorFunc ¶
type NewInstanceCreatorFunc func(syscallService *bridge.SyscallService, db db.Database) (InstanceCreator, error)
NewInstanceCreatorFunc instances a new InstanceCreator from InstanceCreatorConfig
type VMManager ¶
type VMManager struct {
// contains filtered or unexported fields
}
VMManager manages wasm contracts, include deploy contracts, instance wasm virtual machine, etc...
func NewVMManager ¶
New instances a new VMManager
func (*VMManager) DeployContract ¶
DeployContract deploy contract and initialize contract
func (*VMManager) InvokeContract ¶
func (*VMManager) NewCreatorInstance ¶
NewInstance implements bridge.Executor
func (*VMManager) RegisterSyscallService ¶
func (v *VMManager) RegisterSyscallService(syscall *bridge.SyscallService)
RegisterSyscallService implements bridge.Executor
Source Files ¶
Click to show internal directories.
Click to hide internal directories.