http.rs 590 B
Newer Older
Pierre Krieger's avatar
Pierre Krieger committed
use futures::prelude::*;

jsonrpsee::rpc_api! {
    Health {
        /// Test
        fn system_name() -> String;
    }
}

Pierre Krieger's avatar
Pierre Krieger committed
fn main() {
    /*let server1 = jsonrpsee::server::HttpServer::bind("0.0.0.0:8000");
Pierre Krieger's avatar
Pierre Krieger committed
    let server2 = jsonrpsee::server::HttpServer::bind("0.0.0.0:8080");
    let server = jsonrpsee::server::join(server1, server2);

Pierre Krieger's avatar
Pierre Krieger committed
    futures::executor::block_on(jsonrpsee::run(&server, |_, _| {
        panic!();       // TODO: remove
        future::ready(jsonrpsee::JsonValue::Null)
    }));*/

    let v = futures::executor::block_on(system_name());
    println!("{:?}", v);
Pierre Krieger's avatar
Pierre Krieger committed
}