Skip to main content

ant_core/data/
mod.rs

1//! Data operations for the Autonomi decentralized network.
2//!
3//! Provides high-level APIs for storing and retrieving data
4//! using post-quantum cryptography.
5
6pub mod client;
7pub mod error;
8pub mod network;
9
10pub use client::cache::ChunkCache;
11pub use client::chunk::PeerPool;
12pub use client::{Client, ClientConfig};
13pub use error::{Error, Result};
14pub use network::Network;
15
16// LocalDevnet (and the optional node-side dep it pulls in) is gated behind
17// the `devnet` feature. Default builds of ant-core do not link ant-node.
18#[cfg(feature = "devnet")]
19pub use crate::node::devnet::LocalDevnet;
20
21// Re-export commonly used types from the wire protocol crate.
22pub use ant_protocol::{compute_address, DataChunk, XorName};
23
24// Re-export client data types
25pub use client::batch::{finalize_batch_payment, PaidChunk, PaymentIntent, PreparedChunk};
26pub use client::data::DataUploadResult;
27pub use client::file::{
28    DownloadEvent, ExternalPaymentInfo, FileUploadResult, PreparedUpload, UploadCostEstimate,
29    UploadEvent, Visibility,
30};
31pub use client::merkle::{
32    finalize_merkle_batch, MerkleBatchPaymentResult, PaymentMode, PreparedMerkleBatch,
33    DEFAULT_MERKLE_THRESHOLD,
34};
35
36// Re-export self-encryption types
37pub use self_encryption::DataMap;
38
39// Datamap file persistence helpers. Canonical path is
40// `ant_core::datamap_file::*`; these convenience re-exports let existing
41// `ant_core::data` callers reach them without an extra import.
42pub use crate::datamap_file::{
43    datamap_filename_for, original_name_from_datamap, read_datamap, write_datamap, CollisionPolicy,
44    DATAMAP_EXTENSION,
45};
46
47// Re-export networking types needed by CLI for P2P node creation. The
48// devnet manifest types live in ant-protocol because both the node
49// (writer) and the CLI (reader) need them; they are always available
50// regardless of the `devnet` feature.
51pub use ant_protocol::transport::{
52    CoreNodeConfig, IPDiversityConfig, MultiAddr, NodeMode, P2PNode,
53};
54pub use ant_protocol::{DevnetManifest, MAX_CHUNK_SIZE, MAX_WIRE_MESSAGE_SIZE};
55
56// Re-export EVM types needed by CLI for wallet and network setup
57pub use ant_protocol::evm::{
58    Address as EvmAddress, CustomNetwork, Network as EvmNetwork, Wallet, U256,
59};