The Casper Sidecar provides connectivity to the binary port of a Casper node (among other capabilities), exposing a JSON-RPC interface for interacting with that node. The RPC protocol allows for basic operations like querying global state, sending transactions and deploys, etc. All of the available RPC methods are documented here.
The Sidecar maintains a TCP connection with the node and communicates using a custom binary protocol, which uses a request-response model. The Sidecar sends simple self-contained requests and the node responds to them. The requests can be split into these main categories:
- Read requests
- Queries for transient in-memory information like the current block height, peer list, component status etc.
- Queries for database items, with both the database and the key always being explicitly specified by the sidecar
- Transaction requests
- Requests to submit transactions for execution
- Requests to speculatively execute a transactions
Once setup and running as described here, the Sidecar can be queried for its JSON-RPC API using the rpc.discover
method, as shown below. The result will be a list of RPC methods and their parameters.
curl -X POST http://localhost:<RPC_SERVER_PORT>/rpc -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "method": "rpc.discover", "id": 1}'
Licensed under the Apache License Version 2.0.