Skip to content

Commit

Permalink
add blob example from beacon APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Sep 15, 2023
1 parent afdbc28 commit a4ac111
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ Cargo.lock
**/*.rs.bk

consensus-spec-tests

.env
3 changes: 3 additions & 0 deletions beacon-api-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
23 changes: 23 additions & 0 deletions beacon-api-client/examples/blob_sketch.rs
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit a4ac111

Please sign in to comment.