fabric-node-sdk 1.2可以与Fabric 1.1网络一起使用吗?

时间:2018-08-03 11:54:12

标签: node.js hyperledger-fabric hyperledger

当我尝试在Fabric 1.1上创建频道时,出现以下错误。是否有将1.2 SDK用于Fabric 1.1网络的解决方法?

 [2018-08-01 11:48:41.498] [DEBUG] Helper - [NetworkConfig101.js]: _addPeersToChannel - peer1.org2.example.com - grpcs://x.x.x.x:8056
    [2018-08-01 11:48:41.498] [DEBUG] Helper - [NetworkConfig101.js]: getOrderer - name orderer.example.com
    [2018-08-01 11:48:41.504] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature:  Signature {
      r: <BN: 18641b0400ca8526210ae69af03db05877e3e6a1109bcbae94b716259a973b11>,
      s: <BN: 6c4d65ef6d4088975f2d145b93c1420d5e15866da96733b213e3d699f0c9e2a9>,
      recoveryParam: 1 }
    [2018-08-01 11:48:41.569] [ERROR] Create-Channel - Error: 8 RESOURCE_EXHAUSTED: Sent message larger than max (2241 vs. 15)
        at createStatusError (D:\dev\hyperledger\fabric-samples-sdk\fabric-sdk-util\node_modules\fabric-client\node_modules\grpc\src\client.js:64:15)
        at ClientDuplexStream._emitStatusIfDone (D:\dev\hyperledger\fabric-samples-sdk\fabric-sdk-util\node_modules\fabric-client\node_modules\grpc\src\client.js:270:19)
        at ClientDuplexStream._readsDone (D:\dev\hyperledger\fabric-samples-sdk\fabric-sdk-util\node_modules\fabric-client\node_modules\grpc\src\client.js:236:8)
        at readCallback (D:\dev\hyperledger\fabric-samples-sdk\fabric-sdk-util\node_modules\fabric-client\node_modules\grpc\src\client.js:296:12)
    (node:1552) UnhandledPromiseRejectionWarning: Error: Failed to initialize the channel: Error: 8 RESOURCE_EXHAUSTED: Sent message larger than max (2241 vs. 15)
        at Object.createChannel (D:\dev\hyperledger\fabric-samples-sdk\fabric-sdk-util\sdk-util\create-channel.js:66:9)
        at <anonymous>
    (node:1552) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
    (node:1552) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

2 个答案:

答案 0 :(得分:1)

只需从network-config.yaml文件中删除以下行。此文件用于加载连接配置。

 grpc-max-send-message-length: 15

答案 1 :(得分:0)

sdk节点从1.1更改为1.2的最关键部分是删除旧的eventHub库,并迁移为使用channelEventHub。

这看起来是一个重大变化,因为:

  • ChannelEventHub绑定到通道和对等方,它使用端口7051,而不是 端口7053了

  • 连接机制有一些小的变化,建议在注册侦听器之前显式调用channelEventHub.connect()