From 5f1d859c0a04e540679719717bf5b398ea1e9346 Mon Sep 17 00:00:00 2001 From: Vincent Woo Date: Wed, 26 Dec 2018 14:02:29 -0800 Subject: [PATCH] Show in gRPC Ruby doc how to avoid GRPC::ResourceExhausted exceptions Otherwise mainnet DescribeGraph calls will fail --- docs/grpc/ruby.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/grpc/ruby.md b/docs/grpc/ruby.md index 5725707a..867d2ce7 100644 --- a/docs/grpc/ruby.md +++ b/docs/grpc/ruby.md @@ -171,3 +171,15 @@ stub = Lnrpc::Lightning::Stub.new( # Now we don't need to pass the metadata on a request level p stub.get_info(Lnrpc::GetInfoRequest.new) ``` + +#### Receive Large Responses + +A GRPC::ResourceExhausted exception is raised when a server response is too large. In particular, this will happen with mainnet DescribeGraph calls. The solution is to raise the default limits by including a channel_args hash when creating our stub. + +```ruby +stub = Lnrpc::Lightning::Stub.new( + 'localhost:10009', + credentials, + channel_args: {"grpc.max_receive_message_length" => 1024 * 1024 * 50} +) +``` \ No newline at end of file