超级账本 Fabric Explorer 配置文件 config.json 错误

4

我正在尝试运行适用于版本1.2.0的Fabric Explorer 3.6。我正在使用balance-transfer应用程序进行测试。我的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":{},
        "peer1.org1.example.com": {},
        "peer0.org2.example.com":{},
        "peer1.org2.example.com": {}
    },
          "connection": {
            "timeout": {
              "peer": {
                "endorser": "6000",
                "eventHub": "6000",
                "eventReg": "6000"
              }
            }
          }
        }
      },
      "organizations": {
        "Org1MSP": {
          "mspid": "Org1MSP",
          "fullpath": false,
          "adminPrivateKey": {
            "path":
              "/home/ak/fabric-samples/balance-trasnfer/artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore"
          },
          "signedCert": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
          }
    },
        "Org2MSP": {
          "mspid": "Org2MSP",
          "adminPrivateKey": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore"
          }
        },
        "OrdererMSP": {
          "mspid": "OrdererMSP",
          "adminPrivateKey": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/keystore"
          }
        }
      },
      "peers": {
        "peer0.org1.example.com": {
          "tlsCACerts": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
          },
          "url": "grpcs://localhost:7051",
          "eventUrl": "grpcs://localhost:7053",
          "grpcOptions": {
            "ssl-target-name-override": "peer0.org1.example.com"
          }
        },
        "peer1.org1.example.com": {
          "url": "grpcs://localhost:7056",
        "tlsCACerts": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
          },
          "eventUrl": "grpcs://localhost:7053",
          "grpcOptions": {
            "ssl-target-name-override": "peer1.org1.example.com"
          }
        },
        "peer0.org2.example.com": {
          "url": "grpcs://localhost:9051",
    "tlsCACerts": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
          },
          "eventUrl": "grpcs://localhost:7053",
          "grpcOptions": {
            "ssl-target-name-override": "peer0.org2.example.com"
          }
        },
        "peer1.org2.example.com": {
          "url": "grpcs://localhost:8056",
    "tlsCACerts": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt"
          },
          "eventUrl": "grpcs://localhost:7053",
          "grpcOptions": {
            "ssl-target-name-override": "peer1.org2.example.com"
          }
        }
      },
      "orderers": {
        "orderer.example.com": {
          "url": "grpcs://localhost:7050",
    "tls_cacerts":"/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
        }
      }
    }
  },
  "configtxgenToolPath": "/home/ak/fabric-samples/bin",
  "license": "Apache-2.0"
} 

我收到的错误是: 正在为网络[network-1]和客户端[client-1]启动同步进程 <<<<<<<同步器错误>>>>>>>> 错误:['连接客户端节点失败,请检查配置和节点状态'] <<<<<<<关闭客户端处理器>>>>>>>> 以下是错误日志
[2018-09-27 10:58:14.006] [DEBUG] FabricClient - 未找到grpcs://localhost:7051的管理员节点

我也遇到了同样的问题。我正在处理中。 - Manoj Kumar
遇到相同问题。 - A.K.
4个回答

1

您能否尝试将对等方的"url"和"eventUrl"更改为以下格式:

"url": "grpcs://peer0.org1.example.com:7051"

我正在使用Docker实例来运行区块链浏览器,这种格式对我很有效。

尝试了您的建议,但是没有起作用。在将localhost更改为peer0.org1.example.com后,连接被拒绝。 - Akanksha Tiwari

0

我在 blockchain-explorer/app 下的 explorerconfig.json 中更改了同步设置。

"sync": {
"type": "host",
"platform": "fabric",
"blocksSyncTime": "3"

}

错误已经消失。


0
在我的情况下,我缺少了最后一行(CORE_PEER_GOSSIP_EXTERNALENDPOINT)。
peer0.org1.example.com:
container_name: peer0.org1.example.com
image: hyperledger/fabric-peer
environment:
  - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  - CORE_PEER_ID=peer0.org1.example.com
  - CORE_LOGGING_PEER=info
  - CORE_CHAINCODE_LOGGING_LEVEL=info
  - CORE_PEER_LOCALMSPID=Org1MSP
  - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
  - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
  - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051

在相应的docker-compose.yml文件中描述网络。 如果没有这行,似乎peer只能在组织内部可见。 您还需要运行./generate.sh和./start.sh来启动您的网络。 希望对您有所帮助。

0

您需要找到正在运行的同行和排序器的IP和端口,并在config.json中进行更改。 您可以使用docker ps确保容器正在运行,并查看与每个容器相关的端口。
此外,还要查看this link关于Explorer的信息。该链接显示了更改config.json并运行explorer所需的步骤。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接