Adding tonic with gzip feature

This commit is contained in:
godmodegalactus 2024-04-22 18:48:17 +02:00
parent 58b05ce157
commit 950559b5aa
No known key found for this signature in database
GPG Key ID: 22DA4A30887FDA3C
3 changed files with 7 additions and 1 deletions

2
Cargo.lock generated
View File

@ -1264,6 +1264,7 @@ dependencies = [
"solana-logger",
"solana-sdk",
"tokio",
"tonic",
"tonic-health",
"tracing",
"tracing-subscriber",
@ -3628,6 +3629,7 @@ dependencies = [
"axum",
"base64 0.21.7",
"bytes",
"flate2",
"h2",
"http",
"http-body",

View File

@ -31,6 +31,7 @@ bincode = "1.3.3"
csv = "1.3.0"
tonic = { version="0.10.2", features=["gzip"] }
tonic-health = "0.10.2"
[dev-dependencies]

View File

@ -5,6 +5,7 @@ use yellowstone_grpc_proto::geyser::geyser_client::GeyserClient;
use yellowstone_grpc_proto::geyser::SubscribeRequest;
use yellowstone_grpc_proto::prost::bytes::Bytes;
use yellowstone_grpc_proto::tonic;
use tonic::codec::CompressionEncoding;
use yellowstone_grpc_proto::tonic::metadata::errors::InvalidMetadataValue;
use yellowstone_grpc_proto::tonic::metadata::AsciiMetadataValue;
use yellowstone_grpc_proto::tonic::service::Interceptor;
@ -87,7 +88,9 @@ where
let client = GeyserGrpcClient::new(
HealthClient::with_interceptor(channel.clone(), interceptor.clone()),
GeyserClient::with_interceptor(channel, interceptor)
.max_decoding_message_size(GeyserGrpcClient::max_decoding_message_size()),
.max_decoding_message_size(GeyserGrpcClient::max_decoding_message_size())
.accept_compressed(CompressionEncoding::Gzip)
.send_compressed(CompressionEncoding::Gzip),
);
Ok(client)
}