1

我正在为在某些不同机器(比如 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 Error >>>>>>>>>>> >>>>>>>>>> { 错误:在截止日期前连接失败 URL:grpcs://localhost:7050 at checkState (/home/dinesh/Music/blockchain-explorer-master/node_modules/grpc/src/ client.js:720:16) connectFailed: true }

4

3 回答 3

0

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

这里是官方 HL NodeJS Fabric SDK 文档中发现选项的链接。

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

于 2019-05-29T07:07:43.863 回答
0

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

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

 "sync": {
    "type": "host"
 }
于 2019-10-03T15:25:27.147 回答
0

您可能需要在fabric网络上添加explorer机器的IP地址,同时将fabric网络机器的权限文件复制到explorer机器,类似于sftp协议

于 2019-06-21T17:54:49.163 回答