-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Summary
PR #1745 started documenting the RPC endpoints and how the RPC server works.
However, we need to ensure all endpoints are documented to avoid node operators
missing crucial data.
Goal
Every constructor of the RpcRequest enum in node/src/rpc/mod.rs:75-113
should be documented with:
- A curl script in
website/docs/developers/api-and-data/scripts/rpc-api/curl/ - A corresponding test in
.github/scripts/test-rpc-remote/ - An entry in the RPC API documentation page
RpcRequest variants to document
The following variants need documentation (check those already done):
| Variant | Endpoint | Documented | Tested |
|---|---|---|---|
StateGet |
/state |
[x] | [x] |
StatusGet |
/status |
[x] | [x] |
HeartbeatGet |
/heartbeat |
[ ] | [ ] |
ActionStatsGet |
/stats/actions |
[ ] | [ ] |
SyncStatsGet |
/stats/sync |
[x] | [x] |
BlockProducerStatsGet |
/stats/block_producer |
[x] | [x] |
MessageProgressGet |
/state/message-progress |
[x] | [x] |
PeersGet |
/state/peers |
[x] | [x] |
P2pConnectionOutgoing |
/p2p/connection/outgoing |
[ ] | [ ] |
P2pConnectionIncoming |
/p2p/connection/incoming |
[ ] | [ ] |
ScanStateSummaryGet |
/scan-state/summary |
[x] | [x] |
SnarkPoolGet |
/snark-pool/jobs |
[x] | [x] |
SnarkPoolJobGet |
/snark-pool/job/{id} |
[ ] | [ ] |
SnarkPoolCompletedJobsGet |
/snark-pool/completed-jobs |
[ ] | [ ] |
SnarkPoolPendingJobsGet |
/snark-pool/pending-jobs |
[ ] | [ ] |
SnarkerConfig |
/snarker/config |
[x] | [x] |
SnarkerJobCommit |
/snarker/job/commit |
[ ] | [ ] |
SnarkerJobSpec |
/snarker/job/spec |
[ ] | [ ] |
SnarkerWorkers |
/snarker/workers |
[x] | [x] |
HealthCheck |
/healthz |
[x] | [x] |
ReadinessCheck |
/readyz |
[x] | [x] |
DiscoveryRoutingTable |
/discovery/routing_table |
[x] | [x] |
DiscoveryBoostrapStats |
/discovery/bootstrap_stats |
[x] | [x] |
TransactionPoolGet |
/transaction-pool |
[x] | [x] |
LedgerAccountsGet |
/accounts |
[x] | [x] |
TransactionInject |
/transaction/inject |
[ ] | [ ] |
TransitionFrontierUserCommandsGet |
/transition-frontier/user-commands |
[ ] | [ ] |
BestChain |
/best-chain |
[ ] | [ ] |
ConsensusConstantsGet |
/consensus/constants |
[ ] | [ ] |
TransactionStatusGet |
/transaction/status |
[ ] | [ ] |
GetBlock |
/block |
[ ] | [ ] |
PooledUserCommands |
/pooled-user-commands |
[ ] | [ ] |
PooledZkappCommands |
/pooled-zkapp-commands |
[ ] | [ ] |
GenesisBlockGet |
/genesis-block |
[ ] | [ ] |
ConsensusTimeGet |
/consensus/time |
[ ] | [ ] |
LedgerStatusGet |
/ledger/status |
[ ] | [ ] |
LedgerAccountDelegatorsGet |
/ledger/account/delegators |
[ ] | [ ] |
Implementation steps
For each undocumented endpoint:
-
Create curl script in
website/docs/developers/api-and-data/scripts/rpc-api/curl/{endpoint}.sh#!/bin/bash RPC_ENDPOINT="${1:-http://localhost:3000}" curl -s -X GET "$RPC_ENDPOINT/{path}" -H "Content-Type: application/json"
-
Create test script in
.github/scripts/test-rpc-remote/test-{endpoint}.sh
that calls the curl script and validates the response -
Add workflow step in
.github/workflows/test-rpc-remote.yml -
Document in website at
website/docs/developers/api-and-data/rpc-api.md
Note on using AI
This task is well-suited for AI assistants (e.g., Claude Code). The work is
repetitive and follows a clear pattern established by the existing documented
endpoints. Using AI is recommended to speed up the process.
Verification
The CI workflow includes a verification step that fails if any curl script
doesn't have a corresponding test:
- name: Verify all curl scripts have testsAcceptance criteria
- All
RpcRequestvariants have corresponding curl scripts - All curl scripts have corresponding tests in CI
- All endpoints are documented in the RPC API page
- CI verification step passes
- Documentation links to Rust API docs for response types
Related
- PR Website: add RPC API documentation with CI validation #1745: Initial RPC documentation
- Sub-issue of Features parity with the OCaml node #1354 (Road to main-net)
Location
- Enum:
node/src/rpc/mod.rs:75-113 - Curl scripts:
website/docs/developers/api-and-data/scripts/rpc-api/curl/ - Tests:
.github/scripts/test-rpc-remote/ - Workflow:
.github/workflows/test-rpc-remote.yml - Documentation:
website/docs/developers/api-and-data/rpc-api.md
Metadata
Metadata
Assignees
Labels
Type
Projects
Status