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;
9pub mod peer_cache;
10
11pub use client::cache::ChunkCache;
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    CostEstimateConfidence, DownloadEvent, ExternalPaymentInfo, FileChunkPeerReport,
29    FileChunkPeerReportPeer, FileChunkPeerStatus, FileChunkPeerSweepReport,
30    FileDownloadWithPeerReport, FileUploadResult, PreparedUpload, UploadCostEstimate, UploadEvent,
31    Visibility,
32};
33pub use client::merkle::{
34    finalize_merkle_batch, MerkleBatchPaymentResult, PaymentMode, PreparedMerkleBatch,
35    DEFAULT_MERKLE_THRESHOLD,
36};
37
38// Re-export self-encryption types
39pub use self_encryption::DataMap;
40
41// Datamap file persistence helpers. Canonical path is
42// `ant_core::datamap_file::*`; these convenience re-exports let existing
43// `ant_core::data` callers reach them without an extra import.
44pub use crate::datamap_file::{
45    datamap_filename_for, original_name_from_datamap, read_datamap, write_datamap, CollisionPolicy,
46    DATAMAP_EXTENSION,
47};
48
49// Re-export networking types needed by CLI for P2P node creation. The
50// devnet manifest types live in ant-protocol because both the node
51// (writer) and the CLI (reader) need them; they are always available
52// regardless of the `devnet` feature.
53pub use ant_protocol::transport::{
54    CoreNodeConfig, IPDiversityConfig, MultiAddr, NodeMode, P2PNode,
55};
56pub use ant_protocol::{DevnetManifest, MAX_CHUNK_SIZE, MAX_WIRE_MESSAGE_SIZE};
57
58// Re-export EVM types needed by CLI for wallet and network setup
59pub use ant_protocol::evm::{
60    Address as EvmAddress, CustomNetwork, Network as EvmNetwork, Wallet, U256,
61};