This is a GRPC client package of rebuschain/rebus.core for Rust.
Depended libraries
proto files
- see rebus.core/go.mod at v0.2.3 for listing related packages versions.
- and also cosmos-sdk/go.mod at v0.45.9
- rebus.core/proto/rebus at v0.2.3
- ethermint/proto/ethermint at v0.17.2
- cosmos-sdk/proto at v0.45.9
- ibc-go/proto at v3.2.0
- tendermint/proto/tendermint at v0.34.21
- cosmos/cosmos-proto
- ics23/proofs.proto at v0.7.1
- protobuf/gogo.proto at v1.3.3-alpha.regen.1
- google/api
% find src/proto/cosmos -type f -follow -print | awk '{print "\""$0"\","}'
% find src/proto/ibc -type f -follow -print | awk '{print "\""$0"\","}'
% find src/proto/rebus -type f -follow -print | awk '{print "\""$0"\","}'
% find src/proto/ethermint -type f -follow -print | awk '{print "\""$0"\","}'
Cargo.toml
[dependencies]
rebus-grpc-client = { version = "0.2.3", git = "https://github.com/kumanote/rebus-grpc-client-rs", branch = "main" }
rust files
use rebus_grpc_client::{cosmos, tonic};
Here's a basic example:
use rebus_grpc_client::{cosmos, tonic};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let addr = "http://localhost:9090";
let mut client =
cosmos::base::tendermint::v1beta1::service_client::ServiceClient::connect(addr).await?;
let request = tonic::Request::new(cosmos::base::tendermint::v1beta1::GetLatestBlockRequest {});
let response = client.get_latest_block(request).await?;
let latest_height = response.into_inner().block.unwrap().header.unwrap().height;
let request = tonic::Request::new(cosmos::base::tendermint::v1beta1::GetBlockByHeightRequest {
height: latest_height,
});
let response = client.get_block_by_height(request).await?;
assert_eq!(
latest_height,
response.into_inner().block.unwrap().header.unwrap().height
);
Ok(())
}