# Storage Indexing

[WasmVM](https://github.com/CosmWasm/wasmvm/blob/main/internal/api/callbacks.go#L95-L100)

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.&#x20;

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.

{% @mermaid/diagram content="---
title: CosmWasm
---------------

flowchart LR
id1(LandslideCoreVM) --> id14("CosmWasm
Go Module") --> id15("WasmVM
Go Module")  --> id16("libWasmVM
Rust compiled as
C library")--> id17("CosmWasmVM
Rust using Wasmer
for WASM")
\--> id18("WASM smart
contract")
style id1 fill:#f9f,stroke:#333,stroke-width:4px" %}

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.&#x20;

This chain of calls demonstrates how DB methods are utilized by Wasm smart contracts in the Cosmos ecosystem.

{% @mermaid/diagram content="---
title: DB Method
----------------

flowchart RL
id1("Wasm
smart contract") -- "calls storage.set()" --> id14("STD Library") -- "calls db.write()" --> id15("CosmWasm VM
method do\_db\_write")-- "calls store.set()" --> id16("libWasmVM
Rust compiled as
C library") -- "calls storage.set()" --> id3\[(database)]
" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.landslide.network/product-guides/slide-sdk/wasmvm/storage-indexing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
