Skip to main content

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#[cfg(feature = "tracy-allocator")]
14use tracy_client as _;
15
16pub mod allocator;
17pub mod cancellation;
18
19/// Helper function to load a secret key from a file.
20pub mod load_secret_key;
21pub use load_secret_key::{get_secret_key, parse_secret_key_from_hex};
22
23/// Cli parsers functions.
24pub mod parsers;
25pub use parsers::{
26    hash_or_num_value_parser, parse_duration_from_secs, parse_duration_from_secs_or_ms,
27    parse_ether_value, parse_socket_address,
28};
29
30#[cfg(all(unix, any(target_env = "gnu", target_os = "macos")))]
31pub mod sigsegv_handler;
32
33/// Signal handler to extract a backtrace from stack overflow.
34///
35/// This is a no-op because this platform doesn't support our signal handler's requirements.
36#[cfg(not(all(unix, any(target_env = "gnu", target_os = "macos"))))]
37pub mod sigsegv_handler {
38    /// No-op function.
39    pub fn install() {}
40}