tetsy-jsonrpc-ws-server

Crates.iotetsy-jsonrpc-ws-server
lib.rstetsy-jsonrpc-ws-server
version15.1.0
sourcesrc
created_at2021-03-01 07:49:43.081482
updated_at2021-03-13 03:42:04.777398
descriptionTetsy WebSockets server for JSON-RPC
homepagehttps://core.tetcoin.org
repositoryhttps://github.com/tetcoin/tetsy-jsonrpc
max_upload_size
id362109
size59,645
Marlon Hanks (marlonhanks)

documentation

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

README

tetsy-jsonrpc-ws-server

WebSockets server for JSON-RPC 2.0.

Documentation

Example

Cargo.toml

[dependencies]
tetsy-jsonrpc-ws-server = "14.2"

main.rs

use tetsy_jsonrpc_ws_server::*;
use tetsy_jsonrpc_ws_server::tetsy_jsonrpc_core::*;

fn main() {
	let mut io = IoHandler::new();
	io.add_method("say_hello", |_params| {
		Ok(Value::String("hello".into()))
	});

	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