Search code examples
hyperledger-fabrichyperledgerhyperledger-explorer

Hyperledger explorer docker setup is not working with the Hyperledger fabric


I am trying to setup the Hyperledger Explorer to work with my fabric network. I managed to bring up the explorer without using docker, but when I try to bring up the explorer in docker using docker-compose. I am facing below error in explorer.mynetwork.com container. I have provided correct value for CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051 in the peer container configuration. I followed https://github.com/hyperledger/blockchain-explorer documentation for the docker setup. Please let me know if I missed any configuration.

2019-10-03T14:18:40.610Z - error: [Channel.js]: Channel:mychannel received discovery error:failed constructing descriptor for chaincodes:<name:"mycc" >
2019-10-03T14:18:40.616Z - error: [Channel.js]: Channel:mychannel received discovery error:failed constructing descriptor for chaincodes:<name:"mycc1" >
initializeChannelFromDiscover  mychannel
2019-10-03T14:18:40.638Z - error: [Channel.js]: Channel:mychannel received discovery error:failed constructing descriptor for chaincodes:<name:"mycc" >
2019-10-03T14:18:40.644Z - error: [Channel.js]: Channel:mychannel received discovery error:failed constructing descriptor for chaincodes:<name:"mycc1" >
 FabricClient.discover_results  endpoint  { host: 'orderer.example.com', port: 7050 }
initializeChannelFromDiscover.discoveryProtocol  grpcs  requesturl  grpcs://orderer.example.com:7050.

Solution

  • First of all, I recommend trying to use explorer docker images with fabric-samples/first-network.

    # After bringing up fabric-samples/first-network
    
    # Copy artifacts into the path which is mounted on explorer container
    $ cp -a /some/where/fabric-samples/first-network/crypto-config/* examples/net1/crypto/
    
    # Edit connection profile to change secret key file name
    $ vi examples/net1/connection-profile/first-network.json
    $ git diff examples/
    diff --git a/examples/net1/connection-profile/first-network.json b/examples/net1/connection-profile/first-network.json
    index 45fff11..6f790b1 100644
    --- a/examples/net1/connection-profile/first-network.json
    +++ b/examples/net1/connection-profile/first-network.json
    @@ -37,7 +37,7 @@
                            "mspid": "Org1MSP",
                            "fullpath": true,
                            "adminPrivateKey": {
    -                               "path": "/tmp/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/d30992c2b7799bc5c65bf6e4839369c7dd3edf0b786eecd4a9d3a3b207d8863f_sk"
    +                               "path": "/tmp/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/75e93bca73505a8485a50aeec4341b0ea52f1a0169a46fba6f20091e60f5f4d3_sk"
                            },
                            "signedCert": {
                                    "path": "/tmp/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem"
    
    # Pull the latest container images (v0.3.9.5)
    $ docker pull hyperledger/explorer
    $ docker pull hyperledger/explorer-db
    
    # Make sure the persistant volumes removed
    $ docker-compose down -v
    
    # Bring up containers
    $ docker-compose up -d explorerdb.mynetwork.com 
    $ docker-compose up -d explorer.mynetwork.com 
    
    # Access http://localhost:8090
    

    After making sure explorer is working fine in this environment, please\ modify configuration (connection profile) to align to your own fabric network.