Skip to content

Documentation: Add RPC endpoints reference to website #1743

@dannywillems

Description

@dannywillems

⚠️ Auto-generated issue: This issue was automatically generated. Please review the description before assigning.

Summary

Add documentation for the node's HTTP RPC endpoints to the website, similar to the existing GraphQL API documentation and Archive Database Queries.

This documentation will complement the node dashboard documentation by explaining the RPC endpoints that the dashboard uses to retrieve node information.

Note: These RPC endpoints are specific to the Rust node implementation and differ from the OCaml node's RPC interface. The Rust node exposes its own set of HTTP endpoints designed for its state machine architecture.

Background

The node exposes RPC endpoints via HTTP (using warp) that are separate from the GraphQL server. These endpoints provide functionality like:

  • /status - Node status information
  • /state/peers - Connected peers
  • /healthz - Health check
  • /readyz - Readiness check
  • /stats/actions - Action statistics
  • /stats/sync - Sync statistics
  • /stats/block_producer - Block producer statistics
  • /snark-pool/jobs - SNARK pool jobs
  • /snarker/workers - SNARK workers
  • /snarker/config - SNARK configuration
  • /transaction-pool - Transaction pool
  • /accounts - Ledger accounts
  • /discovery/routing_table - Discovery routing table
  • /discovery/bootstrap_stats - Bootstrap statistics
  • /scan-state/summary - Scan state summary
  • /state - Full state (with optional JSONPath filter)

Implementation details

The RPC endpoints are implemented in:

  • node/native/src/http_server.rs - HTTP route definitions (warp)
  • node/src/rpc/mod.rs - Request/response types (RpcRequest enum)
  • node/src/rpc/rpc_reducer.rs - Request processing logic
  • node/common/src/service/rpc/ - Service layer

Suggested documentation structure

Create website/docs/developers/rpc-api.md covering:

  1. Overview and purpose (when to use RPC vs GraphQL)
  2. Clarification that these are Rust node-specific endpoints (not OCaml compatible)
  3. Endpoint reference table with methods, paths, and descriptions
  4. Request/response examples (curl commands)
  5. Common use cases:
    • Health monitoring
    • Peer discovery
    • Sync status tracking
    • SNARK pool management
  6. State filtering with JSONPath (for /state endpoint)
  7. Integration with the node dashboard

CI validation

Similar to the GraphQL API documentation, add CI checks to validate that the documented RPC endpoints exist and are functional. This can be done by:

  • Using the O1Labs-hosted node to test endpoint availability
  • Running curl commands against the documented endpoints
  • Verifying response format matches documentation

This ensures the documentation stays in sync with the actual implementation.

Acceptance criteria

  • New documentation page at website/docs/developers/rpc-api.md
  • Updated sidebar to include the new page
  • Examples with curl commands for common endpoints
  • Cross-references to GraphQL API where appropriate
  • Clear note distinguishing from OCaml node RPC
  • Reference to node dashboard usage
  • CI workflow to validate RPC endpoints against O1Labs node

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions