简体   繁体   English

Hyperledger Fabric V1.1 / Composer V0.19 - 达到gRPC消息最大限制(4MB)

[英]Hyperledger Fabric V1.1/Composer V0.19 - gRPC message max limit reached (4MB)

Every time I try to execute a transaction or query where the payload is > ~2MB I get the following errors: 每次我尝试执行有效负载> ~2MB的事务或查询时,我都会收到以下错误:

Immediately upon executing the query, from the docker container running the business network application: 执行查询后,立即从运行业务网络应用程序的docker容器中执行以下操作:

[ERROR] lib/handler.js - Chat stream with peer - on error: 
"Error: 8 RESOURCE_EXHAUSTED: Received message larger than max (19090846 vs. 4194304)\n
at createStatusError (/usr/local/src/node_modules/grpc/src/client.js:64:15)\n
at ClientDuplexStream._emitStatusIfDone (/usr/local/src/node_modules/grpc/src/client.js:270:19)\n
at ClientDuplexStream._receiveStatus (/usr/local/src/node_modules/grpc/src/client.js:248:8)\n
at /usr/local/src/node_modules/grpc/src/client.js:804:12"

Then from the application side, when the timeout has been reached: 然后从应用程序端,当达到超时时:

{ Error: 2 UNKNOWN: error executing chaincode: failed to execute transaction: timeout expired while executing transaction
at new createStatusError (C:\Users\jean5\Fabric\Qostodian\qostodian-analyzer\node_modules\grpc\src\client.js:64:15)
at C:\Users\jean5\Fabric\Qostodian\qostodian-analyzer\node_modules\grpc\src\client.js:583:15
code: 2,
metadata: Metadata { _internal_repr: {} },
details: 'error executing chaincode: failed to execute transaction: timeout expired while executing transaction' }

These errors show that the GRPC default limit of 4MB is reached when I try to retrieve ~18.2MB of data from the query (19090846 vs. 4194304). 这些错误表明,当我尝试从查询中检索~18.2MB的数据时,达到了GRPC的4MB默认限制(19090846 vs. 4194304)。

From what I've seen Fabric is hardcoded to support up to 100MB already : 从我看到的Fabric 硬编码已经支持高达100MB

MaxRecvMsgSize = 100 * 1024 * 1024
MaxSendMsgSize = 100 * 1024 * 1024

I've also found a JIRA task ( FAB-5049 ) on hyperledger.org where they face the same issue. 我还在hyperledger.org上找到了一个JIRA任务( FAB-5049 ),他们面临同样的问题。 However, there is no discussion of a potential fix for the 4MB limit. 但是,没有讨论4MB限制的潜在修复。

Question 1: If fabric is hardcoded with 100MB, where is that 4MB limit coming from? 问题1:如果结构硬编码为100MB,那么4MB限制来自哪里?

Question 2: How can I make sure that the GRPC limit is indeed 100MB? 问题2:如何确保GRPC限制确实为100MB?

I would also like to know if its possible to explicitly set the GRPC limit for example in the connection.json or when installing/starting the network using composer CLI. 我还想知道是否可以在connection.json中或使用composer CLI安装/启动网络时显式设置GRPC限制。

GRPC imposes a default limit of 4Mb. GRPC规定默认限制为4Mb。 When a connection over grpc is set up you can specify an alternative limit. 设置grpc上的连接时,您可以指定备用限制。 To do this with Composer 0.19 you need to modify the connection profile which defined the hyperledger fabric you connect to and provide gprcOptions which contains options recognised by the node implementation of grpc. 要使用Composer 0.19执行此操作,您需要修改连接配置文件,该连接配置文件定义了您连接的超级边界结构,并提供gprcOptions ,其中包含gprcOptions节点实现识别的选项。 An example of setting these options on a peer is given here. 这里给出了在对等体上设置这些选项的示例。

"peer0.org1.example.com": {
    "url": "grpcs://peer0.org1.example.com:7051",
    "eventUrl": "grpcs://peer0.org1.example.com:7053"
    "grpcOptions": {
        "ssl-target-name-override": "peer.org1.example.com",
        "grpc.keepalive_time_ms": 600000,
        "grpc.max_send_message_length": 15728640,
        "grpc.max_receive_message_length": 15728640
    },
    "tlsCACerts": {
        "pem": "-----BEGIN CERTIFICATE----- <etc> "
    }
}

you can also set the grpcOptions for an orderer as well in a similar manner. 您也可以以类似的方式为订货人设置grpcOptions。 Note the message lengths are number of bytes, a value of -1 means unlimited. 注意消息长度是字节数,值-1表示无限制。

Unfortunately there is no way to update existing cards in the card store with new profiles at the moment via the cli. 不幸的是,目前没有办法通过cli用新的配置文件更新卡片商店中的现有卡片。 If you are using a file system card store then you can replace the connection.json file manually for your cards. 如果您使用的是文件系统卡存储,则可以手动为您的卡替换connection.json文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM