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