Crates.io | celestia-types |
lib.rs | celestia-types |
version | |
source | src |
created_at | 2024-01-12 16:10:21.15087 |
updated_at | 2024-12-02 12:13:28.624503 |
description | Core types, traits and constants for working with the Celestia ecosystem |
homepage | https://www.eiger.co |
repository | https://github.com/eigerco/lumina |
max_upload_size | |
id | 1097841 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Core types, traits and constants you may encounter when working with the Celestia ecosystem.
Most of the types are built on top of the celestia-tendermint-rs
and celestia-proto
and support the serialization and deserialization using
protobuf and serde to the format understood by nodes in celestia network.
use celestia_types::{AppVersion, Blob, nmt::Namespace};
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");
assert_eq!(
&serde_json::to_string_pretty(&blob).unwrap(),
indoc::indoc! {r#"{
"namespace": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQIDBAU=",
"data": "c29tZSBkYXRhIHRvIHN0b3JlIG9uIGJsb2NrY2hhaW4=",
"share_version": 0,
"commitment": "m0A4feU6Fqd5Zy9td3M7lntG8A3PKqe6YdugmAsWz28=",
"index": -1
}"#},
);