Skip to content

feat(docs): autogenerate node JSON-RPC API reference#22543

Merged
critesjosh merged 6 commits into
nextfrom
jc/autogen-node-api-reference
May 7, 2026
Merged

feat(docs): autogenerate node JSON-RPC API reference#22543
critesjosh merged 6 commits into
nextfrom
jc/autogen-node-api-reference

Conversation

@critesjosh

Copy link
Copy Markdown
Contributor

Summary

  • Adds a TypeScript generation script (docs/scripts/node_api_reference_generation/) that parses the AztecNode and AztecNodeAdmin TypeScript interfaces and Zod schemas to produce the node API reference doc
  • Replaces the manually-maintained node-api-reference.md with an autogenerated version
  • Regenerates the v4.1.3 versioned doc to fix missing endpoints reported by external integrators (drpc)

What this fixes

The manual doc had drifted significantly from the actual API:

  • 14 methods were missing from the docs, including node_getCheckpointedBlockNumber, node_getCheckpointsDataForEpoch, node_getCheckpointNumber, and others that external integrators need
  • 7 methods were documented but no longer exist in the API (e.g., sibling path methods were removed, log methods were renamed)

How it works

The generator uses the TypeScript Compiler API to parse source files (no runtime imports needed):

  1. Phase A: Extracts JSDoc comments (descriptions, @param, @returns, @deprecated) from interface declarations
  2. Phase B: Parses Zod schema object literals from source AST to enumerate methods and extract parameter/return types
  3. Phase C: Generates a complete markdown doc with method grouping, examples, and admin API security warnings

Run with: yarn generate:node-api-reference

Method count comparison (v4.1.3)

Manual doc Generated
Total methods 57 64
Missing methods 14 0
Stale methods 7 0

Test plan

  • Generator runs successfully against current HEAD (64 methods)
  • Generator runs successfully against v4.1.3 sources (64 methods)
  • All previously-missing methods are present in output
  • yarn build passes in docs directory
  • Verify rendered page on docs site

🤖 Generated with Claude Code

…source

Adds a generation script that parses the AztecNode and AztecNodeAdmin
interfaces to produce the API reference doc, ensuring it stays in sync
with the actual RPC surface. Fixes missing endpoints (getCheckpointedBlockNumber,
getCheckpointsDataForEpoch, etc.) and removes stale methods.
AztecBot added a commit that referenced this pull request Apr 15, 2026
…node API reference

- Added node JSON-RPC API reference generator from PR #22543
  (scripts/node_api_reference_generation/)
- Generated node API reference for v4.2.0 (64 methods: 56 node + 8 admin)
- Cut network versioned docs snapshot for v4.2.0
- Updated network_version_config.json: mainnet → v4.2.0, testnet stays v4.1.3
- network_versions.json: ["v4.2.0", "v4.1.3"]
…eference

# Conflicts:
#	.claude/skills/release-network-docs/SKILL.md
#	docs/docs-operate/operators/reference/node-api-reference.md
#	docs/network_versioned_docs/version-v4.1.3/operators/reference/node-api-reference.md
@critesjosh critesjosh marked this pull request as ready for review April 27, 2026 15:24

@ciaranightingale ciaranightingale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, don't really have context to know and properly review but lgtm as far as I can tell (plus claude)

@critesjosh critesjosh enabled auto-merge May 7, 2026 13:41
@critesjosh critesjosh added this pull request to the merge queue May 7, 2026
Merged via the queue into next with commit 23a580e May 7, 2026
33 of 35 checks passed
@critesjosh critesjosh deleted the jc/autogen-node-api-reference branch May 7, 2026 15:46
@AztecBot

AztecBot commented May 7, 2026

Copy link
Copy Markdown
Collaborator

❌ Failed to cherry-pick to v4-next due to conflicts. (🤖) View backport run.

critesjosh added a commit that referenced this pull request May 8, 2026
…updates

The original cherry-pick of 6fd76de carried only the first commit of
PR #22543's five-commit feature branch, leaving the script using the
pre-22543 build-required check and missing the SKILL.md/CLAUDE.md/README.md
documentation that landed alongside.

