Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/weavevm/wvm-data-retriever
- Owner: weaveVM
- License: mit
- Created: 2024-09-02T23:50:47.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-03T14:23:25.000Z (11 days ago)
- Last Synced: 2024-11-03T15:18:26.435Z (10 days ago)
- Topics: arweave, wvm
- Language: Rust
- Homepage: https://docs.wvm.dev
- Size: 7.09 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.gitcd 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)