Documentation ¶
Index ¶
- func LibwasmvmVersion() (string, error)
- type Checksum
- type GasMeter
- type GoAPI
- type KVStore
- type Querier
- type VM
- func (vm *VM) AnalyzeCode(checksum Checksum) (*types.AnalysisReport, error)
- func (vm *VM) Cleanup()
- func (vm *VM) Create(code WasmCode) (Checksum, error)deprecated
- func (vm *VM) Execute(checksum Checksum, env types.Env, info types.MessageInfo, executeMsg []byte, ...) (*types.Response, uint64, error)
- func (vm *VM) GetCode(checksum Checksum) (WasmCode, error)
- func (vm *VM) GetMetrics() (*types.Metrics, error)
- func (vm *VM) IBCChannelClose(checksum Checksum, env types.Env, msg types.IBCChannelCloseMsg, store KVStore, ...) (*types.IBCBasicResponse, uint64, error)
- func (vm *VM) IBCChannelConnect(checksum Checksum, env types.Env, msg types.IBCChannelConnectMsg, ...) (*types.IBCBasicResponse, uint64, error)
- func (vm *VM) IBCChannelOpen(checksum Checksum, env types.Env, msg types.IBCChannelOpenMsg, store KVStore, ...) (*types.IBC3ChannelOpenResponse, uint64, error)
- func (vm *VM) IBCPacketAck(checksum Checksum, env types.Env, msg types.IBCPacketAckMsg, store KVStore, ...) (*types.IBCBasicResponse, uint64, error)
- func (vm *VM) IBCPacketReceive(checksum Checksum, env types.Env, msg types.IBCPacketReceiveMsg, store KVStore, ...) (*types.IBCReceiveResult, uint64, error)
- func (vm *VM) IBCPacketTimeout(checksum Checksum, env types.Env, msg types.IBCPacketTimeoutMsg, store KVStore, ...) (*types.IBCBasicResponse, uint64, error)
- func (vm *VM) Instantiate(checksum Checksum, env types.Env, info types.MessageInfo, initMsg []byte, ...) (*types.Response, uint64, error)
- func (vm *VM) Migrate(checksum Checksum, env types.Env, migrateMsg []byte, store KVStore, ...) (*types.Response, uint64, error)
- func (vm *VM) Pin(checksum Checksum) error
- func (vm *VM) Query(checksum Checksum, env types.Env, queryMsg []byte, store KVStore, goapi GoAPI, ...) ([]byte, uint64, error)
- func (vm *VM) RemoveCode(checksum Checksum) error
- func (vm *VM) Reply(checksum Checksum, env types.Env, reply types.Reply, store KVStore, ...) (*types.Response, uint64, error)
- func (vm *VM) StoreCode(code WasmCode) (Checksum, error)
- func (vm *VM) Sudo(checksum Checksum, env types.Env, sudoMsg []byte, store KVStore, goapi GoAPI, ...) (*types.Response, uint64, error)
- func (vm *VM) Unpin(checksum Checksum) error
- type WasmCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LibwasmvmVersion ¶
LibwasmvmVersion returns the version of the loaded library at runtime. This can be used for debugging to verify the loaded version matches the expected version.
When cgo is disabled at build time, this returns an error at runtime.
Types ¶
type Checksum ¶
type Checksum []byte
Checksum represents a hash of the Wasm bytecode that serves as an ID. Must be generated from this library.
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
func NewVM ¶
func NewVM(dataDir string, supportedCapabilities string, memoryLimit uint32, printDebug bool, cacheSize uint32) (*VM, error)
`dataDir` is a base directory for Wasm blobs and various caches. `supportedCapabilities` is a comma separated list of capabilities suppored by the chain. `memoryLimit` is the memory limit of each contract execution (in MiB) `printDebug` is a flag to enable/disable printing debug logs from the contract to STDOUT. This should be false in production environments. `cacheSize` sets the size in MiB of an in-memory cache for e.g. module caching. Set to 0 to disable. `deserCost` sets the gas cost of deserializing one byte of data.
func (*VM) AnalyzeCode ¶
func (vm *VM) AnalyzeCode(checksum Checksum) (*types.AnalysisReport, error)
func (*VM) Cleanup ¶
func (vm *VM) Cleanup()
Cleanup should be called when no longer using this to free resources on the rust-side
func (*VM) GetMetrics ¶
GetMetrics some internal metrics for monitoring purposes.
func (*VM) IBCChannelClose ¶
func (vm *VM) IBCChannelClose( checksum Checksum, env types.Env, msg types.IBCChannelCloseMsg, store KVStore, goapi GoAPI, querier Querier, gasMeter GasMeter, gasLimit uint64, deserCost types.UFraction, ) (*types.IBCBasicResponse, uint64, error)
IBCChannelClose is available on IBC-enabled contracts and is a hook to call into at the end of the channel lifetime
func (*VM) IBCChannelConnect ¶
func (vm *VM) IBCChannelConnect( checksum Checksum, env types.Env, msg types.IBCChannelConnectMsg, store KVStore, goapi GoAPI, querier Querier, gasMeter GasMeter, gasLimit uint64, deserCost types.UFraction, ) (*types.IBCBasicResponse, uint64, error)
IBCChannelConnect is available on IBC-enabled contracts and is a hook to call into during the handshake pahse
func (*VM) IBCChannelOpen ¶
func (vm *VM) IBCChannelOpen( checksum Checksum, env types.Env, msg types.IBCChannelOpenMsg, store KVStore, goapi GoAPI, querier Querier, gasMeter GasMeter, gasLimit uint64, deserCost types.UFraction, ) (*types.IBC3ChannelOpenResponse, uint64, error)
IBCChannelOpen is available on IBC-enabled contracts and is a hook to call into during the handshake pahse
func (*VM) IBCPacketAck ¶
func (vm *VM) IBCPacketAck( checksum Checksum, env types.Env, msg types.IBCPacketAckMsg, store KVStore, goapi GoAPI, querier Querier, gasMeter GasMeter, gasLimit uint64, deserCost types.UFraction, ) (*types.IBCBasicResponse, uint64, error)
IBCPacketAck is available on IBC-enabled contracts and is called when an the response for an outgoing packet (previously sent by this contract) is received
func (*VM) IBCPacketReceive ¶
func (vm *VM) IBCPacketReceive( checksum Checksum, env types.Env, msg types.IBCPacketReceiveMsg, store KVStore, goapi GoAPI, querier Querier, gasMeter GasMeter, gasLimit uint64, deserCost types.UFraction, ) (*types.IBCReceiveResult, uint64, error)
IBCPacketReceive is available on IBC-enabled contracts and is called when an incoming packet is received on a channel belonging to this contract
func (*VM) IBCPacketTimeout ¶
func (vm *VM) IBCPacketTimeout( checksum Checksum, env types.Env, msg types.IBCPacketTimeoutMsg, store KVStore, goapi GoAPI, querier Querier, gasMeter GasMeter, gasLimit uint64, deserCost types.UFraction, ) (*types.IBCBasicResponse, uint64, error)
IBCPacketTimeout is available on IBC-enabled contracts and is called when an outgoing packet (previously sent by this contract) will provably never be executed. Usually handled like ack returning an error
func (*VM) Instantiate ¶
func (*VM) RemoveCode ¶
func (*VM) Reply ¶
func (vm *VM) Reply( checksum Checksum, env types.Env, reply types.Reply, store KVStore, goapi GoAPI, querier Querier, gasMeter GasMeter, gasLimit uint64, deserCost types.UFraction, ) (*types.Response, uint64, error)
Reply allows the native Go wasm modules to make a priviledged call to return the result of executing a SubMsg.
These work much like Sudo (same scenario) but focuses on one specific case (and one message type)