reth_downloaders/
lib.rs

1//! Implements the downloader algorithms.
2//!
3//! ## Feature Flags
4//!
5//! - `test-utils`: Export utilities for testing
6//! - `file-client`: Enables the file-based clients for reading blocks and receipts from files.
7
8#![doc(
9    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
10    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
11    issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
12)]
13#![cfg_attr(not(test), warn(unused_crate_dependencies))]
14#![cfg_attr(docsrs, feature(doc_cfg))]
15
16/// The collection of algorithms for downloading block bodies.
17pub mod bodies;
18
19/// The collection of algorithms for downloading block headers.
20pub mod headers;
21
22/// Common downloader metrics.
23pub mod metrics;
24
25/// Module managing file-based data retrieval and buffering.
26///
27/// Contains [`FileClient`](file_client::FileClient) to read block data from files,
28/// efficiently buffering headers and bodies for retrieval.
29#[cfg(any(test, feature = "file-client"))]
30pub mod file_client;
31
32/// Module managing file-based data retrieval and buffering of receipts.
33///
34/// Contains [`ReceiptFileClient`](receipt_file_client::ReceiptFileClient) to read receipt data from
35/// files, efficiently buffering receipts for retrieval.
36#[cfg(any(test, feature = "file-client"))]
37pub mod receipt_file_client;
38
39/// Module with a codec for reading and encoding block bodies in files.
40///
41/// Enables decoding and encoding `Block` types within file contexts.
42#[cfg(any(test, feature = "file-client"))]
43pub mod file_codec;
44
45#[cfg(any(test, feature = "test-utils"))]
46pub mod test_utils;
47
48#[cfg(any(test, feature = "file-client"))]
49pub use file_client::{DecodedFileChunk, FileClientError};