From dd3ec652d0378223cc539d05a706cf18941a23de Mon Sep 17 00:00:00 2001 From: Danial Mehrjerdi Date: Fri, 27 Jun 2025 12:24:23 +0200 Subject: [PATCH] Add version url to quorum api --- apps/quorum/Cargo.lock | 2 +- apps/quorum/Cargo.toml | 2 +- apps/quorum/src/api.rs | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/quorum/Cargo.lock b/apps/quorum/Cargo.lock index 95d9b4d525..8f8008fee5 100644 --- a/apps/quorum/Cargo.lock +++ b/apps/quorum/Cargo.lock @@ -2760,7 +2760,7 @@ dependencies = [ [[package]] name = "quorum" -version = "0.2.1" +version = "0.2.2" dependencies = [ "anyhow", "axum", diff --git a/apps/quorum/Cargo.toml b/apps/quorum/Cargo.toml index 1308e362ed..317465d329 100644 --- a/apps/quorum/Cargo.toml +++ b/apps/quorum/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quorum" -version = "0.2.1" +version = "0.2.2" edition = "2021" [dependencies] diff --git a/apps/quorum/src/api.rs b/apps/quorum/src/api.rs index 576a19afbd..25858a694a 100644 --- a/apps/quorum/src/api.rs +++ b/apps/quorum/src/api.rs @@ -4,6 +4,7 @@ use axum::{ Json, Router, }; use axum_prometheus::{EndpointLabel, PrometheusMetricLayerBuilder}; +use clap::crate_version; use secp256k1::{ ecdsa::{RecoverableSignature, RecoveryId}, Message, Secp256k1, @@ -27,6 +28,10 @@ use crate::{ pub type Payload<'a> = &'a RawMessage; +async fn root() -> String { + format!("Quorum API {}", crate_version!()) +} + pub async fn run(listen_address: SocketAddr, state: State) -> anyhow::Result<()> { tracing::info!("Starting server..."); @@ -38,6 +43,7 @@ pub async fn run(listen_address: SocketAddr, state: State) -> anyhow::Result<()> .build_pair(); let routes = Router::new() + .route("/", get(root)) .route("/live", get(|| async { "OK" })) .route("/observation", post(post_observation)) .route("/ws", get(ws_route_handler))