Crates.io | tetsy-jsonrpc-tcp-server |
lib.rs | tetsy-jsonrpc-tcp-server |
version | 15.1.0 |
source | src |
created_at | 2021-03-01 07:46:14.283152 |
updated_at | 2021-03-13 03:34:44.583693 |
description | Tetsy TCP/IP server for JSON-RPC |
homepage | https://core.tetcoin.org |
repository | https://github.com/tetcoin/tetsy-jsonrpc |
max_upload_size | |
id | 362108 |
size | 46,177 |
TCP server for JSON-RPC 2.0.
Cargo.toml
[dependencies]
tetsy-jsonrpc-tcp-server = "14.2"
main.rs
use tetsy_jsonrpc_tcp_server::*;
use tetsy_jsonrpc_tcp_server::tetsy_jsonrpc_core::*;
fn main() {
let mut io = IoHandler::default();
io.add_method("say_hello", |_params| {
Ok(Value::String("hello".to_owned()))
});
let server = ServerBuilder::new(io)
.start(&"0.0.0.0:3030".parse().unwrap())
.expect("Server must start with no issues");
server.wait().unwrap()
}