Bring this backport in line with PR #22543's final merged state:

- Replace the .sh `stdlib/dest/` build check with source-file + node_modules
  checks (no yarn-project build needed).
- Apply the .ts generator improvements: optional handling order, array
  parenthesization, BlockHash in BlockParameterSchema, JSDoc index fix,
  name-aware example params, remarks rendering, fallback warnings.
- Add Step 5a (Regenerate Node API Reference) to release-network-docs
  SKILL.md plus the matching Key Points entry.
- Document `yarn generate:node-api-reference` in docs/CLAUDE.md and add
  the Node JSON-RPC API Reference section to docs/README.md.
- Regenerate docs-operate/.../node-api-reference.md against this branch's
  yarn-project interfaces (64 methods, 55 node + 9 admin).

METHOD_GROUPS adjustments for this branch's API surface: re-add
getSlashPayloads to the admin group (still present in
aztec-node-admin.ts here) and drop getPredictedMinFees from the fees
group (not yet present here). The version-v2.1.11-ignition snapshot is
left untouched — its content reflects that release's API and would be
corrupted by regenerating against HEAD.
critesjosh added a commit that referenced this pull request May 8, 2026
…22543) (#23046)

Backport of #22543 to `backport-to-v4-next-staging`.

Cherry-pick of the squash-merge commit (`6fd76de513`) applied cleanly
via `git cherry-pick` (the automatic backport workflow's `gh pr diff |
git apply --reject` had failed; switching to a real cherry-pick resolved
it without manual conflict edits).

## Files

- `docs/docs-operate/operators/reference/node-api-reference.md` —
regenerated reference
-
`docs/network_versioned_docs/version-v2.1.11-ignition/operators/reference/node-api-reference.md`
— regenerated versioned snapshot
-
`docs/scripts/node_api_reference_generation/generate_node_api_reference.{sh,ts}`
— new generation script
- `docs/package.json` — wires up the generator

## Verification

- `git cherry-pick 6fd76de` succeeded with auto-merge; working tree
clean afterwards.
- Reference paths (`docs/docs-operate/...`,
`docs/network_versioned_docs/version-v2.1.11-ignition/...`) exist on the
staging branch, so the generated files land in valid locations.

Original PR description: see #22543.

ClaudeBox log: https://claudebox.work/s/6b4f81c28ae8a770?run=1
AztecBot added a commit that referenced this pull request May 9, 2026
BEGIN_COMMIT_OVERRIDE
fix(aztec-up): Aztec installer does not shadow user installed binaries
on PATH (#22902)
fix: include sqlite binary in its npm package (#23039)
chore: backport #23041 (add sendMessagesAs to wallet api schemas) to
v4-next (#23081)
chore: backport DeployMethod refactor (#22985) to v4-next (#23029)
refactor(pxe): deduplicate tx hash lookups in MessageContextService
(#23075)
refactor(pxe): batch tagged private log queries across all secrets
(#23048)
refactor(pxe): batch log RPC calls in LogService.fetchLogsByTag (#23088)
feat(aztec-nr): Initial handshake registry contract with non interactive
handshake function (#22854)
fix: add Tag.random() helper required by backported #23088 tests
(#23094)
chore: backport: fix(aztec-up): installer does not shadow user binaries
on PATH (#22902) (#23060)
chore: backport handshake registry contract (#22854) to v4-next (#23063)
feat: deploy method refactor 2 (#23033)
refactor(pxe): skip redundant getBlock RPC when querying at anchor block
(#23100)
port(v4-next): feat(docs): autogenerate node JSON-RPC API reference
(#22543) (#23046)
chore: backport feat: deploy method refactor 2 (#23033) to v4-next
(#23103)
port(v4-next): feat(ci): Snapshots for aztec-nr contract compilation
failures and nargo expand (#23061) (#23104)
feat(txe): allow authorizing cross-contract utility calls in nr tests
(#23064)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants