-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
107 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//! Info Module | ||
|
||
use color_eyre::eyre::{eyre, Result}; | ||
use kona_derive::online::AlloyL2ChainProvider; | ||
use kona_derive::traits::L2ChainProvider; | ||
use reqwest::Url; | ||
use std::sync::Arc; | ||
use superchain_registry::ROLLUP_CONFIGS; | ||
|
||
pub async fn run(l2_chain_id: u64, block: u64, rpc_url: String) -> Result<()> { | ||
let url = Url::parse(&rpc_url).map_err(|e| eyre!("Invalid RPC URL: {}", e))?; | ||
let rollup_config = ROLLUP_CONFIGS | ||
.get(&l2_chain_id) | ||
.ok_or_else(|| eyre!("No rollup config found for chain id: {}", l2_chain_id))?; | ||
let rollup_config = Arc::new(rollup_config.clone()); | ||
let mut provider = AlloyL2ChainProvider::new_http(url, rollup_config); | ||
let info = provider | ||
.l2_block_info_by_number(block) | ||
.await | ||
.map_err(|e| eyre!("Failed to fetch block info: {}", e))?; | ||
println!("{:#?}", info); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"l1Blocks": [ | ||
{ | ||
"number": 1000000, | ||
"hash": "0xf2f366c335a21d93f415bd4fbb15503e66909dd1d29acdcc1361bcaabe552c25", | ||
"timestamp": 1639128595, | ||
"transactions": [ | ||
"0xf8ab83053152830f42408307a1209425e1c58040f27ecf20bbd4ca83a09290326896b380b844202ee0ed000000000000000000000000000000000000000000000000000000000000f87d0000000000000000000000000000000000000000000000000000005f625aa20037a0aa428b8edc295c6fe45ac547d0ea0d7b5d21cddffa540a0efe2c3919faafba2ca0074d95c243613761482ba8de82d35b35e4c2c7036f52e91eda0c1ef1375a3dd4" | ||
], | ||
"blobs": [] | ||
}, | ||
{ | ||
"number": 1000001, | ||
"hash": "0x3461f55097bad77c0a272eddf68a49fc6baf89b0d005e65a6fa73872cb95e9ee", | ||
"timestamp": 1639128595, | ||
"transactions": [ | ||
"0xf8ab83034cfb830f42408307a120942e4a187732166a0282e52527b931c96146ac7c5880b844202ee0ed0000000000000000000000000000000000000000000000000000000000019de90000000000000000000000000000000000000000000000000000000021989dee38a004f4b36800df92a4ce2ad303b02529488e75cb2d25724047e0d85d0d6e996b34a01415643e528c0360f16a22e5d51ec2299bffc82c937ad0e8c4f02ec18696ee11" | ||
], | ||
"blobs": [] | ||
}, | ||
{ | ||
"number": 1000002, | ||
"hash": "0xcb884ef66577a707544a25945a01fa2135d047d7fb89089ef227b8dafa8e0e4a", | ||
"timestamp": 1639128595, | ||
"transactions": [ | ||
"0xf8ab83053153830f42408307a120942e4a187732166a0282e52527b931c96146ac7c5880b844202ee0ed0000000000000000000000000000000000000000000000000000000000019de900000000000000000000000000000000000000000000000000000000216b64d938a0784693b8703f496918f6ec86570c2b6c612ffd2d04de9e95acceaa193c3e1894a02d0bcdc6885f12f16beb09e0a997ae07c1120e5f3bb086a76face876956b6d2a" | ||
], | ||
"blobs": [] | ||
}, | ||
{ | ||
"number": 1000003, | ||
"hash": "0x9a30d7d3487f54d099a9f0aaf3b5b70f5ed0eb02cf7e27e0abef69c71576108f", | ||
"timestamp": 1639128595, | ||
"transactions": [ | ||
"0xf8ab8304c91e830f42408307a120942e4a187732166a0282e52527b931c96146ac7c5880b844202ee0ed0000000000000000000000000000000000000000000000000000000000019de900000000000000000000000000000000000000000000000000000000216275b538a0d7c0fa6c5addd96ef7d1401cfff00ac93e456512319e943100520d581852bd0fa01a91ce34ab319bd85fbe063ce85c0344d491dda07bf4ec53c8e2e911421aae46" | ||
], | ||
"blobs": [] | ||
}, | ||
{ | ||
"number": 1000004, | ||
"hash": "0x077eebe1973ffc700426c5b9b286decd18a90e055298b268e5d5378265ea5922", | ||
"timestamp": 1639128595, | ||
"transactions": [ | ||
"0xf8ab830475a8830f42408307a120942e4a187732166a0282e52527b931c96146ac7c5880b844202ee0ed0000000000000000000000000000000000000000000000000000000000019de900000000000000000000000000000000000000000000000000000000215ddec038a039a12a6bfae4354eec9f03fd917de52a67d03b2b510c741e6693aab230849680a044bc938dd8cd9151a2554f35c190ad3cfdec16c492a3b793b3ebb70425cb3de9" | ||
], | ||
"blobs": [] | ||
} | ||
], | ||
"l2OutputRoots": [ | ||
"0x0000000000000000000000000000000000000000000000000000000000000000" | ||
] | ||
} |