ulu
ulu

Reputation: 6092

Can't start Hyperledger Explorer

I have Hyperledger Fabric running on an Ubuntu instance. I created it using the Composer installation scripts. I can ping it and see it working in the Playground.

Now, I'm trying to launch Hyperledger Explorer, but it fails silently. The log says, Failed to find a peer matching the url.

Here's what I have in my connection.json, created by Composer: { "name": "hlfv1", "x-type": "hlfv1", "x-commitTimeout": 300, "version": "1.0.0", "client": { "organization": "Org1", "connection": { "timeout": { "peer": { "endorser": "300", "eventHub": "300", "eventReg": "300" }, "orderer": "300" } } }, "channels": { "composerchannel": { "orderers": ["orderer.example.com"], "peers": { "peer0.org1.example.com": {} } } }, "organizations": { "Org1": { "mspid": "Org1MSP", "peers": ["peer0.org1.example.com"], "certificateAuthorities": ["ca.org1.example.com"] } }, "orderers": { "orderer.example.com": { "url": "grpc://localhost:7050" } }, "peers": { "peer0.org1.example.com": { "url": "grpc://localhost:7051", "eventUrl": "grpc://localhost:7053" } }, "certificateAuthorities": { "ca.org1.example.com": { "url": "http://localhost:7054", "caName": "ca.org1.example.com" } } }

Here's what I wrote in my config.json for the Explorer. As suggested, I replaced all grpcs with grpc: { "network-config": { "Org1": { "name": "Org1", "mspid": "Org1MSP", "peer1": { "requests": "grpc://localhost:7051", "events": "grpc://localhost:7053", "server-hostname": "peer0.org1.example.com" }, "admin": { "key": "/home/ubuntu/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore", "cert": "/home/ubuntu/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts" } } }, "host": "localhost", "port": "8080", "channel": "composerchannel", "keyValueStore": "/tmp/fabric-client-kvs", "eventWaitTime": "30000", "users":[ { "username":"admin", "secret":"adminpw" } ], "pg": { "host": "127.0.0.1", "port": "5432", "database": "fabricexplorer", "username": "hppoc", "passwd": "password" }, "license": "Apache-2.0" }

And here's the full error log:

postgres://hppoc:password@127.0.0.1:5432/fabricexplorer
Please open web browser to access :http://localhost:8080/
[31m[2018-05-16 12:08:39.563] [ERROR] FabricClientProxy - [39mFailed to find a peer matching the url grpc://localhost:7051
[31m[2018-05-16 12:08:39.564] [ERROR] FabricClientProxy - [39mFailed to find a peer matching the url grpc://localhost:7051
/home/ubuntu/blockchain-explorer/app/FabricClientProxy.js:37
        if (this.channels[org][this.channelName] == undefined)
                              ^

TypeError: Cannot read property 'composerchannel' of undefined
    at FabricClientProxy.getChannelForOrg (/home/ubuntu/blockchain-explorer/app/FabricClientProxy.js:37:25)
    at getChainInfo (/home/ubuntu/blockchain-explorer/app/query.js:91:34)
    at Object.getChannelHeight (/home/ubuntu/blockchain-explorer/app/query.js:190:9)
    at getMaxBlockNum (/home/ubuntu/blockchain-explorer/app/service/blockscanner.js:152:18)
    at Object.syncBlock (/home/ubuntu/blockchain-explorer/app/service/blockscanner.js:40:9)
    at Timeout._onTimeout (/home/ubuntu/blockchain-explorer/app/listener/blocklistener.js:46:22)
    at ontimeout (timers.js:482:11)
    at tryOnTimeout (timers.js:317:5)
    at Timer.listOnTimeout (timers.js:277:5)

Upvotes: 0

Views: 2661

Answers (1)

Paul O'Mahony
Paul O'Mahony

Reputation: 6740

the issue is in config.json - the correct config is (under "network-config" it is lowercase 'org1')

{
    "network-config": {
        "org1": {
            "name": "Org1",
            "mspid": "Org1MSP",
            "peer1": {
                "requests": "grpc://localhost:7051",
                "events": "grpc://localhost:7053",
                "server-hostname": "peer0.org1.example.com"
            },
            "admin": {
                "key": "/home/ubuntu/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
                "cert": "/home/ubuntu/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
            }
        }
    },
    "host": "localhost",
    "port": "8080",
    "channel": "composerchannel",
    "keyValueStore": "/tmp/fabric-client-kvs",
    "eventWaitTime": "30000",
    "users":[
        {
           "username":"admin",
           "secret":"adminpw"
        }
     ],
    "pg": {
        "host": "127.0.0.1",
        "port": "5432",
        "database": "fabricexplorer",
        "username": "hppoc",
        "passwd": "password"
    },
    "license": "Apache-2.0"
}

Upvotes: 1

Related Questions