Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 2.21 KB

README.md

File metadata and controls

33 lines (22 loc) · 2.21 KB

rpc-sidecar

LOGO

Build Status Crates.io License

Synopsis

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.

Protocol

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

Discovering the JSON RPC API

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}'

License

Licensed under the Apache License Version 2.0.