1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Storage subsystem for chunk persistence.
//!
//! This module provides content-addressed LMDB storage for chunks,
//! along with a protocol handler that integrates with saorsa-core's
//! `Protocol` trait for automatic message routing.
//!
//! # Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────┐
//! │ AntProtocol (implements Protocol trait) │
//! ├─────────────────────────────────────────────────────────┤
//! │ protocol_id() = "autonomi.ant.chunk.v1" │
//! │ │
//! │ handle(peer_id, data) ──▶ decode AntProtocolMessage │
//! │ │ │
//! │ ┌─────────────────────────┼─────────────────┐ │
//! │ ▼ ▼ ▼ │
//! │ QuoteRequest ChunkPutRequest ChunkGetRequest
//! │ │ │ │ │
//! │ ▼ ▼ ▼ │
//! │ QuoteGenerator PaymentVerifier LmdbStorage│
//! │ │ │ │ │
//! │ └─────────────────────────┴─────────────────┘ │
//! │ │ │
//! │ return Ok(Some(response_bytes)) │
//! └─────────────────────────────────────────────────────────┘
//! ```
//!
//! # Example
//!
//! ```rust,ignore
//! use std::sync::Arc;
//! use ant_node::storage::{AntProtocol, LmdbStorage, LmdbStorageConfig};
//!
//! // Create storage
//! let config = LmdbStorageConfig::default();
//! let storage = Arc::new(LmdbStorage::new(config).await?);
//!
//! // Create protocol handler
//! let protocol = AntProtocol::new(storage, Arc::new(payment_verifier), Arc::new(quote_generator));
//!
//! // Register with saorsa-core
//! listener.register_protocol(protocol).await?;
//! ```
pub
pub use crateXorName;
pub use AntProtocol;
pub use ;