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#[cfg(feature = "native")]
10pub mod peer_cache;
11
12pub use client::cache::ChunkCache;
13pub use client::{Client, ClientConfig};
14pub use error::{Error, Result};
15pub use network::{Network, NetworkHealth, REBOOTSTRAP_THRESHOLD};
16
17// LocalDevnet (and the optional node-side dep it pulls in) is gated behind
18// the `devnet` feature. Default builds of ant-core do not link ant-node.
19#[cfg(feature = "devnet")]
20pub use crate::node::devnet::LocalDevnet;
21
22// Re-export commonly used types from the wire protocol crate.
23pub use ant_protocol::{compute_address, DataChunk, XorName};
24
25// Re-export client data types
26pub use client::batch::{
27    finalize_batch_payment, PaidChunk, PaymentIntent, PreparedChunk, SingleNodeQuotePayment,
28};
29pub use client::data::DataUploadResult;
30#[cfg(feature = "native")]
31pub use client::diagnostics::{
32    spawn_download_diagnostics_writer, DownloadDiagnosticsOutcome, DownloadDiagnosticsRecord,
33    DownloadDiagnosticsSender,
34};
35pub use client::file::{
36    CostEstimateConfidence, DownloadEvent, FileChunkPeerReport, FileChunkPeerReportPeer,
37    FileChunkPeerStatus, FileChunkPeerSweepReport, FileDownloadWithPeerReport, FileUploadResult,
38    UploadCostEstimate, UploadEvent, Visibility,
39};
40#[cfg(feature = "native")]
41pub use client::file::{
42    ExternalChunkStore, ExternalPaymentInfo, FinalizeOutcome, FinalizeResume, MerkleFinalizeResume,
43    PreparedUpload, WaveFinalizeResume,
44};
45pub use client::merkle::{
46    finalize_merkle_batch, MerkleBatchPaymentResult, PaymentMode, PreparedMerkleBatch,
47    DEFAULT_MERKLE_THRESHOLD,
48};
49
50// Re-export self-encryption types
51pub use self_encryption::DataMap;
52
53// Datamap file persistence helpers. Canonical path is
54// `ant_core::datamap_file::*`; these convenience re-exports let existing
55// `ant_core::data` callers reach them without an extra import.
56#[cfg(feature = "native")]
57pub use crate::datamap_file::{
58    datamap_filename_for, original_name_from_datamap, read_datamap, write_datamap, CollisionPolicy,
59    DATAMAP_EXTENSION,
60};
61
62// Re-export networking types needed by CLI for P2P node creation. The
63// devnet manifest types live in ant-protocol because both the node
64// (writer) and the CLI (reader) need them; they are always available
65// regardless of the `devnet` feature.
66#[cfg(feature = "native")]
67pub use ant_protocol::transport::{
68    CoreNodeConfig, IPDiversityConfig, MultiAddr, NodeMode, P2PNode,
69};
70pub use ant_protocol::{DevnetManifest, MAX_CHUNK_SIZE, MAX_WIRE_MESSAGE_SIZE};
71
72// Re-export EVM types needed by CLI for wallet and network setup
73pub use ant_protocol::evm::{
74    Address as EvmAddress, CustomNetwork, Network as EvmNetwork, Wallet, U256,
75};