#celestia #blockchain #lumina #api-bindings

celestia-rpc

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

14 releases (9 breaking)

0.10.0 Apr 2, 2025
0.9.1 Feb 24, 2025
0.9.0 Jan 29, 2025
0.8.0 Dec 2, 2024
0.1.1 Jan 15, 2024

#4 in #celestia

Download history 317/week @ 2024-12-23 424/week @ 2024-12-30 472/week @ 2025-01-06 516/week @ 2025-01-13 338/week @ 2025-01-20 242/week @ 2025-01-27 230/week @ 2025-02-03 244/week @ 2025-02-10 229/week @ 2025-02-17 408/week @ 2025-02-24 411/week @ 2025-03-03 649/week @ 2025-03-10 437/week @ 2025-03-17 376/week @ 2025-03-24 609/week @ 2025-03-31 614/week @ 2025-04-07

2,067 downloads per month
Used in 3 crates

Apache-2.0

480KB
9K 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, TxConfig};
use celestia_types::{AppVersion, Blob, 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

~17–31MB
~502K SLoC