0

我已经修改了 fabcar 示例,以便在结构版本 1.4.4 中保存我自己的来自外部 API 的数据。现在我已将结构升级到 2.2,当我尝试提交交易时,我遇到了以下错误。

 Error: No discovery results found
    at DiscoveryService.getDiscoveryResults (/var/www/html/fabric-samples/fabcar/javascript/node_modules/fabric-common/lib/DiscoveryService.js:359:10)
    at DiscoveryHandler.endorse (/var/www/html/fabric-samples/fabcar/javascript/node_modules/fabric-common/lib/DiscoveryHandler.js:156:40)
    at Endorsement.send (/var/www/html/fabric-samples/fabcar/javascript/node_modules/fabric-common/lib/Proposal.js:341:29)
    at Transaction.submit (/var/www/html/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/transaction.js:205:52)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
2020-07-30T12:48:56.927Z - error: [DiscoveryHandler]: _build_endorse_group_member >> G0:0 - error on endorsement to peer0.org2.example.com:9051 error Error: Broadcast Client peer0.org2.example.com:9051 grpcs://localhost:9051 is not connected
2020-07-30T12:48:56.927Z - error: [DiscoveryHandler]: _build_endorse_group_member >> G1:1 - error on endorsement to peer0.org1.example.com:7051 error Error: Broadcast Client peer0.org1.example.com:7051 grpcs://localhost:7051 is not connected
error inside await { TypeError: Cannot read property 'name' of undefined
    at newEndorsementError (/var/www/html/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/transaction.js:33:39)
    at getResponsePayload (/var/www/html/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/transaction.js:21:23)
    at Transaction.submit (/var/www/html/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/transaction.js:207:28)
    at <anonymous>
  responses: [],
  errors: 
   [ { Error: Endorsement has failed
    at DiscoveryHandler._endorse (/var/www/html/fabric-samples/fabcar/javascript/node_modules/fabric-common/lib/DiscoveryHandler.js:237:18)
    at <anonymous> endorsements: [Array] } ] }

我已经使用 docker ps -a |检查了 peer0 中正在运行的 docker 。grep 对等体0

0f038564e3ff        dev-peer0.org2.example.com-fabcar_1-393aaaa35016a08b9cb740a31ae2ea89aaf10d0bfdf65c817abfe904623681de-c46c7e2a1710c4aa83ac0326124e387b4a057046f3de852bad35bb44852aaec7   "docker-entrypoint.s…&quot;   About an hour ago   Up About an hour                                                 dev-peer0.org2.example.com-fabcar_1-393aaaa35016a08b9cb740a31ae2ea89aaf10d0bfdf65c817abfe904623681de
bf7a3565727c        dev-peer0.org1.example.com-fabcar_1-393aaaa35016a08b9cb740a31ae2ea89aaf10d0bfdf65c817abfe904623681de-fd6a5aa3b9b251ac2e8768f732744a944d9b52c15a7d40a1ed44d327aecaa399   "docker-entrypoint.s…&quot;   About an hour ago   Up About an hour                                                 dev-peer0.org1.example.com-fabcar_1-393aaaa35016a08b9cb740a31ae2ea89aaf10d0bfdf65c817abfe904623681de
748c5089c0c5        hyperledger/fabric-peer:latest                                                                                                                                          "peer node start"        About an hour ago   Up About an hour    7051/tcp, 0.0.0.0:9051->9051/tcp             peer0.org2.example.com
2bf221d99453        hyperledger/fabric-peer:latest 

这是 Org1 的连接配置文件

name: test-network-org1
version: 1.0.0
client:
  organization: Org1
  connection:
    timeout:
      peer:
        endorser: '300'
organizations:
  Org1:
    mspid: Org1MSP
    peers:
    - peer0.org1.example.com
    certificateAuthorities:
    - ca.org1.example.com
peers:
  peer0.org1.example.com:
    url: grpcs://localhost:7051
    tlsCACerts:
      pem: |
          -----BEGIN CERTIFICATE-----
         
          -----END CERTIFICATE-----
          
    grpcOptions:
      ssl-target-name-override: peer0.org1.example.com
      hostnameOverride: peer0.org1.example.com
certificateAuthorities:
  ca.org1.example.com:
    url: https://localhost:7054
    caName: ca-org1
    tlsCACerts:
      pem: 
        - |
          -----BEGIN CERTIFICATE-----
       
          -----END CERTIFICATE-----
          
    httpOptions:
      verify: false

我不知道为什么前两个容器没有监听任何端口。还检查了每个容器的日志,也没有发现任何错误。

如何解决此错误?

4

0 回答 0