feat(coordinator): add local development dashboard with service status#425
Merged
Merged
Conversation
Closes HitEmPoka#325 Adds a single-page web dashboard, served by the coordinator at http://localhost:8080/, that shows live status of every local service: the Soroban container, the three MPC nodes, the coordinator itself, and the Soroban poker_table contract deployment. The page polls /api/health every 5 seconds and renders the result into per-service cards with a clear ok/disconnected/not-configured pill. - services/coordinator/src/main.rs: extends HealthResponse with a contract_deployment field (configured: bool, contract_id: String) so the dashboard can render contract deployment status without a second endpoint. configured is true when SorobanConfig.is_configured() holds (contract id set and signer not the test placeholder); the contract id is exposed so the developer can copy it and verify on-chain. Adds GET / as a new route that returns the dashboard page. - services/coordinator/src/dashboard.rs (new): tiny axum handler that returns the embedded HTML. The page is included at compile time via include_str! so no extra static-asset deployment step is required. - services/coordinator/src/dashboard.html (new): vanilla HTML + CSS + JS, no build step. Polls /api/health, renders one card per service (coordinator, soroban-rpc, three mpc-nodes, contract deployment), surfaces uptime, active MPC sessions, maintenance mode, and the contract id alongside a status pill, and shows an error banner when the coordinator becomes unreachable so the dashboard reflects local stack issues immediately. The dashboard reads only public state already exposed by /api/health and the coordinator binary, so no new env vars, dependencies, or deploy steps are needed; it works against any coordinator instance.
|
@Labi-Joy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #325.
Adds a single-page web dashboard, served by the coordinator at
http://localhost:8080/, that shows live status of every local service: the Soroban container, the three MPC nodes, the coordinator itself, and the Sorobanpoker_tablecontract deployment. The page polls/api/healthevery 5 seconds and renders the result into per-service cards with a clear ok / disconnected / not-configured pill.What landed
services/coordinator/src/main.rsextendsHealthResponsewith acontract_deploymentfield (configured: bool,contract_id: String) so the dashboard can render contract deployment status without a second endpoint.configuredis true whenSorobanConfig::is_configured()holds (contract id set and signer not the test placeholder); the contract id is exposed so the developer can copy it and verify on-chain. AddsGET /as a new route that returns the dashboard page.services/coordinator/src/dashboard.rs(new): tiny axum handler that returns the embedded HTML. The page is included at compile time viainclude_str!so no extra static-asset deployment step is required.services/coordinator/src/dashboard.html(new): vanilla HTML + CSS + JS, no build step. Polls/api/health, renders one card per service (coordinator, soroban-rpc, three mpc-nodes, contract deployment), surfaces uptime, active MPC sessions, maintenance mode, and the contract id alongside a status pill, and shows an error banner when the coordinator becomes unreachable so the dashboard reflects local stack issues immediately.The dashboard reads only public state already exposed by
/api/healthand the coordinator binary, so no new env vars, dependencies, or deploy steps are needed; it works against any coordinator instance.Note on
cargo checkand upstream statecargo check -p coordinatoragainst the freshly fetchedupstream/main(commitaec9538) currently fails with 48 compile errors that are unrelated to this PR. A quick sampling:error[E0432]: unresolved import 'utoipa',error[E0432]: unresolved import 'utoipa_swagger_ui',error[E0432]: unresolved import 'crate::api_keys',error[E0609]: no field 'mpc_client' on type 'AppState',error[E0560]: struct 'HealthResponse' has no field 'maintenance_mode'(the populator at the bottom ofhealth()references a field that no longer exists on the struct). These look like the tail of an in-flight refactor that landed onmainwithout the dependent crates / modules being introduced.Applying this PR on top of
upstream/mainleaves the error count at exactly the same number (48), i.e. the dashboard module does not introduce any new errors and is internally coherent (the newHealthResponse.contract_deploymentfield is added to the struct, thecomponents(schemas(...))list, and thehealth()populator together). I confirmed this by runningcargo check -p coordinatoronaec9538directly and onaec9538 + this PR.Once upstream
maincompiles again, I can rebase and confirm a clean check.How to verify locally
docker compose up -d soroban mpc-node-0 mpc-node-1 mpc-node-2 cargo run -p coordinator # in another shell open http://localhost:8080/Cards should appear within a few seconds and refresh every 5 seconds.