Init relayer crate with tonic client code
This commit is contained in:
parent
859323bdfb
commit
e74badc7bb
2 changed files with 23 additions and 0 deletions
10
utils/quartz-relayer/Cargo.toml
Normal file
10
utils/quartz-relayer/Cargo.toml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[package]
|
||||||
|
name = "quartz-relayer"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tonic = "0.11"
|
||||||
|
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
|
||||||
|
|
||||||
|
quartz-proto = { path = "../../utils/quartz-proto" }
|
13
utils/quartz-relayer/src/main.rs
Normal file
13
utils/quartz-relayer/src/main.rs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
use quartz_proto::quartz::{core_client::CoreClient, SessionCreateRequest};
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
let mut client = CoreClient::connect("http://localhost:11090").await?;
|
||||||
|
|
||||||
|
let request = tonic::Request::new(SessionCreateRequest {});
|
||||||
|
|
||||||
|
let response = client.session_create(request).await?;
|
||||||
|
println!("{:?}", response.into_inner());
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
Loading…
Reference in a new issue