Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial cli abstraction #9082

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"crates/blockchain-tree/",
"crates/blockchain-tree-api/",
"crates/chainspec/",
"crates/cli/cli/",
"crates/cli/commands/",
"crates/cli/runner/",
"crates/config/",
Expand Down Expand Up @@ -258,6 +259,7 @@ reth-beacon-consensus = { path = "crates/consensus/beacon" }
reth-blockchain-tree = { path = "crates/blockchain-tree" }
reth-blockchain-tree-api = { path = "crates/blockchain-tree-api" }
reth-chainspec = { path = "crates/chainspec" }
reth-cli = { path = "crates/cli/cli" }
reth-cli-commands = { path = "crates/cli/commands" }
reth-cli-runner = { path = "crates/cli/runner" }
reth-codecs = { path = "crates/storage/codecs" }
Expand Down
10 changes: 10 additions & 0 deletions crates/cli/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "reth-cli"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
25 changes: 25 additions & 0 deletions crates/cli/cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//! Cli abstraction for reth based nodes.

#![doc(
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

use std::borrow::Cow;

/// Reth based node cli.
///
/// This trait is supposed to be implemented by the main struct of the CLI.
///
/// It provides commonly used functionality for running commands and information about the CL, such
/// as the name and version.
pub trait RethCli: Sized {
/// The name of the implementation, eg. `reth`, `op-reth`, etc.
fn name(&self) -> Cow<'static, str>;

/// The version of the node, such as `reth/v1.0.0`
fn version(&self) -> Cow<'static, str>;
}
Loading