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
Page | Description |
---|---|
Guidance for JSON-RPC SDK Compliance | Requirements for a compliant Casper SDK |
Required JSON-RPC Methods for Minimal Compliance | Methods required for a minimally compliant Casper SDK |
Transactional JSON-RPC Method | Methods allowing interaction with a Casper network |
Informational JSON-RPC Methods | Methods returning information about the network from a Casper node |
Proof-of-Stake JSON-RPC Methods | Methods pertaining to Proof-of-Stake functionality on a Casper network |
Types | Information on types used within JSON-RPC methods |
CL Types | Information related to CL Types |