Skip to content

Commit

Permalink
Remove references to txpool example
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoopmann committed Sep 27, 2023
1 parent 6a6c91a commit 6805c59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/cli_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ use crate::ValidationApi;
pub struct ValidationCliExt;

impl RethCliExt for ValidationCliExt {
/// This tells the reth CLI to install the `txpool` rpc namespace via `RethCliValidationApi`
/// This tells the reth CLI to install the `validation` rpc namespace via `RethCliValidationApi`
type Node = RethCliValidationApi;
}

/// Our custom cli args extension that adds one flag to reth default CLI.
#[derive(Debug, Clone, Copy, Default, clap::Args)]
pub struct RethCliValidationApi {
/// CLI flag to enable the txpool extension namespace
/// CLI flag to enable the validation extension namespace
#[clap(long)]
pub enable_ext: bool,
}
Expand Down Expand Up @@ -67,7 +67,7 @@ impl RethNodeCommandConfig for RethCliValidationApi {
// now we merge our extension namespace into all configured transports
modules.merge_configured(ext.into_rpc())?;

println!("txpool extension enabled");
println!("validation extension enabled");
Ok(())
}
}
11 changes: 6 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
//! Example of how to use additional rpc namespaces in the reth CLI
//! Reth RPC extension to add endpoint for builder payload validation
//!
//! Run with
//!
//! ```not_rust
//! cargo run -p additional-rpc-namespace-in-cli -- node --http --ws --enable-ext
//! RUST_LOG=info cargo run -- node --full --metrics 127.0.0.1:9001 --http --enable-ext
//! ```
//!
//! This installs an additional RPC method `txpoolExt_transactionCount` that can queried via [cast](https://github.com/foundry-rs/foundry)
//! This installs an additional RPC method that can be queried using the provided sample rpc
//! payload
//!
//! ```sh
//! cast rpc txpoolExt_transactionCount
//! curl --location 'localhost:8545/' --header 'Content-Type: application/json' --data @test/data/rpc_payload.json
//! ```
use clap::Parser;
use reth::cli::Cli;
Expand All @@ -25,7 +26,7 @@ fn main() {
Cli::<ValidationCliExt>::parse().run().unwrap();
}

/// The type that implements the `txpool` rpc namespace trait
/// The type that implements the `validation` rpc namespace trait
pub struct ValidationApi<Provider> {
inner: Arc<ValidationApiInner<Provider>>,
}

0 comments on commit 6805c59

Please sign in to comment.