IntersectMBO / IntersectMBO/cardano-node
[FR] - cardano-testnet: machine-readable manifest and status command
- Dominant language
- Haskell
- Stars
- 3.2k
- Forks
- 754
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 20
Description
**Internal/External**
*Internal*
**Area**
*cardano-testnet*
## 1. Machine-readable runtime interface (manifest and status)
### Problem
When `cardano-testnet cardano` starts a network it knows every socket path, port, and key location. But it only communicates them as human-oriented log text and an undocumented directory layout.
Programs that start `cardano-testnet` must therefore scrape the output directory and poll with their own retry loops. Consumers usually build this layer independently: `cardano-transaction-lib` parses the run directory ([their integration doc](https://github.com/Plutonomicon/cardano-transaction-lib/blob/develop/doc/cardano-testnet-testing.md)), the YACD Kubernetes operator wraps the binary, and Tweag's `cardano-peras` repo wraps it again.
The request is old and still open: [#5848](https://github.com/IntersectMBO/cardano-node/issues/5848) (2024) asks for "more structured output (e.g. JSON) so that we can parse the TMP dir to get the node socket path, etc.".
### Proposal
1. **Manifest.** On successful startup, write `/manifest.json`: network magic, era, and per node: name, role, socket path, port, config path; plus the funded key files. Document it as a stable interface, so the rest of the directory layout can keep changing freely.
2. **Status command.** `cardano-testnet status --output-dir DIR [--json]`: reports ready/synced/tip, exit code 0 only when the chain is producing blocks.
### References
[#5848](https://github.com/IntersectMBO/cardano-node/issues/5848) · [#6405](https://github.com/IntersectMBO/cardano-node/pull/6405) (keep-running behavior)
Contributor guide
Assessment
This issue has not been assessed yet.