diff --git a/bin/reth/src/main.rs b/bin/reth/src/main.rs index f8b095eed883..f29f8497c31f 100644 --- a/bin/reth/src/main.rs +++ b/bin/reth/src/main.rs @@ -46,6 +46,7 @@ use reth_provider::providers::BlockchainProvider; use reth_rpc_api::{eth::{helpers::AddDevSigners, FullEthApiServer}, EngineApiClient}; use reth_tasks::TaskManager; use reth_transaction_pool::{blobstore::DiskFileBlobStore, CoinbaseTipOrdering, EthPooledTransaction, EthTransactionValidator, Pool, TransactionValidationTaskExecutor}; +use traits::RpcServerArgsExEx; use std::{future::Future, marker::PhantomData, pin::Pin, sync::Arc}; use alloy_rlp::Decodable; @@ -278,7 +279,7 @@ fn main() -> eyre::Result<()> { .with_chain(chain_spec.clone()) .with_network(network_config.clone()) .with_unused_ports() - .with_rpc(RpcServerArgs::default().with_unused_ports().with_http()) + .with_rpc(RpcServerArgs::default().with_unused_ports().with_static_l2_rpc_ip_and_port()) .set_dev(true); let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(node_config.clone()) diff --git a/bin/reth/src/rpc.rs b/bin/reth/src/rpc.rs index 8e499bcca60c..21830492e182 100644 --- a/bin/reth/src/rpc.rs +++ b/bin/reth/src/rpc.rs @@ -1,3 +1,5 @@ +use std::net::Ipv4Addr; + use alloy_consensus::TxEnvelope; use alloy_network::eip2718::Decodable2718; use reth::{ @@ -10,8 +12,11 @@ use reth::{ server_types::eth::EthResult, }, }; +use reth_node_core::args::RpcServerArgs; use reth_primitives::{Bytes, B256}; +use crate::traits::RpcServerArgsExEx; + pub struct RpcTestContext { pub inner: RpcRegistry, } @@ -33,3 +38,14 @@ where Ok(TxEnvelope::decode_2718(&mut tx.as_ref()).unwrap()) } } + +impl RpcServerArgsExEx for RpcServerArgs { + fn with_static_l2_rpc_ip_and_port(mut self) -> Self { + self.http = true; + // On the instance the program is running, we wanna have 10111 exposed as the (exex) L2's RPC port. + self.http_addr = Ipv4Addr::new(0, 0, 0, 0).into(); + self.http_port = 10110u16; + self.ws_port = 10111u16; + self + } +} diff --git a/bin/reth/src/traits.rs b/bin/reth/src/traits.rs index 2d8b4789da39..61632e0c930b 100644 --- a/bin/reth/src/traits.rs +++ b/bin/reth/src/traits.rs @@ -20,3 +20,6 @@ impl PayloadEnvelopeExt for ExecutionPayloadEnvelopeV3 { self.execution_payload.clone() } } +pub trait RpcServerArgsExEx { + fn with_static_l2_rpc_ip_and_port(self) -> Self; +} diff --git a/packages/protocol/scripts/setup_deps.sh b/packages/protocol/scripts/setup_deps.sh index 4fd4f8865b7d..650df26da2a4 100755 --- a/packages/protocol/scripts/setup_deps.sh +++ b/packages/protocol/scripts/setup_deps.sh @@ -84,7 +84,7 @@ fi # Run the Kurtosis command and capture its output echo "Running Kurtosis command..." -KURTOSIS_OUTPUT=$(kurtosis run github.com/ethpandaops/ethereum-package --args-file ./scripts/confs/network_params.yaml) +KURTOSIS_OUTPUT=$(kurtosis run github.com/adaki2004/ethereum-package --args-file ./scripts/confs/network_params.yaml) # Print the entire Kurtosis output for debugging # echo "Kurtosis Output:" @@ -124,8 +124,6 @@ fi # Run the forge foundry script using the extracted RPC port and PRIVATE_KEY FORGE_COMMAND="forge script --rpc-url http://127.0.0.1:$RPC_PORT scripts/DeployL1Locally.s.sol -vvvv --broadcast --private-key $PRIVATE_KEY --legacy" - echo "Running forge foundry script..." eval $FORGE_COMMAND - echo "Script execution completed."