add beacon chain explorer

This commit is contained in:
YaroShkvorets
2024-03-27 21:24:55 -04:00
parent ac908c42fe
commit a7aeb1b64d
20 changed files with 1348 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
use substreams::Hex;
use crate::pb::beacon::blobs::v1::Blobs;
use crate::pb::sf::beacon::r#type::v1::{block::Body::*, Block};
#[substreams::handlers::map]
fn map_blobs(blk: Block) -> Result<Blobs, substreams::errors::Error> {
Ok(Blobs {
slot: blk.slot,
blobs: match blk.body {
Some(Deneb(body)) => body.embedded_blobs.into_iter().map(|b| Hex::encode(&b.blob)).collect(),
_ => vec![],
},
})
}