Skip to content

Commit

Permalink
update testdata (#15)
Browse files Browse the repository at this point in the history
* chore: update testdata, move rpc to custom_reth

* docs: update readme
  • Loading branch information
captainlee1024 authored May 3, 2024
1 parent 3cef759 commit e2372c9
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 9 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# eigen-zeth

* Init the layer 1 chain

```shell
rm -rf /tmp/layer1/chain
reth init --datadir /tmp/layer1/chain --chain testdata/layer1/chain.json
RUST_LOG="debug,evm=trace,consensus::auto=trace,consensus::engine=trace,rpc::eth=trace" reth node -d --chain testdata/layer1/chain.json --datadir /tmp/layer1/chain --auto-mine --http --http.port 8545 --http.api debug,eth,net,trace,web3,rpc --port 30303 --authrpc.port 8551
```

* Init the chain and run the RPC-only node

```
rm -rf /tmp/chain
reth init --datadir /tmp/chain --chain testdata/chain.json
RUST_LOG="debug,evm=trace,consensus::auto=trace,consensus::engine=trace,rpc::eth=trace" reth node -d --chain testdata/chain.json --datadir /tmp/chain --auto-mine --http --http.port 8546 --http.api debug,eth,net,trace,web3,rpc
rm -rf /tmp/layer2/chain
reth init --datadir /tmp/layer2/chain --chain testdata/layer2/chain.json
RUST_LOG="debug,evm=trace,consensus::auto=trace,consensus::engine=trace,rpc::eth=trace" reth node -d --chain testdata/layer2/chain.json --datadir /tmp/layer2/chain --auto-mine --http --http.port 8546 --http.api debug,eth,net,trace,web3,rpc --port 30304 --authrpc.port 8552
RUST_LOG="rpc::eth=trace" ZETH_DB_PATH=/tmp/chain PROVER_ADDR=http://localhost:50061 ZETH_L2_ADDR=http://localhost:8546 HOST=0.0.0.0:8182 cargo run -r -- run --database mdbx
```
Expand Down
2 changes: 1 addition & 1 deletion src/config/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub static GLOBAL_ENV: Lazy<GlobalEnv> = Lazy::new(|| GlobalEnv {
prover_addr: std::env::var("PROVER_ADDR").unwrap_or("http://127.0.0.1:50061".to_string()),
curve_type: std::env::var("CURVE_TYPE").unwrap_or("BN128".to_string()),
host: std::env::var("HOST").unwrap_or("0.0.0.0:8182".to_string()),
zeth_db_path: std::env::var("ZETH_DB_PATH").unwrap_or("/tmp/chain".to_string()),
zeth_db_path: std::env::var("ZETH_DB_PATH").unwrap_or("/tmp/layer2/chain".to_string()),
chain_id: std::env::var("CHAIN_ID")
.unwrap_or("12345".to_string())
.parse::<u64>()
Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions src/custom_reth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ use std::convert::Infallible;
use thiserror::Error;

use crate::config::env::GLOBAL_ENV;
use crate::rpc;
use crate::custom_reth::eigen::EigenRpcExt;
use crate::custom_reth::eigen::EigenRpcExtApiServer;
use anyhow::{anyhow, Result};

use crate::rpc::eigen::EigenRpcExtApiServer;
pub(crate) mod eigen;

/// A custom payload attributes type.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
Expand Down Expand Up @@ -367,7 +368,7 @@ pub async fn launch_custom_node() -> Result<()> {
.with_events(TestCanonStateSubscriptions::default());
let config = TransportRpcModuleConfig::default().with_http([RethRpcModule::Eth]);
let mut server = rpc_builder.build(config);
let custom_rpc = rpc::eigen::EigenRpcExt { provider };
let custom_rpc = EigenRpcExt { provider };
server.merge_configured(custom_rpc.into_rpc())?;

// Start the server & keep it alive
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ mod custom_reth;
mod db;
mod operator;
mod prover;
mod rpc;
mod settlement;

#[tokio::main]
Expand Down
1 change: 0 additions & 1 deletion src/rpc/mod.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"d246c0b6aa409dbec802d40a7dda4e20"},"ciphertext":"7086f3f17e254079cca6924e559b1bf58abf52cd504a0c2a2bc31093f348ef1e","kdf":"scrypt","kdfparams":{"dklen":32,"n":8192,"p":1,"r":8,"salt":"c6e5881f372ec129acd5e9ae9fabe560a114e80689d704fd874eb794def55082"},"mac":"116dfc402c4c1284705b68b445e573cb8db5bbbc07161f974aabc9e7aad912bb"},"id":"992073b6-f016-4abb-8398-45c81ad2d8b0","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"0183cc2d1f7b4582b30c1570ad1a8f55"},"ciphertext":"42e616d01595aa4364f287d0e455802c79e06ffe368d57f7a22f5b58c4090044","kdf":"scrypt","kdfparams":{"dklen":32,"n":8192,"p":1,"r":8,"salt":"713e56751fd89327d4dfeee5297ceaf51f9ca7d59af71d9e560775a466d248db"},"mac":"c0dde26babd342ebca9d7e29ceaae08074904e4417a9475f2c236f9b557df5cc"},"id":"0c097b2c-059f-46f0-b2cf-cbcde8231cae","version":3}
37 changes: 37 additions & 0 deletions testdata/layer1/chain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"nonce": "0x42",
"timestamp": "0x0",
"extraData": "0x5343",
"gasLimit": "0x1388",
"difficulty": "0x400000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"0x0B89A9229940747EAc5918027d3c76968631F304": {
"balance": "0x4a47e3c12448f4ad000000"
},
"0xF8259389fF5c18034bDa9C136269D79Bd8ab2BD6": {
"balance": "0x4a47e3c12448f4ad000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"config": {
"ethash": {},
"chainId": 12345,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"berlinBlock": 0,
"londonBlock": 0,
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true,
"shanghaiTime": 0
}
}
File renamed without changes.

0 comments on commit e2372c9

Please sign in to comment.