mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 14:48:08 -05:00
example/rpc: Add unix listeners.
This commit is contained in:
@@ -26,7 +26,8 @@ use darkfi::{
|
||||
};
|
||||
|
||||
async fn realmain(ex: Arc<Executor<'_>>) -> Result<()> {
|
||||
let endpoint = Url::parse("tcp://127.0.0.1:55422").unwrap();
|
||||
//let endpoint = Url::parse("tcp://127.0.0.1:55422").unwrap();
|
||||
let endpoint = Url::parse("unix:///tmp/rpc.sock").unwrap();
|
||||
|
||||
let client = RpcClient::new(endpoint, Some(ex)).await?;
|
||||
|
||||
|
||||
@@ -66,7 +66,8 @@ impl RequestHandler for RpcSrv {
|
||||
|
||||
async fn realmain(ex: Arc<Executor<'_>>) -> Result<()> {
|
||||
let rpcsrv = Arc::new(RpcSrv { stop_sub: smol::channel::unbounded::<()>() });
|
||||
let rpc_listen = Url::parse("tcp://127.0.0.1:55422").unwrap();
|
||||
//let rpc_listen = Url::parse("tcp://127.0.0.1:55422").unwrap();
|
||||
let rpc_listen = Url::parse("unix:///tmp/rpc.sock").unwrap();
|
||||
|
||||
let _ex = ex.clone();
|
||||
ex.spawn(listen_and_serve(rpc_listen, rpcsrv.clone(), _ex)).detach();
|
||||
|
||||
Reference in New Issue
Block a user