Hyperledger Fabric Explorer config.json error

1.9k Views Asked by At

I am trying to run Explorer 3.6 for fabric version 1.2.0.I am using balance-transfer app for testing.My config.json file is as below-

{
  "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/[email protected]/msp/keystore"
          },
          "signedCert": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts"
          }
    },
        "Org2MSP": {
          "mspid": "Org2MSP",
          "adminPrivateKey": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore"
          }
        },
        "OrdererMSP": {
          "mspid": "OrdererMSP",
          "adminPrivateKey": {
            "path":
              "/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/ordererOrganizations/example.com/users/[email protected]/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"
} 

The error I am getting is:- Sync process is started for the network : [network-1] and client : [client-1] <<<<<<<<<<<<<<<<<<<<<<<<<< Synchronizer Error >>>>>>>>>>>>>>>>>>>>> Error : [ 'Failed to connect client peer, please check the configuration and peer status' ] <<<<<<<<<<<<<<<<<<<<<<<<<< Closing client processor >>>>>>>>>>>>>>>>>>>>>


Following is the error log

[2018-09-27 10:58:14.006] [DEBUG] FabricClient - Admin peer Not found for grpcs://localhost:7051

4

There are 4 best solutions below

1
On

Can you try changing your peer "url" and "eventUrl" in the following format:

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

I'm using docker instance to run blockchain explorer and this format works for me.

0
On

You must find ip and port of running peers and orderer and make changes in config.json. You can use docker ps to make sure that containers are running and see the ports related to each container.
Also, take a look at to this link about Explorer. The link shows the steps needed to change config.json and run explorer.

0
On

I changed the sync in the explorerconfig.json under blockchain-explorer/app

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

}

The error is gone.

0
On

In my case I was missing the last line (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

in the corresponding docker-compose.yml which describes the network. Without this line, it seems that peer is only visible inside the org. You need also to ./generate.sh and ./start.sh your network. Hope it helps.