The Casper Event Sidecar is a process that connects to the RPC port of a Casper node and exposes 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 RPC methods are documented here.
The sidecar maintains a TCP connection with the node and communicates using a custom binary protocol built on top of Juliet. The protocol uses a request-response model where 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
- execute transaction requests
- request to submit a transaction for execution
- request to speculatively execute a transaction
Once running, 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.