我正在尝试执行"余额转移" https://github.com/hyperledger/fabric-samples.git中提供的结构样本,当它从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)
答案 0 :(得分:2)
在“余额转移”应用程序的更新版本中,他们从network-config.yaml的订购者下方列出的grpc-max-send-message-length
中删除了grpcOptions
之前,该值设置为15,这会导致此问题。
答案 1 :(得分:1)
您可以设置:
grpcOptions:
grpc-max-send-message-length: -1
在对等端或连接客户端上的网络config.yaml中。