Crates.io | avalanche-proto |
lib.rs | avalanche-proto |
version | 0.19.0 |
source | src |
created_at | 2022-04-29 00:55:10.737826 |
updated_at | 2022-11-06 22:56:51.215004 |
description | Protobuf generated client and server resources for Avalanche gRPC in rust |
homepage | https://avax.network |
repository | https://github.com/ava-labs/avalanche-rust/tree/main/crates/avalanche-proto |
max_upload_size | |
id | 577077 |
size | 1,566,136 |
https://crates.io/crates/avalanche-proto
avalanche-proto
Protobuf generated client and server resources for Avalanche gRPC in rust. The generated stubs use the upstream avalanchego/proto definitions as the source of truth and versioning will align with avalanchego releases.
Support for avalanchego protocol version 15+.
The release version will align with the protocol version for avalanchego. In our example linked above avalanchego is currently on protocol version 19. This aligns with the minor version of the avalanche-proto release. Patches to minor releases could include improvements or bug fixes.
avalanche-proto = { version = "0.19", features = [] } // supports avalanchego protocol version 19
use avalanche_proto::{
http::{
http_server::Http,
HttpRequest, HandleSimpleHttpResponse, HandleSimpleHttpRequest
},
google::protobuf::Empty,
};
use avalanche_proto::grpcutil;
grpcutil::default_server()
.add_service(VmServer::new(vm))
.serve_with_incoming(TcpListenerStream::new(listener))
.await
.map_err(|e| {
Error::new(
ErrorKind::Other,
format!("failed to serve vm service: {}", e),
)
})