11 releases (7 breaking)

0.8.0 Dec 2, 2024
0.7.0 Oct 29, 2024
0.2.0 Apr 19, 2024
0.1.1 Jan 15, 2024

#813 in Magic Beans

Download history 2144/week @ 2024-08-20 1482/week @ 2024-08-27 2785/week @ 2024-09-03 2823/week @ 2024-09-10 2428/week @ 2024-09-17 3184/week @ 2024-09-24 3612/week @ 2024-10-01 3575/week @ 2024-10-08 3800/week @ 2024-10-15 3213/week @ 2024-10-22 2955/week @ 2024-10-29 2045/week @ 2024-11-05 1822/week @ 2024-11-12 647/week @ 2024-11-19 638/week @ 2024-11-26 888/week @ 2024-12-03

4,208 downloads per month
Used in 3 crates

Apache-2.0

425KB
8K 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:36658", 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

~16–30MB
~465K SLoC