reth_ethereum_cli/
lib.rs

1//! Reth CLI implementation.
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/// A configurable App on top of the cli parser.
12pub mod app;
13/// Chain specification parser.
14pub mod chainspec;
15pub mod interface;
16
17pub use app::CliApp;
18pub use interface::{Cli, Commands};
19
20#[cfg(test)]
21mod test {
22    use crate::chainspec::EthereumChainSpecParser;
23    use clap::Parser;
24    use reth_chainspec::DEV;
25    use reth_cli_commands::NodeCommand;
26
27    #[test]
28    #[ignore = "reth cmd will print op-reth output if optimism feature enabled"]
29    fn parse_dev() {
30        let cmd: NodeCommand<EthereumChainSpecParser> = NodeCommand::parse_from(["reth", "--dev"]);
31        let chain = DEV.clone();
32        assert_eq!(cmd.chain.chain, chain.chain);
33        assert_eq!(cmd.chain.genesis_hash(), chain.genesis_hash());
34        assert_eq!(
35            cmd.chain.paris_block_and_final_difficulty,
36            chain.paris_block_and_final_difficulty
37        );
38        assert_eq!(cmd.chain.hardforks, chain.hardforks);
39
40        assert!(cmd.rpc.http);
41        assert!(cmd.network.discovery.disable_discovery);
42
43        assert!(cmd.dev.dev);
44    }
45}