9 releases (breaking)

0.7.0 Oct 29, 2024
0.6.0 Oct 11, 2024
0.5.0 Oct 3, 2024
0.4.1 Sep 24, 2024
0.1.1 Jan 15, 2024

#1 in #celestia

Download history 1482/week @ 2024-08-05 2861/week @ 2024-08-12 2364/week @ 2024-08-19 1311/week @ 2024-08-26 2623/week @ 2024-09-02 2775/week @ 2024-09-09 2635/week @ 2024-09-16 2858/week @ 2024-09-23 3546/week @ 2024-09-30 3856/week @ 2024-10-07 3500/week @ 2024-10-14 3384/week @ 2024-10-21 3092/week @ 2024-10-28 2238/week @ 2024-11-04 1832/week @ 2024-11-11 743/week @ 2024-11-18

8,040 downloads per month
Used in 2 crates

Apache-2.0

385KB
7.5K 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::{AppVersion, Blob, TxConfig, nmt::Namespace};

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(), AppVersion::V2)
        .expect("Failed to create a blob");

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

Dependencies

~13–26MB
~386K SLoC