I am running Hyperledger fabric 2.0 Blockchain using script files to create the channel, Orderer and peers. I am using fabric-gateway-java:2.1.1 as the Java SDK and I am using a connection profile to connect to the Blockchain from the SDK, see below:
public static Gateway connect() throws Exception{
// Load a file system based wallet for managing identities.
Path walletPath = Paths.get("wallet");
Wallet wallet = Wallets.newFileSystemWallet(walletPath);
// load a CCP
Path networkConfigPath = Paths.get("..", "..", "TestBlockchain", "organizations",
"peerOrganizations", "org1.test.com", "connection-org1.yaml");
Gateway.Builder builder = Gateway.createBuilder();
builder.identity(wallet, "appUser").networkConfig(networkConfigPath).discovery(true);
return builder.connect();
};
My connection profile looks like this: Note: I have removed the certificates for this question
name: TestBlockchain-org1
version: 1.0.0
channels: testchannel
client:
organization: Org1
connection:
timeout:
peer:
endorser: '300'
organizations:
Org1:
mspid: Org1MSP
peers:
- peer0.org1.test.com
certificateAuthorities:
- ca.org1.test.com
peers:
peer0.org1.test.com:
url: grpcs://localhost:7051
tlsCACerts:
pem: |
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
grpcOptions:
ssl-target-name-override: peer0.org1.test.com
hostnameOverride: peer0.org1.test.com
grpc.max_send_message_length: 9000000
grpc.max_receive_message_length: 9000000
peer1.org1.test.com:
url: grpcs://localhost:7051
tlsCACerts:
pem: |
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
grpcOptions:
ssl-target-name-override: peer1.org1.test.com
hostnameOverride: peer1.org1.test.com
grpc.max_send_message_length: 9000000
grpc.max_receive_message_length: 9000000
certificateAuthorities:
ca.org1.test.com:
url: https://localhost:7054
caName: ca-org1
tlsCACerts:
pem:
- |
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
httpOptions:
verify: false
When I set the grpc.max_receive_message_length in the connection profile it doesn't seem to work when trying to receive messages from the Blockchain that are larger than 4GB
The error I keep getting is RESOURCE EXHAUSTED: Compressed gRPC message exceeds maximum size 4194304 4GB.
Question: Is there another way to increase this limit for the grpc in the connection profile or maybe the java code itself?
I have tried searching on the internet for a solution and there doesnt seem to be so hopefully someone can come to my rescue and help. Thanks in advance :)