Storage Indexing
Allows dApps to support all DB methods from WasmVM
Last updated
Allows dApps to support all DB methods from WasmVM
Last updated
The below chart illustrates the flow of data and dependencies between the LandslideCoreVM and CosmWasm, a Go module for executing WebAssembly (WASM) smart contracts on the CosmosSDK. The chart shows that the LandslideCoreVM is built on top of the CosmWasm module, which in turn depends on the WasmVM Go module for executing the smart contracts. The WasmVM module relies on the libWasmVM Rust library, which is compiled as a C library, and is ultimately used by the CosmWasmVM Rust library for executing WASM smart contracts.
With these components in place, the LandslideCoreVM can support all DB methods from WasmVM, providing an efficient and flexible platform for executing smart contracts on the Avalanche network.
The below chart illustrates how a Wasm smart contract can make use of DB methods. When a Wasm smart contract calls the storage.set() method, it triggers a call to the db.write() method in the STD library. From there, the CosmWasm VM method do_db_write is called, which in turn calls the store.set() method in libWasmVM Rust compiled as C library. Finally, this results in a call to the database, represented by the database node in the chart.
This chain of calls demonstrates how DB methods are utilized by Wasm smart contracts in the Cosmos ecosystem.