3 unstable releases

0.2.0 Apr 19, 2024
0.1.1 Jan 15, 2024
0.1.0 Jan 12, 2024

#1781 in Magic Beans

Download history 312/week @ 2024-02-08 387/week @ 2024-02-15 329/week @ 2024-02-22 336/week @ 2024-02-29 467/week @ 2024-03-07 592/week @ 2024-03-14 624/week @ 2024-03-21 1091/week @ 2024-03-28 1324/week @ 2024-04-04 1595/week @ 2024-04-11 584/week @ 2024-04-18 607/week @ 2024-04-25 324/week @ 2024-05-02 188/week @ 2024-05-09 349/week @ 2024-05-16 447/week @ 2024-05-23

1,402 downloads per month
Used in 2 crates

Apache-2.0

305KB
6K SLoC

Celestia RPC

A collection of traits for interacting with Celestia data availability nodes RPC.

This crate builds on top of the jsonrpsee clients.

use celestia_rpc::{BlobClient, Client};
use celestia_types::{Blob, nmt::Namespace};
use celestia_types::blob::GasPrice;

async fn submit_blob() {
    // create a client to the celestia node
    let token = std::env::var("CELESTIA_NODE_AUTH_TOKEN").expect("Token not provided");
    let client = Client::new("ws://localhost:26658", Some(&token))
        .await
        .expect("Failed creating rpc client");

    // create a blob that you want to submit
    let my_namespace = Namespace::new_v0(&[1, 2, 3, 4, 5]).expect("Invalid namespace");
    let blob = Blob::new(my_namespace, b"some data to store on blockchain".to_vec())
        .expect("Failed to create a blob");

    // submit it
    client.blob_submit(&[blob], GasPrice::default())
        .await
        .expect("Failed submitting the blob");
}

Dependencies

~13–27MB
~400K SLoC