pactus-grpc

Crates.iopactus-grpc
lib.rspactus-grpc
version1.10.1
created_at2025-10-01 12:57:16.808554+00
updated_at2025-10-30 17:24:17.744408+00
descriptionRust client for interacting with the Pactus blockchain via gRPC
homepagehttps://pactus.org
repositoryhttps://github.com/pactus-project/pactus
max_upload_size
id1862548
size821,422
(pactusci)

documentation

README

pactus-grpc

Rust client for interacting with the Pactus blockchain via gRPC.

Installation

cargo add pactus-grpc

Usage

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(())
}
Commit count: 0

cargo fmt