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
//! 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
//!
//! As of 0.11, the shared protocol types and helpers live in the
//! [`ant_protocol`] crate. This module re-exports them so existing
//! callers of `ant_node::client::*` continue to compile; new code
//! should prefer `ant_protocol::*` directly.
//!
//! # Example
//!
//! ```rust,ignore
//! use ant_client::Client;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = Client::connect(&bootstrap_peers, Default::default()).await?;
//! let address = client.chunk_put(bytes::Bytes::from("hello world")).await?;
//! let chunk = client.chunk_get(&address).await?;
//! Ok(())
//! }
//! ```
pub use send_and_await_chunk_response;
pub use ;
pub use XorName;
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.