Start the ETH API service ETH API provides Ethereum JSON-RPC compatibility over CometBFT.
(
settings: &Settings,
cancel_token: &CancellationToken,
)
| 394 | /// |
| 395 | /// ETH API provides Ethereum JSON-RPC compatibility over CometBFT. |
| 396 | async fn start_eth_api( |
| 397 | settings: &Settings, |
| 398 | cancel_token: &CancellationToken, |
| 399 | ) -> Result<JoinHandle<Result<()>>> { |
| 400 | info!(target: "service.node_manager", "Starting ETH API service"); |
| 401 | |
| 402 | let settings = settings.clone(); |
| 403 | let token = cancel_token.clone(); |
| 404 | let config = RestartConfig::default(); |
| 405 | |
| 406 | let handle = tokio::spawn(async move { |
| 407 | run_service_with_restart( |
| 408 | "ETH API", |
| 409 | move || EthApiService::new(settings.clone(), Duration::from_secs(5)), |
| 410 | token, |
| 411 | config, |
| 412 | ) |
| 413 | .await |
| 414 | }); |
| 415 | |
| 416 | Ok(handle) |
| 417 | } |
| 418 | |
| 419 | /// Wait for all services to complete or shutdown |
| 420 | /// |
no test coverage detected