Skip to content

Commit

Permalink
update conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jaketarnow committed Jul 24, 2024
2 parents d501510 + e25d8e1 commit 95e1b97
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
6 changes: 3 additions & 3 deletions client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ const KEYGEN_URL: &str = "http://localhost:8080/keygen";
const AUTHORIZE_URL: &str = "http://localhost:8080/authorize";
const EXECUTE_URL: &str = "http://localhost:8081/execute";

const BROADCAST_URL: &str = "https://api.explorer.aleo.org/v1/testnet/transaction/broadcast";
const STATE_ROOT_URL: &str = "https://api.explorer.aleo.org/v1/testnet/stateRoot/latest";
const BROADCAST_URL: &str = "http://localhost:3033/canary/transaction/broadcast";
const STATE_ROOT_URL: &str = "http://localhost:3033/canary/stateRoot/latest";

const DEVNET_PRIVATE_KEY: &str = "APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH";

type CurrentNetwork = snarkvm::prelude::TestnetV0;
type CurrentNetwork = snarkvm::prelude::CanaryV0;

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
12 changes: 8 additions & 4 deletions execute-service/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ struct Opt {
async fn run<N: Network>(port: u16) {
pretty_env_logger::init();

let routes = execute_route::<N>().with(warp::trace(
|info| tracing::debug_span!("Debugging headers", headers = ?info.request_headers()),
));
let routes = execute_route::<N>()
.with(warp::trace(
|info| tracing::debug_span!("Debugging headers", headers = ?info.request_headers()),
))
.or(health_route().with(warp::trace(
|info| tracing::debug_span!("Debugging headers", headers = ?info.request_headers()),
)));

warp::serve(routes).run(([127, 0, 0, 1], port)).await;
warp::serve(routes).run(([0, 0, 0, 0], port)).await;
}

#[tokio::main]
Expand Down
10 changes: 10 additions & 0 deletions execute-service/src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@ pub fn execute_route<N: Network>() -> impl Filter<Extract = impl Reply, Error =
Ok(response)
})
}

// GET /health
pub fn health_route(
) -> impl Filter<Extract = (warp::reply::WithStatus<&'static str>,), Error = warp::Rejection> + Clone
{
warp::get()
.and(warp::path("health"))
.and(warp::path::end())
.map(|| warp::reply::with_status("Execute Service is up", warp::http::StatusCode::OK))
}

0 comments on commit 95e1b97

Please sign in to comment.