helios/src/main.rs

30 lines
772 B
Rust
Raw Normal View History

2022-08-26 01:18:47 +00:00
use std::{sync::Arc, time::Duration};
2022-08-20 17:18:40 +00:00
use eyre::Result;
2022-08-16 22:59:07 +00:00
2022-08-26 01:18:47 +00:00
use client::{rpc::Rpc, Client};
use tokio::time::sleep;
2022-08-24 01:33:48 +00:00
2022-08-21 13:13:56 +00:00
pub mod client;
2022-08-21 16:59:47 +00:00
pub mod common;
2022-08-19 22:43:58 +00:00
pub mod consensus;
2022-08-20 17:18:40 +00:00
pub mod execution;
#[tokio::main]
async fn main() -> Result<()> {
2022-08-21 13:13:56 +00:00
let consensus_rpc = "http://testing.prater.beacon-api.nimbus.team";
let execution_rpc = "https://eth-goerli.g.alchemy.com:443/v2/o_8Qa9kgwDPf9G8sroyQ-uQtyhyWa3ao";
2022-08-19 22:43:58 +00:00
let checkpoint = "0x172128eadf1da46467f4d6a822206698e2d3f957af117dd650954780d680dc99";
2022-08-20 20:33:32 +00:00
2022-08-21 13:13:56 +00:00
let mut client = Client::new(consensus_rpc, execution_rpc, checkpoint).await?;
2022-08-19 22:43:58 +00:00
client.sync().await?;
2022-08-19 00:33:44 +00:00
2022-08-26 01:18:47 +00:00
let mut rpc = Rpc::new(Arc::new(client));
let addr = rpc.start().await?;
println!("{}", addr);
2022-08-24 01:33:48 +00:00
2022-08-26 01:18:47 +00:00
sleep(Duration::from_secs(300)).await;
2022-08-20 14:10:28 +00:00
Ok(())
}