January 2019
Intermediate to advanced
520 pages
14h 32m
English
First, we need to import the necessary dependencies:
failure = "0.1"JSON-RPC = { git = "https://github.com/apoelstra/rust-JSON-RPC" }jsonrpc-http-server = { git = "https://github.com/paritytech/JSON-RPC" }log = "0.4"env_logger = "0.6"serde = "1.0"serde_derive = "1.0"
Most likely, you are familiar with most crates except jsonrpc and json-rpc-server. The first is a JSON-RPC client that's based on the hyper crate. The second also uses the hyper crate and provides server functionality of JSON-RPC.
Let's import the necessary types and talk a little about them:
use failure::Error;use JSON-RPC::client::Client;use JSON-RPC::error::Error as ClientError;use JSON-RPC_http_server::ServerBuilder;use JSON-RPC_http_server::JSON-RPC_core::{IoHandler, ...Read now
Unlock full access