TCP server for JSON-RPC 2.0.
Cargo.toml
[dependencies]
jsonrpc-tcp-server = { git = "https://github.com/paritytech/jsonrpc" }
main.rs
```rust extern crate jsonrpctcpserver;
use jsonrpctcpserver::; use jsonrpc_tcp_server::jsonrpc_core::;
fn main() { let mut io = IoHandler::default(); io.addmethod("sayhello", |params| { Ok(Value::String("hello".toowned())) });
let server = ServerBuilder::new(io)
.start(&"0.0.0.0:3030".parse().unwrap())
.expect("Server must start with no issues");
server.wait().unwrap()
} ```