feat: add GET /api/v1/nodes/{id} detail endpoint#22
Merged
Nic-dorman merged 1 commit intomainfrom Apr 1, 2026
Merged
Conversation
Returns full NodeConfig (flattened) + runtime state (status, pid, uptime_secs) for a single node. This gives GUI clients access to data_dir, rewards_address, ports, binary_path, env_variables, and bootstrap_peers without reading the registry file directly. - Uses existing NodeInfo type (config flattened via serde) - 404 when node ID not found - Coexists with existing DELETE on the same route path - E2e test: verifies full config, flattened JSON shape, and 404 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jacderida
approved these changes
Apr 1, 2026
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.
Summary
Adds a detail endpoint for individual nodes, returning full config + runtime state.
The problem: The status endpoint (
GET /api/v1/nodes/status) returns only summary info (id, name, version, status, pid, uptime). GUI clients need access todata_dir,rewards_address, ports,binary_path, etc. — currently only available by reading thenode_registry.jsonfile directly, which is fragile (path can be custom).The fix:
GET /api/v1/nodes/{id}returns the existingNodeInfotype — fullNodeConfig(flattened via serde) plus runtime state from the supervisor.Response example
{ "id": 1, "service_name": "node1", "rewards_address": "0x1234...", "data_dir": "/home/user/.local/share/ant/nodes/node-1", "log_dir": null, "node_port": null, "metrics_port": null, "network_id": 1, "binary_path": "/home/user/.local/share/ant/nodes/node-1/saorsa-node", "version": "0.4.1", "env_variables": {}, "bootstrap_peers": [], "status": "running", "pid": 12345, "uptime_secs": 3600 }Changes
server.rs: Addedget_node_detailhandler, routed asGETalongside existingDELETEon/api/v1/nodes/{id}daemon_integration.rs: E2e test — verifies full config response, flattened JSON shape, and 404Tests
Test plan
cargo test -p ant-core --test daemon_integration— 5 passcargo clippy -p ant-core -- -D warningsclean🤖 Generated with Claude Code