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::{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,
"signer": null
}"#},
);
Re-exports§
pub use crate::blob::Blob;
pub use crate::blob::Commitment;
pub use crate::block::Height;
pub use crate::consts::appconsts::AppVersion;
pub use crate::eds::AxisType;
pub use crate::eds::ExtendedDataSquare;
pub use crate::fraud_proof::FraudProof;
Modules§
- blob
- Types related to creation and submission of blobs.
- block
- Blocks within the chains of a Tendermint network
- consts
- Constants used within celestia ecosystem.
- eds
- Types related to EDS.
- fraud_
proof - Fraud proof related types and traits.
- hash
- Celestia hash related types and traits.
- nmt
- Namespaces and Namespaced Merkle Tree.
- p2p
p2p
- Types related to the p2p layer of nodes in Celestia.
- row
- Types related to rows
- row_
namespace_ data - Types related to the namespaced data.
- sample
- Types related to samples.
- serializers
- Custom serializers to be used with
serde
. - state
- Types and interfaces for accessing Celestia’s state-relevant information.
- test_
utils test-utils
- Utilities for writing tests.
- trust_
level - Primitives for the trust level of consensus commits.
Structs§
- Data
Availability Header - Header with commitments of the data availability.
- Extended
Header - Block header together with the relevant Data Availability metadata.
- Info
Byte - The part of
Share
containing theversion
andsequence_start
information. - Merkle
Proof - A proof of inclusion of some leaf in a merkle tree.
- RawShare
- RowProof
- A proof of inclusion of a range of row roots in a
DataAvailabilityHeader
. - Share
- A single fixed-size chunk of data which is used to form an
ExtendedDataSquare
. - Share
Proof - A proof of inclusion of a continouous range of shares of some namespace
in a
DataAvailabilityHeader
. - Sync
State - A state of the blockchain synchronization.
Enums§
- Error
- Representation of all the errors that can occur when interacting with
celestia_types
. - Validation
Error - Representation of the errors that can occur when validating data.
- Verification
Error - Representation of the errors that can occur when verifying data.
Traits§
- Validate
Basic - A trait to perform basic validation of the data consistency.
- Validate
Basic With AppVersion - A trait to perform basic validation of the data consistency.
Type Aliases§
- Result
- Alias for a
Result
with the error typecelestia_types::Error
. - Validator
- Information about a tendermint validator.
- Validator
Set - A collection of the tendermint validators.