reth_cli_util/
lib.rs

1//! This crate defines a set of commonly used cli utils.
2
3#![doc(
4    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
5    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
6    issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
7)]
8#![cfg_attr(not(test), warn(unused_crate_dependencies))]
9#![cfg_attr(docsrs, feature(doc_cfg))]
10
11#[cfg(feature = "tracy-allocator")]
12use reth_tracing as _;
13
14pub mod allocator;
15pub mod cancellation;
16
17/// Helper function to load a secret key from a file.
18pub mod load_secret_key;
19pub use load_secret_key::{get_secret_key, parse_secret_key_from_hex};
20
21/// Cli parsers functions.
22pub mod parsers;
23pub use parsers::{
24    hash_or_num_value_parser, parse_duration_from_secs, parse_duration_from_secs_or_ms,
25    parse_ether_value, parse_socket_address,
26};
27
28#[cfg(all(unix, any(target_env = "gnu", target_os = "macos")))]
29pub mod sigsegv_handler;
30
31/// Signal handler to extract a backtrace from stack overflow.
32///
33/// This is a no-op because this platform doesn't support our signal handler's requirements.
34#[cfg(not(all(unix, any(target_env = "gnu", target_os = "macos"))))]
35pub mod sigsegv_handler {
36    /// No-op function.
37    pub fn install() {}
38}