4

我正在尝试为结构版本 1.2.0 运行 Explorer 3.6。我正在使用余额转移应用程序进行测试。我的 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

4

4 回答 4

1

您可以尝试以以下格式更改您的对等“url”和“eventUrl”:

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

我正在使用 docker 实例来运行区块链资源管理器,这种格式对我有用。

于 2018-09-27T06:36:00.817 回答
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 您的网络。希望能帮助到你。

于 2018-10-28T16:22:47.167 回答
0

您必须找到正在运行的 peers 和 orderer 的 ip 和端口,并在 config.json 中进行更改。您可以使用docker ps它来确保容器正在运行并查看与每个容器相关的端口。
另外,请查看有关资源管理器的此链接。该链接显示了更改 config.json 和运行资源管理器所需的步骤。

于 2018-10-16T12:31:08.087 回答
0

explorerconfig.json我在下面更改了同步blockchain-explorer/app

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

}

错误消失了。

于 2018-10-17T19:50:49.997 回答