Failed to connect Hyperledger Explorer to Fabric project

883 Views Asked by At

I have a Fabric project up and running with 7 org/5 channel setup with each org having 2 peers. Everything is up and running. Now i am trying to connect Hyperledger Explorer to view the blockchain data. However there is an issue i am facing in the configuration part.

Steps i performed:

  • Pulled the images and added the following containers in a single docker-compose.yaml file for startup: hyperledger/explorer-db:latest, hyperledger/explorer:latest, prom/prometheus:latest, grafana/grafana:latest
  • Edited the created containers with the respective configurations needed and volume mounts.
    • volumes:
      • ./config.json:/opt/explorer/app/platform/fabric/config.json
      • ./connection-profile:/opt/explorer/app/platform/fabric/connection-profile/
      • ./crypto-config:/tmp/crypto
      • walletstore:/opt/wallet
  • Since its a multi-org setup i edited the config.json files and accordingly pointed them to the respective connection profiles as per the organization setup
  • { "network-configs": { "org1-network": { "name": "Sample-1", "profile": "./connection-profile/org1-network.json" }, and so on for other orgs
  • Edited the prometheus.yml to put in the static configurations static_configs:
    • targets: ['localhost:8443','localhost:8444', and so on for every peer service]
    • targets: ['orderer0-service:8443','orderer1-service:8444', and so on for every orderer service]
  • Edited the peer services in my docker-compose.yaml file to add in the below values on each peer config
    • CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9449 # RESTful API for Hyperledger Explorer
    • CORE_METRICS_PROVIDER=prometheus # Prometheus will pull metrics

Issue: (Now resolved - see below)

enter image description here

It seems that explorer isn't able to find my [email protected]' path in the given location. But i double checked everything and that particular path is present and also accessible. All permissions to that path is also open to avoid any permissioning issue.

Path in question [Full path is provided not the relative path]: /home/auro/Desktop/HLF/fabricapp/crypto-config/peerOrganizations/org1/users/Admin@org1/msp/signcerts/[email protected]

The config files is also setup properly. I am unable to find a way to correct way. Would be really glad if someone can tell me what is going on with this path issue, because i tried everything i think i could but still not able to get it working.

enter image description here

Other details: Using Hypereldger Explorer - v1.1.0 - Pulling the latest docker image Using Hyperledger Fabric - v.1.4.6 - Pulling the specific version from docker hub for this

Update: Okay, i managed to solve this. Apparently the path to be given in the config file isnt that of the local system but of the docker container. I replaced the path with the path to my docker container where the files are placed and it worked. enter image description here

New Problem -1: (Now solved) Now i am getting an error as shown below. Highlighted in yellow enter image description here

I had a look at peer-0-org-1-service node logs when this happened and this is the error it had logged.

2020-07-20 04:38:15.995 UTC [core.comm] ServerHandshake -> ERRO 028 TLS handshake failed with error tls: first record does not look like a TLS handshake server=PeerServer remoteaddress=172.18.0.53:33300

enter image description here

Update: Okay, i managed to solve this too. There were 2 issues. The TLS handshake wasn't happening because the TLS certificate wasn't set to true in the config. The second issue of STREAM removed happened because the url in the config wasnt specified as grpc. Once changes were done, it resolved

New Problem -2: (Current Issue)

It seems that the channel issue is there. Somehow it still shows "not assigned to this channel" and a new error of "Error: 14 UNAVAILABLE: failed to connect to all addresses". This same error happened for all the peers across 7 orgs.

enter image description here

And not to mention suddenly the peers are not able to talk to each other.

Error Received: Could not connect to Endpoint: peer0-org2-service:7051, InternalEndpoint: peer0-org2-service:7051, PKI-ID: , Metadata: : context deadline exceeded

enter image description here

I checked the peer channel connection details and everything seems to be in order. Stuck in this for now. Let me know if anyone has any ideas.

2

There are 2 best solutions below

0
On

As you can see from the edits i got one problem solved before another came along. After banging my head for a lot of times, i removed the entire build, rebuilt it again with my corrections given above and it simply started working.

1
On

You seem to be using old Explorer image. I strongly recommend to use the latest one v1.1.1. Note: There are some updates of settings format in connection profile (e.g. login credential of Explorer). Please refer README-CONFIG for detail.