diff --git a/.gitignore b/.gitignore index be2f7735a..265e68954 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ Cargo.lock **/*.rs.bk consensus-spec-tests + +.env diff --git a/beacon-api-client/Cargo.toml b/beacon-api-client/Cargo.toml index 08dc459a1..76ac9c7a2 100644 --- a/beacon-api-client/Cargo.toml +++ b/beacon-api-client/Cargo.toml @@ -24,3 +24,6 @@ itertools = "0.10.3" clap = { version = "4.3.11", features = ["derive"], optional = true } thiserror = "1.0.30" ethereum-consensus = { path = "../ethereum-consensus" } + +[dev-dependencies] +dotenv = "0.15.0" diff --git a/beacon-api-client/examples/blob_sketch.rs b/beacon-api-client/examples/blob_sketch.rs new file mode 100644 index 000000000..1394dd9c6 --- /dev/null +++ b/beacon-api-client/examples/blob_sketch.rs @@ -0,0 +1,23 @@ +use beacon_api_client::{mainnet::Client, BlockId}; +use url::Url; + +#[tokio::main] +async fn main() { + let username = dotenv::var("NODE_USERNAME").unwrap(); + let password = dotenv::var("NODE_PASSWORD").unwrap(); + let devnet_name = "dencun-devnet-8"; + let cl = "teku"; + let el = "geth"; + + let url_str = + format!("https://{username}:{password}@bn.{cl}-{el}-1.srv.{devnet_name}.ethpandaops.io",); + + let url = Url::parse(&url_str).unwrap(); + let client = Client::new(url); + + let id = BlockId::Slot(194496); + let indices = []; + + let blobs = client.get_blob_sidecars(id, &indices).await.unwrap(); + dbg!(blobs); +}