Init relayer crate with tonic client code

This commit is contained in:
hu55a1n1 2024-02-20 08:42:04 -08:00
parent 859323bdfb
commit e74badc7bb
2 changed files with 23 additions and 0 deletions

View 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" }

View 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(())
}