Skip to content
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
9 changes: 8 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ codegen-units = 1

[workspace.dependencies]
# internal
base-reth-cli = { path = "crates/cli" }
base-reth-metering = { path = "crates/metering" }
base-reth-test-utils = { path = "crates/test-utils" }
base-reth-flashblocks-rpc = { path = "crates/flashblocks-rpc" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ workspace = true

[dependencies]
# internal
base-reth-cli.workspace = true
base-reth-runner.workspace = true

# reth
reth.workspace = true
reth-optimism-node.workspace = true
reth-optimism-cli.workspace = true
reth-cli-util.workspace = true
Expand Down
3 changes: 1 addition & 2 deletions bin/node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

pub mod cli;
pub mod version;

use base_reth_runner::BaseNodeLauncher;

Expand All @@ -13,7 +12,7 @@ static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::ne

fn main() {
// Step 1: Initialize versioning so logs / telemetry report the right build info.
version::Version::init();
base_reth_cli::Version::init();

// Step 2: Parse CLI arguments and hand execution to the Optimism node runner.
use clap::Parser;
Expand Down
15 changes: 15 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "base-reth-cli"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
description = "CLI Utilities"

[lints]
workspace = true

[dependencies]
reth.workspace = true
3 changes: 3 additions & 0 deletions crates/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CLI Utilities for Base Reth

Contains a set of utilities for the Base Reth node CLI.
7 changes: 7 additions & 0 deletions crates/cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![doc = include_str!("../README.md")]
#![doc(issue_tracker_base_url = "https://github.com/base/node-reth/issues/")]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

mod version;
pub use version::Version;
14 changes: 8 additions & 6 deletions bin/node/src/version.rs → crates/cli/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ use reth::version::{
RethCliVersionConsts, default_reth_version_metadata, try_init_version_metadata,
};

/// The client version string for the Base Reth node.
pub const NODE_RETH_CLIENT_VERSION: &str = concat!("base/v", env!("CARGO_PKG_VERSION"));

/// Encapsulates versioning.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub struct Version;

impl Version {
/// The client version string for the Base Reth node.
pub const NODE_RETH_CLIENT_VERSION: &str = concat!("base/v", env!("CARGO_PKG_VERSION"));

/// Initializes the versioning for the Base Reth node.
///
/// ### Panics
Expand All @@ -29,12 +29,14 @@ impl Version {
.into(),
p2p_client_version: format!(
"{}/{}",
default_version_metadata.p2p_client_version, NODE_RETH_CLIENT_VERSION
default_version_metadata.p2p_client_version,
Self::NODE_RETH_CLIENT_VERSION
)
.into(),
extra_data: format!(
"{}/{}",
default_version_metadata.extra_data, NODE_RETH_CLIENT_VERSION
default_version_metadata.extra_data,
Self::NODE_RETH_CLIENT_VERSION
)
.into(),
..default_version_metadata
Expand Down