jsonrpc-stdio-server

STDIN/STDOUT server for JSON-RPC 2.0. Takes one request per line and outputs each response on a new line.

Documentation

Example

Cargo.toml

[dependencies] jsonrpc-stdio-server = { git = "https://github.com/paritytech/jsonrpc" }

main.rs

```rust extern crate jsonrpcstdioserver;

use jsonrpcstdioserver::server; use jsonrpcstdioserver::jsonrpc_core::*;

fn main() { let mut io = IoHandler::default(); io.addmethod("sayhello", |params| { Ok(Value::String("hello".toowned())) });

ServerBuilder::new(io).build();

} ```