11# rofl-client/rs/README.md
2- Rust client for the ROFL appd over a Unix domain socket .
2+ Rust client for the ROFL appd over UNIX domain sockets and plain HTTP .
33
44- Default socket: ` /run/rofl-appd.sock `
5+ - HTTP constructor: ` RoflClient::with_url("http://localhost:8549") `
56- Endpoints used:
67 - ` GET /rofl/v1/app/id `
78 - ` POST /rofl/v1/keys/generate `
89 - ` POST /rofl/v1/tx/sign-submit `
10+ - ` GET /rofl/v1/metadata `
11+ - ` POST /rofl/v1/metadata `
12+ - ` POST /rofl/v1/query `
913
1014Quickstart:
1115
@@ -14,7 +18,11 @@ use oasis_rofl_client::{KeyKind, RoflClient};
1418
1519#[tokio:: main]
1620async fn main () -> Result <(), Box <dyn std :: error :: Error >> {
17- let client = RoflClient :: new ()? ;
21+ let client = match std :: env :: var (" ROFL_CLIENT_URL" ) {
22+ Ok (url ) => RoflClient :: with_url (& url )? ,
23+ Err (_ ) => RoflClient :: new ()? ,
24+ };
25+
1826 println! (" app id: {}" , client . get_app_id (). await ? );
1927 println! (
2028 " key: {}" ,
@@ -25,5 +33,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
2533```
2634
2735Notes:
28- - Requires Unix socks. Windows is not supported unless using WSL.
29- - Methods are ` async ` and internally offload blocking UDS I/O via ` tokio::task::spawn_blocking ` .
36+ - ` RoflClient::new() ` and ` RoflClient::with_socket_path() ` keep using UNIX sockets.
37+ - ` RoflClient::with_url() ` accepts ` http://... ` URLs and custom socket paths; ` https://... ` is rejected explicitly.
38+ - Methods are ` async ` and internally offload blocking transport I/O via ` tokio::task::spawn_blocking ` .
0 commit comments