This example is a two-crate JSON-RPC service that demonstrates shared API definitions, authentication, generated OpenRPC documentation, and Prometheus metrics.
api/defines the JSON-RPC methods and shared request/response types.service/implements the handlers, authentication, metrics, and HTTP server.
From the workspace root:
cargo run -p basic-jsonrpc-service --lockedThe service starts at http://localhost:3000 with:
- JSON-RPC endpoint:
POST /rpc - Explorer UI:
/rpc/explorer - OpenRPC document:
/rpc/explorer/openrpc.json - Prometheus metrics:
/metrics
See service/README.md for credentials and request examples.