| Crates.io | pactus-grpc |
| lib.rs | pactus-grpc |
| version | 1.10.1 |
| created_at | 2025-10-01 12:57:16.808554+00 |
| updated_at | 2025-10-30 17:24:17.744408+00 |
| description | Rust client for interacting with the Pactus blockchain via gRPC |
| homepage | https://pactus.org |
| repository | https://github.com/pactus-project/pactus |
| max_upload_size | |
| id | 1862548 |
| size | 821,422 |
Rust client for interacting with the Pactus blockchain via gRPC.
cargo add pactus-grpc
use pactus_grpc::{blockchain_client::BlockchainClient, GetBlockchainInfoRequest};
use tonic::transport::Channel;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("http://127.0.0.1:50051")
.connect()
.await?;
let mut client = BlockchainClient::new(channel);
let request = tonic::Request::new(GetBlockchainInfoRequest {});
let response = client.get_blockchain_info(request).await?;
let info = response.into_inner();
println!("get_blockchain_info Response: {:?}", info);
Ok(())
}