我正在尝试执行https://github.com/hyperledger/fabric-samples.git中提供的“balance-transfer”结构样本,并且当它执行来自testAPIs.sh的以下代码时,它会获得GRPC最大限制错误。请建议我如何解决它。
`curl -s -X POST \
http://localhost:4000/channels \
-H "authorization: Bearer $ORG1_TOKEN" \
-H "content-type: application/json" \
-d '{
"channelName":"mychannel",
"channelConfigPath":"../artifacts/channel/mychannel.tx"
}'`
[2018-05-11 16:34:15.115] [ERROR] Create-Channel - Error: 8 RESOURCE_EXHAUSTED: Sent message larger than max (2217 vs. 15)
at createStatusError (/home/amandai/blockchain/fabric-samplesV1/fabric-samples-1.1/balance-transfer/node_modules/grpc/src/client.js:64:15)
at ClientDuplexStream._emitStatusIfDone (/home/amandai/blockchain/fabric-samplesV1/fabric-samples-1.1/balance-transfer/node_modules/grpc/src/client.js:270:19)
at ClientDuplexStream._readsDone (/home/amandai/blockchain/fabric-samplesV1/fabric-samples-1.1/balance-transfer/node_modules/grpc/src/client.js:236:8)
at readCallback (/home/amandai/blockchain/fabric-samplesV1/fabric-samples-1.1/balance-transfer/node_modules/grpc/src/client.js:296:12)
(node:16186) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: Failed to initialize the channel: Error: 8 RESOURCE_EXHAUSTED: Sent message larger than max (2217 vs. 15)
在“平衡转移”应用程序的更新版本中,他们已从grpc-max-send-message-length
的Orderer下列出的grpcOptions
中删除了network-config.yaml
之前该值设置为15,导致此问题。
你可以设置:
grpcOptions:
grpc-max-send-message-length: -1
在您的对等或连接客户端上的网络config.yaml中。