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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Protocol helpers for ant-node client operations.
//!
//! This module provides low-level protocol support for client-node communication.
//! For high-level client operations, use the `ant-client` crate instead.
//!
//! # Architecture
//!
//! This module contains:
//!
//! 1. **Protocol message handlers**: Send/await pattern for chunks
//! 2. **Data types**: Common types like `XorName`, `DataChunk`, address computation
//!
//! # Migration Note
//!
//! The `QuantumClient` has been deprecated and consolidated into `ant-client::Client`.
//! Use `ant-client` for all client operations.
//!
//! # Example
//!
//! ```rust,ignore
//! use ant_client::Client; // Use ant-client instead of QuantumClient
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // High-level client API
//! let client = Client::connect(&bootstrap_peers, Default::default()).await?;
//!
//! // Store data with payment
//! let address = client.chunk_put(bytes::Bytes::from("hello world")).await?;
//!
//! // Retrieve data
//! let chunk = client.chunk_get(&address).await?;
//!
//! Ok(())
//! }
//! ```
pub use send_and_await_chunk_response;
pub use ;
// Re-export hex_node_id_to_encoded_peer_id for payment operations
use crate;
use EncodedPeerId;
/// Convert a hex-encoded 32-byte node ID to an [`EncodedPeerId`].
///
/// Peer IDs are 64-character hex strings representing 32 raw bytes.
/// This function decodes the hex string and wraps the raw bytes directly
/// into an `EncodedPeerId`.
///
/// # Errors
///
/// Returns an error if the hex string is invalid or not exactly 32 bytes.