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