2022-08-11 18:09:58 +00:00
|
|
|
use eyre::Result;
|
2022-08-16 22:59:07 +00:00
|
|
|
|
2022-08-19 22:43:58 +00:00
|
|
|
use consensus::*;
|
|
|
|
|
|
|
|
pub mod consensus;
|
|
|
|
pub mod consensus_rpc;
|
2022-08-16 22:59:07 +00:00
|
|
|
pub mod utils;
|
2022-08-19 00:33:44 +00:00
|
|
|
pub mod proof;
|
2022-08-11 18:09:58 +00:00
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> Result<()> {
|
|
|
|
|
2022-08-19 22:43:58 +00:00
|
|
|
let rpc = "http://testing.prater.beacon-api.nimbus.team";
|
|
|
|
let checkpoint = "0x172128eadf1da46467f4d6a822206698e2d3f957af117dd650954780d680dc99";
|
|
|
|
let mut client = ConsensusClient::new(rpc, checkpoint).await?;
|
|
|
|
|
|
|
|
client.sync().await?;
|
2022-08-19 00:33:44 +00:00
|
|
|
|
2022-08-19 22:43:58 +00:00
|
|
|
let payload = client.get_execution_payload().await?;
|
|
|
|
println!("verified execution block hash: {}", hex::encode(payload.block_hash));
|
2022-08-17 21:25:08 +00:00
|
|
|
|
2022-08-11 18:09:58 +00:00
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|