tetsy-jsonrpc-tcp-server

Crates.iotetsy-jsonrpc-tcp-server
lib.rstetsy-jsonrpc-tcp-server
version15.1.0
sourcesrc
created_at2021-03-01 07:46:14.283152
updated_at2021-03-13 03:34:44.583693
descriptionTetsy TCP/IP server for JSON-RPC
homepagehttps://core.tetcoin.org
repositoryhttps://github.com/tetcoin/tetsy-jsonrpc
max_upload_size
id362108
size46,177
Marlon Hanks (marlonhanks)

documentation

https://docs.rs/tetsy-jsonrpc-tcp-server/

README

tetsy-jsonrpc-tcp-server

TCP server for JSON-RPC 2.0.

Documentation

Example

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()
}
Commit count: 754

cargo fmt