Crate celestia_types
source ·Expand description
§Celestia types
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::{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())
.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="
}"#},
);
Re-exports§
pub use crate::blob::Blob;
pub use crate::blob::Commitment;
pub use crate::fraud_proof::FraudProof;
Modules§
- Types related to creation and submission of blobs.
- Constants used within celestia ecosystem.
- Fraud proof related types and traits.
- Celestia hash related types and traits.
- Types related to the namespaced data.
- Namespaces and Namespaced Merkle Tree.
- p2p
p2p
Types related to the p2p layer of nodes in Celestia. - Types related to rows
- Types related to samples.
- Types and interfaces for accessing Celestia’s state-relevant information.
- test_utils
test-utils
Utilities for writing tests. - Primitives for the trust level of consensus commits.
Structs§
- Header with commitments of the data availability.
- The data matrix in Celestia blocks extended with parity data.
- Block header together with the relevant Data Availability metadata.
- A single fixed-size chunk of data which is used to form an
ExtendedDataSquare
. - A state of the blockchain synchronization.
Enums§
- Represents either column or row of the
ExtendedDataSquare
. - Representation of all the errors that can occur when interacting with
celestia_types
. - Representation of the errors that can occur when validating data.
- Representation of the errors that can occur when verifying data.
Traits§
- An extension trait for the
Commit
to perform additional actions. - A trait to perform basic validation of the data consistency.
Type Aliases§
- The height of the block in Celestia network.
- Alias for a
Result
with the error typecelestia_types::Error
. - Information about a tendermint validator.
- A collection of the tendermint validators.