anvil/server/beacon/mod.rs
1//! Beacon Node REST API implementation for Anvil.
2
3use axum::{Router, routing::get};
4
5use crate::eth::EthApi;
6
7mod error;
8mod handlers;
9mod utils;
10
11/// Configures an [`axum::Router`] that handles Beacon REST API calls.
12pub fn router(api: EthApi) -> Router {
13 Router::new()
14 .route("/eth/v1/beacon/blob_sidecars/{block_id}", get(handlers::handle_get_blob_sidecars))
15 .route("/eth/v1/beacon/blobs/{block_id}", get(handlers::handle_get_blobs))
16 .route("/eth/v1/beacon/genesis", get(handlers::handle_get_genesis))
17 .with_state(api)
18}