Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/weavevm/wvm-data-retriever

wvm:// data retrieval protocol
https://github.com/weavevm/wvm-data-retriever

arweave wvm

Last synced: 5 days ago
JSON representation

wvm:// data retrieval protocol

Awesome Lists containing this project

README

        





## About
WeaveVM Data Retriever (`wvm://`) is a protocol for retrieving data from WeaveVM network. It leverages the WeaveVM DA layer and Arweave's permanent storage to access and retrieve WeaveVM transaction data through both networks.

## Build & Run

```bash
git clone https://github.com/weaveVM/wvm-data-retriever.git

cd wvm-data-retriever

cargo shuttle run
```

## wvm:// workflow

![](./media/wvm-protocol.png)

## Server Methods

### Retrieve calldata associated with an WeaveVM TXID

```bash
curl -X GET https://gateway.wvm.dev/calldata/$WVM_TXID
```

Returns

```rs
pub struct HandlerGetCalldata {
pub calldata: String,
pub arweave_block_hash: String,
pub wvm_block_hash: String,
pub war_decoded_calldata: Option, // default to Some("")
pub wvm_data_da: bool,
pub ar_data_archive: bool,
pub da_archive_is_equal_data: bool,
}
```

### Retrieve WeaveVM-Archiver JSON decoded calldata

```bash
curl -X GET https://gateway.wvm.dev/war-calldata/$WVM_TXID
```
Returns

```rs
pub struct HandlerGetCalldata {
pub calldata: String,
pub arweave_block_hash: String,
pub wvm_block_hash: String,
pub war_decoded_calldata: Option, // the decoded JSON representation of `calldata`
pub wvm_data_da: bool,
pub ar_data_archive: bool,
pub da_archive_is_equal_data: bool,
}
```

## Usage as crate

Add `wvm-data-retriever` to your `Cargo.toml`

```Cargo.toml
[dependencies]
wvm-data-retriever = { git = "https://github.com/weaveVM/wvm-data-retriever" }
```

And in your codebase:

```rust
use wvm_data_retriever::utils::getters::{get_calldata, get_war_calldata};
```

## Benchmarks

### Latency for /calldata

The latency includes the time spent fetching data from WeaveVM RPC and the Arweave gateway, as well as the processing time for Brotli decompression, Borsh deserialization, and data validity verification.

![](./media/256kb.png)

## License
This project is licensed under the [MIT License](./LICENSE)