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
6 changes: 3 additions & 3 deletions Cargo.lock

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

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.1.0"
version = "0.1.10"
edition = "2021"
rust-version = "1.85"
license = "MIT"
Expand All @@ -8,7 +8,11 @@ repository = "https://github.com/base/node-reth"

[workspace]
resolver = "2"
members = ["crates/flashblocks-rpc", "crates/node", "crates/transaction-tracing"]
members = [
"crates/flashblocks-rpc",
"crates/node",
"crates/transaction-tracing",
]

default-members = ["crates/node"]

Expand Down Expand Up @@ -119,4 +123,4 @@ chrono = "0.4.41"
brotli = "8.0.1"
arc-swap = "1.7.1"
once_cell = "1.19"
rand = "0.9.2"
rand = "0.9.2"
37 changes: 34 additions & 3 deletions crates/node/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use base_reth_flashblocks_rpc::rpc::EthApiExt;
use futures_util::TryStreamExt;
use once_cell::sync::OnceCell;
use reth::version::{
default_reth_version_metadata, try_init_version_metadata, RethCliVersionConsts,
};
use reth_exex::ExExEvent;
use std::sync::Arc;

Expand All @@ -9,7 +12,7 @@ use base_reth_flashblocks_rpc::state::FlashblocksState;
use base_reth_flashblocks_rpc::subscription::FlashblocksSubscriber;
use base_reth_transaction_tracing::transaction_tracing_exex;
use clap::Parser;
use reth::builder::Node;
use reth::builder::{Node, NodeHandle};
use reth::{
builder::{EngineNodeLauncher, TreeConfig},
providers::providers::BlockchainProvider,
Expand All @@ -20,6 +23,8 @@ use reth_optimism_node::OpNode;
use tracing::info;
use url::Url;

pub const NODE_RETH_CLIENT_VERSION: &str = concat!("base/v", env!("CARGO_PKG_VERSION"));

#[global_allocator]
static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();

Expand Down Expand Up @@ -54,6 +59,29 @@ impl Args {
}

fn main() {
let default_version_metadata = default_reth_version_metadata();
try_init_version_metadata(RethCliVersionConsts {
name_client: "Base Reth Node".to_string().into(),
cargo_pkg_version: format!(
"{}/{}",
default_version_metadata.cargo_pkg_version,
env!("CARGO_PKG_VERSION")
)
.into(),
p2p_client_version: format!(
"{}/{}",
default_version_metadata.p2p_client_version, NODE_RETH_CLIENT_VERSION
)
.into(),
extra_data: format!(
"{}/{}",
default_version_metadata.extra_data, NODE_RETH_CLIENT_VERSION
)
.into(),
..default_version_metadata
})
.expect("Unable to init version metadata");

Cli::<OpChainSpecParser, Args>::parse()
.run(|builder, args| async move {
info!(message = "starting custom Base node");
Expand All @@ -64,7 +92,10 @@ fn main() {

let fb_cell: Arc<OnceCell<Arc<FlashblocksState<_>>>> = Arc::new(OnceCell::new());

let handle = builder
let NodeHandle {
node: _node,
node_exit_future,
} = builder
.with_types_and_provider::<OpNode, BlockchainProvider<_>>()
.with_components(op_node.components())
.with_add_ons(op_node.add_ons())
Expand Down Expand Up @@ -147,7 +178,7 @@ fn main() {
})
.await?;

handle.wait_for_node_exit().await
node_exit_future.await
})
.unwrap();
}