MutAnt: Easier Mutable Private Storage on Autonomi!
Hey Autonomi community!
I’m excited to share a project I’ve been working on called MutAnt. If you’ve ever wanted a simpler way to store and manage private, changeable data using Autonomi’s storage capabilities, MutAnt might be for you!
What is MutAnt?
Think of it as a friendly layer on top of Autonomi’s Scratchpad
features. Instead of dealing directly with the lower-level details, MutAnt gives you a straightforward key-value store (like put
, get
, remove
) using easy-to-remember string keys. It’s built to be asynchronous, so it plays nicely with modern Rust development using async/await
.
Why did I build this?
My goal was to make interacting with Autonomi’s mutable storage more convenient, both for command-line use and for integrating into other Rust applications.
Key Features:
- Simple Key-Value API: Store, fetch, and delete data using
mutant put mykey "my value"
,mutant get mykey
, etc. - Human-Readable Keys: No need to juggle complex identifiers; just use strings.
- Async-First: Designed for non-blocking operations.
- Progress Updates: Get feedback during potentially long
store
andfetch
operations (especially useful in the CLI). - Handy CLI Tool: Comes with the
mutant
command for quick interactions.
Want to try it out?
Heads Up! MutAnt is still under active development. It’s not ready for mainnet or production use yet. Expect things to change, and use it carefully, especially on testnets for now.
Installation (CLI):
The easiest way is via crates.io:
cargo install mutant
Or you can build it from the source:
git clone https://github.com/Champii/MutAnt.git
cd MutAnt
cargo install --path .
Quick CLI Examples:
# Store some data
echo "My secret message" | mutant put my-secret-key
# Retrieve it
mutant get my-secret-key
# Output: My secret message
# List your keys
mutant ls
# Delete a key
mutant rm my-secret-key
(Use mutant --help
for all commands and options, like using a local testnet with -l
)
Using it in your Rust Code:
You can also add mutant_lib
to your project:
# Cargo.toml
[dependencies]
mutant_lib = "0.1.0" # Check crates.io for the latest version
tokio = { version = "1", features = ["full"] }
// Basic example
use mutant_lib::mutant::MutAnt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Needs your private key hex string
let private_key_hex = "0xYOUR_PRIVATE_KEY_HERE";
// Connect (use init_local for local dev)
let (mutant, _) = MutAnt::init(private_key_hex).await?;
mutant.store("my_app_data", b"some bytes").await?;
let data = mutant.fetch("my_app_data").await?;
println!("Fetched: {:?}", data);
mutant.remove("my_app_data").await?;
Ok(())
}
Development & Testing:
If you want to hack on MutAnt or run the tests, you’ll need a local Autonomi testnet. Check out the scripts/manage_local_testnet.sh
script in the repo – it helps set up and manage one for you. Details are in the README!
Find out More:
- GitHub Repo: https://github.com/Champii/MutAnt
I’d love to hear what you think! Feel free to try it out, check out the code, and open issues or suggestions on GitHub.
Cheers!