mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-06 21:15:27 -05:00
32 lines
1.0 KiB
Rust
32 lines
1.0 KiB
Rust
#![allow(missing_docs, rustdoc::missing_crate_level_docs)]
|
|
// The `optimism` feature must be enabled to use this crate.
|
|
#![cfg(feature = "optimism")]
|
|
|
|
use clap::Parser;
|
|
use reth_optimism_cli::{chainspec::OpChainSpecParser, Cli};
|
|
use reth_optimism_node::{args::RollupArgs, OpNode};
|
|
use tracing::info;
|
|
|
|
#[global_allocator]
|
|
static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();
|
|
|
|
fn main() {
|
|
reth_cli_util::sigsegv_handler::install();
|
|
|
|
// Enable backtraces unless a RUST_BACKTRACE value has already been explicitly provided.
|
|
if std::env::var_os("RUST_BACKTRACE").is_none() {
|
|
std::env::set_var("RUST_BACKTRACE", "1");
|
|
}
|
|
|
|
if let Err(err) =
|
|
Cli::<OpChainSpecParser, RollupArgs>::parse().run(|builder, rollup_args| async move {
|
|
info!(target: "reth::cli", "Launching node");
|
|
let handle = builder.launch_node(OpNode::new(rollup_args)).await?;
|
|
handle.node_exit_future.await
|
|
})
|
|
{
|
|
eprintln!("Error: {err:?}");
|
|
std::process::exit(1);
|
|
}
|
|
}
|