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