13 releases (8 breaking)

0.9.1 Feb 24, 2025
0.8.0 Dec 2, 2024
0.6.0 Oct 29, 2024
0.2.0 Apr 19, 2024
0.1.1 Jan 15, 2024

#5 in #celestia

Download history 4/week @ 2024-11-13 6/week @ 2024-11-20 218/week @ 2024-11-27 97/week @ 2024-12-04 24/week @ 2024-12-11 2/week @ 2024-12-18 1/week @ 2025-01-08 9/week @ 2025-01-22 153/week @ 2025-01-29 69/week @ 2025-02-05 25/week @ 2025-02-12 147/week @ 2025-02-19 80/week @ 2025-02-26

332 downloads per month
Used in 3 crates

Apache-2.0

1MB
21K SLoC

Lumina node

A crate to configure, run and interact with Celestia's data availability nodes.

use std::sync::Arc;

use lumina_node::blockstore::RedbBlockstore;
use lumina_node::network::Network;
use lumina_node::node::Node;
use lumina_node::store::RedbStore;
use redb::Database;
use tokio::task::spawn_blocking;

#[tokio::main]
async fn main() {
    let db = spawn_blocking(|| Database::create("lumina.redb"))
        .await
        .expect("Failed to join")
        .expect("Failed to open the database");
    let db = Arc::new(db);

    let store = RedbStore::new(db.clone())
        .await
        .expect("Failed to create a store");
    let blockstore = RedbBlockstore::new(db);

    let node = Node::builder()
        .store(store)
        .blockstore(blockstore)
        .network(Network::Mainnet)
        .listen(["/ip4/0.0.0.0/tcp/0".parse().unwrap()])
        .start()
        .await
        .expect("Failed to build and start node");

    node.wait_connected().await.expect("Failed to connect");

    let header = node
        .request_header_by_height(15)
        .await
        .expect("Height not found");

    println!("{}", serde_json::to_string_pretty(&header).unwrap());
}

Dependencies

~28–67MB
~1M SLoC