mirror of
https://github.com/logos-blockchain/logos-blockchain-pocs.git
synced 2026-05-04 08:33:07 +00:00
Custom binary wrapping reth works
This commit is contained in:
parent
9cfc93b574
commit
8ee6c1c12d
@ -1,5 +1,5 @@
|
||||
[workspace]
|
||||
members = ["node"]
|
||||
members = ["evm/evm-node"]
|
||||
resolver = "3"
|
||||
|
||||
[workspace.package]
|
||||
@ -7,7 +7,12 @@ edition = "2024"
|
||||
|
||||
[workspace.dependencies]
|
||||
# Internal
|
||||
node = { path = "node" }
|
||||
evm-node = { path = "evm/evm-node" }
|
||||
|
||||
# External
|
||||
tokio = { version = "1.0" }
|
||||
clap = { version = "4.5" }
|
||||
futures-util = { version = "0.3" }
|
||||
jsonrpsee = { version = "0.24" }
|
||||
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.8" }
|
||||
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.8" }
|
||||
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.8" }
|
||||
|
||||
11
sz-poc-offsite-2025/evm/evm-node/Cargo.toml
Normal file
11
sz-poc-offsite-2025/evm/evm-node/Cargo.toml
Normal file
@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "evm-node"
|
||||
edition = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
clap = { workspace = true }
|
||||
futures-util = { workspace = true }
|
||||
jsonrpsee = { workspace = true }
|
||||
reth = { workspace = true }
|
||||
reth-cli-commands = { workspace = true }
|
||||
reth-node-ethereum = { workspace = true }
|
||||
34
sz-poc-offsite-2025/evm/evm-node/src/main.rs
Normal file
34
sz-poc-offsite-2025/evm/evm-node/src/main.rs
Normal file
@ -0,0 +1,34 @@
|
||||
use clap::Parser;
|
||||
use futures_util::StreamExt;
|
||||
use reth::{
|
||||
builder::NodeHandle, chainspec::EthereumChainSpecParser, cli::Cli,
|
||||
transaction_pool::TransactionPool,
|
||||
};
|
||||
use reth_cli_commands::node::NoArgs;
|
||||
use reth_node_ethereum::node::EthereumNode;
|
||||
|
||||
fn main() {
|
||||
Cli::<EthereumChainSpecParser, NoArgs>::parse()
|
||||
.run(|builder, _| async move {
|
||||
// launch the node
|
||||
let NodeHandle {
|
||||
node,
|
||||
node_exit_future,
|
||||
} = builder.node(EthereumNode::default()).launch().await?;
|
||||
|
||||
// create a new subscription to pending transactions
|
||||
let mut pending_transactions = node.pool.new_pending_pool_transactions_listener();
|
||||
|
||||
// Spawn an async block to listen for validated transactions.
|
||||
node.task_executor.spawn(Box::pin(async move {
|
||||
// Waiting for new transactions
|
||||
while let Some(event) = pending_transactions.next().await {
|
||||
let tx = event.transaction;
|
||||
println!("Transaction received: {:?}", tx.transaction);
|
||||
}
|
||||
}));
|
||||
|
||||
node_exit_future.await
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
[package]
|
||||
name = "node"
|
||||
edition = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
tokio = { workspace = true, features = ["full"] }
|
||||
@ -1,2 +0,0 @@
|
||||
#[tokio::main]
|
||||
async fn main() {}
|
||||
Loading…
x
Reference in New Issue
Block a user