Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
107 changes: 103 additions & 4 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 @@ -23,6 +23,7 @@ members = [
"crates/vm/levm",
"crates/vm/levm/runner",
"crates/common/config",
"tooling/repl",
"test",
]
exclude = ["crates/vm/levm/bench/revm_comparison"]
Expand Down Expand Up @@ -74,6 +75,7 @@ ethrex-guest-program = { path = "./crates/guest-program" }
ethrex-storage-rollup = { path = "./crates/l2/storage" }
ethrex = { path = "./cmd/ethrex" }
ethrex-l2-rpc = { path = "./crates/l2/networking/rpc" }
ethrex-repl = { path = "./tooling/repl" }

tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3.0", features = ["env-filter"] }
Expand Down
1 change: 1 addition & 0 deletions cmd/ethrex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ethrex-l2-common = { workspace = true, optional = true }
ethrex-l2-rpc = { workspace = true, optional = true }
ethrex-metrics = { path = "../../crates/blockchain/metrics" }
ethrex-p2p.workspace = true
ethrex-repl.workspace = true
ethrex-prover = { workspace = true, optional = true, features = ["l2"] }
ethrex-rlp.workspace = true
ethrex-rpc.workspace = true
Expand Down
21 changes: 21 additions & 0 deletions cmd/ethrex/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,20 @@ pub enum Subcommand {
)]
genesis_path: PathBuf,
},
#[command(name = "repl", about = "Interactive REPL for Ethereum JSON-RPC")]
Repl {
/// JSON-RPC endpoint URL
#[arg(short = 'e', long, default_value = "http://localhost:8545")]
endpoint: String,

/// Path to command history file
#[arg(long, default_value = "~/.ethrex/history")]
history_file: String,

/// Execute a single command and exit
#[arg(short = 'x', long)]
execute: Option<String>,
},
#[cfg(feature = "l2")]
#[command(name = "l2")]
L2(crate::l2::L2Command),
Expand Down Expand Up @@ -532,6 +546,13 @@ impl Subcommand {
let state_root = genesis.compute_state_root();
println!("{state_root:#x}");
}
Subcommand::Repl {
endpoint,
history_file,
execute,
} => {
ethrex_repl::run(endpoint, history_file, execute).await;
}
#[cfg(feature = "l2")]
Subcommand::L2(command) => command.run().await?,
}
Expand Down
Loading
Loading