Skip to main content
Version: Next

Interacting with the Casper JSON-RPC API

Casper uses a custom JSON-RPC implementation called casper-json-rpc that complies with the JSON-RPC 2.0 specification.

The Casper Sidecar service offers a JSON-RPC API server for clients to interact with a Casper node. The Sidecar acts as a JSON bridge between subscribers and a Casper node's binary port, producing faster responses and reducing the load placed on the node. For more details on how the JSON-RPC API works, see the JSON-RPC README in the Sidecar repository. The Sidecar usually runs on the same machine as the node process, and you need to find the port on which to access the Sidecar.

You can find the latest RPC schema in the Sidecar's GitHub repository.

The Casper client subcommand list-rpcs also provides all currently supported RPCs. Here is an example of running the Casper client to list RPCs:

casper-client list-rpcs --node-address <HOST:PORT>

You may use Postman or write code to interact with the Casper JSON-RPC API, which is fully compatible with the JSON-RPC 2.0 Specification.

Table of Contents

PageDescription
Guidance for JSON-RPC SDK ComplianceRequirements for a compliant Casper SDK
Required JSON-RPC Methods for Minimal ComplianceMethods required for a minimally compliant Casper SDK
Transactional JSON-RPC MethodMethods allowing interaction with a Casper network
Informational JSON-RPC MethodsMethods returning information about the network from a Casper node
Proof-of-Stake JSON-RPC MethodsMethods pertaining to Proof-of-Stake functionality on a Casper network
TypesInformation on types used within JSON-RPC methods
CL TypesInformation related to CL Types