Skip to content
Roman Milishchuk edited this page Jan 21, 2020 · 2 revisions

JSON-RPC is a remote procedure call protocol encoded in JSON. Basically, we have to specify the next values:

{
    "jsonrpc": "2.0",
    "method":  "function, that will be called remotely",
    "params":  [{params, that will be used for function},
    "id":      1
}

All communication with Ethereum blockchain is accomplished using the next two methods:

Importantly, that all params for Ethereum function should be encoded using Solidity ABI.

For easier communication, we have written a wrapper around JSON-RPC calls in C++. It sends messages using Curl and also blocks program execution for eth_sendTransaction messages until they are approved or denied by miners. RPC class supports functions to get/send data in public functions from MemoryManager. Additionally, it has template function form_json, which will encode most of the calls to Ethereum blockchain. More specifically, it can encode/decode functions calls with next parameters:

  • uint
  • string
  • string[]
  • bytes1
  • bytes1[]
  • stat struct (tuple(uint,uint,uint,uint,uint,uint,uint,uint)
Clone this wiki locally