Skip to content

Commit

Permalink
added logging to tree_data
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKitsune committed Oct 27, 2023
1 parent 426b0c3 commit 03884c6
Show file tree
Hide file tree
Showing 8 changed files with 295 additions and 387 deletions.
4 changes: 4 additions & 0 deletions crates/tree_availability/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ impl<M: Middleware> TreeAvailabilityService<M> {
let mut handles = vec![];

// Initialize a new router and spawn the server
tracing::info!("Iniitalizing axum server on port {port}");

let router = axum::Router::new()
.route("/inclusionProof", axum::routing::post(inclusion_proof))
.route("/synced", axum::routing::post(synced))
Expand All @@ -60,10 +62,12 @@ impl<M: Middleware> TreeAvailabilityService<M> {
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port);

let server_handle = tokio::spawn(async move {
tracing::info!("Spawning server");
axum::Server::bind(&address)
.serve(router.into_make_service())
.await
.map_err(TreeAvailabilityError::HyperError)?;
tracing::info!("Server spawned");

Ok(())
});
Expand Down
143 changes: 0 additions & 143 deletions crates/tree_availability/src/server.rs

This file was deleted.

Loading

0 comments on commit 03884c6

Please sign in to comment.