尝试将资源管理器与不同计算机上托管的Hyperledger Fabric网络连接时出现问题

时间:2019-05-28 14:55:24

标签: hyperledger-fabric hyperledger-explorer

我正在为在某些不同的机器(例如IP 12.34.56.78)中运行的结构网络设置资源管理器,当我尝试从资源管理器启动脚本start.sh时遇到了这个错误。 在单个实例上成功连接(一台计算机上的资源管理器和光纤网络),但是在尝试在不同计算机上连接时遇到错误。

这是我要更改参数的config.json文件。

{
  "network-configs": {
    "network-1": {
      "version": "1.0",
      "clients": {
        "client-1": {
          "tlsEnable": true,
          "organization": "Org1MSP",
          "channel": "mychannel",
          "credentialStore": {
            "path": "./tmp/credentialStore_Org1/credential",
            "cryptoStore": {
              "path": "./tmp/credentialStore_Org1/crypto"
            }
          }
        }
      },
      "channels": {
        "mychannel": {
          "peers": {
            "peer0.org1.example.com": {}
          },
          "connection": {
            "timeout": {
              "peer": {
                "endorser": "6000",
                "eventHub": "6000",
                "eventReg": "6000"
              }
            }
          }
        }
      },
      "organizations": {
        "Org1MSP": {
          "mspid": "Org1MSP",
          "fullpath": false,
          "adminPrivateKey": {
            "path": "/home/dinesh/HyperExplorer/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore"
          },
          "signedCert": {
            "path": "/home/dinesh/HyperExplorer/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
          }
        },
        "Org2MSP": {
          "mspid": "Org2MSP",
          "adminPrivateKey": {
            "path": "/home/dinesh/HyperExplorer/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore"
          }
        },
        "OrdererMSP": {
          "mspid": "OrdererMSP",
          "adminPrivateKey": {
            "path": "/home/dinesh/HyperExplorer/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/keystore"
          }
        }
      },
      "peers": {
        "peer0.org1.example.com": {
          "tlsCACerts": {
            "path": "/home/dinesh/HyperExplorer/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
          },
          "url": "grpcs://12.34.56.78:7051",
          "eventUrl": "grpcs://l12.34.56.78:7053",
          "grpcOptions": {
            "ssl-target-name-override": "peer0.org1.example.com"
          }
        },
        "peer1.org1.example.com": {
          "url": "grpcs://12.34.56.78:8051"
        },
        "peer0.org2.example.com": {
          "url": "grpcs://12.34.56.78:9051"
        },
        "peer1.org2.example.com": {
          "url": "grpcs://12.34.56.78:10051"
        }
      },
      "orderers": {
        "orderer.example.com": {
          "url": "grpcs://12.34.56.78:7050"
        }
      }
    },
    "network-2": {}
  },
  "configtxgenToolPath": "/home/dinesh/HyperExplorer/fabric-samples/bin",
  "license": "Apache-2.0"
}


错误

  

(节点:16024)弃用警告:grpc.load:使用@ grpc / proto-loader   改为使用grpc.loadPackageDefinition模块   2019-05-28T13:26:18.102Z-错误:[Remote.js]:错误:未能   在截止日期URL之前连接:grpcs:// localhost:7050   <<<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Explorer >>>>>>>>>>>>>>>>>>>>>>> {   错误:在截止日期之前无法连接   网址:grpcs:// localhost:7050       在checkState(/home/dinesh/Music/blockchain-explorer-master/node_modules/grpc/src/client.js:720:16)   connectFailed:true}

3 个答案:

答案 0 :(得分:0)

您是否在SDK中设置了发现选项?

在此链接到HL NodeJS Fabric SDK官方文档中的发现选项。

https://fabric-sdk-node.github.io/release-1.4/module-fabric-network.Gateway.html#~DiscoveryOptions

答案 1 :(得分:0)

您可能需要在结构网络上添加资源管理器计算机的IP地址,还将许可文件从结构网络计算机复制到资源管理器计算机,类似于sftp协议

答案 2 :(得分:0)

您没有在 start.sh 文件中将环境变量 DISCOVERY_AS_LOCALHOST 设置为 false 。那就是您看到的原因:localhost。

如果同步进程从不同的位置运行,请确保检查explorerconfig.json

 "sync": {
    "type": "host"
 }