Skip to content

Commit

Permalink
Adding tonic with gzip feature
Browse files Browse the repository at this point in the history
  • Loading branch information
godmodegalactus committed Apr 22, 2024
1 parent 58b05ce commit 950559b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion src/yellowstone_grpc_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
}

0 comments on commit 950559b

Please sign in to comment.