I have built Business network using HyperLedger composer. Now, I want to use HyperLedger explorer for my solution? I didnt find any help on the same. I have downloaded all the Hyperledger explorer from Git, I am stuck in configuring the Config file? I am not sure, which config file is being referred in the below link? https://github.com/hyperledger/blockchain-explorer/blob/master/README.md
问题:
回答1:
I think that the file structure has been changed recently, but the reference to the config file in the documentation has not changed. I have just tested the latest Hyperledger Explorer with Composer v0.19.9 and the development Fabric provided with the Composer tools. The version number of Hyperledger Explorer in the package.json is 3.2.
The config file that I modified is: blockchain-explorer/app/platform/fabric/config.json
{
"network-config": {
"org1": {
"name": "Org1",
"mspid": "Org1MSP",
"peer1": {
"requests": "grpc://127.0.0.1:7051",
"events": "grpc://127.0.0.1:7053",
"server-hostname": "peer0.org1.example.com"
},
"admin": {
"key": "/home/rob/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
"cert": "/home/rob/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
}
}
},
"channel": "composerchannel",
"orderers":[
{
"mspid": "OrdererMSP",
"server-hostname":"orderer.example.com",
"requests":"grpc://127.0.0.1:7050"
}
],
"keyValueStore": "/tmp/fabric-client-kvs",
"configtxgenToolPath": "fabric-path/fabric-samples/bin",
"eventWaitTime": "30000",
"license": "Apache-2.0",
"version": "1.1"
}
Note in particular that I changed the
- name of the org (
"name": "Org1"
), - I removed the TLS certificate references since the Dev fabric doesn't use TLS,
- I changed the urls to
grpc
instead of grpcs, - I pointed the admin cert and key to my locations.
- the channel name.
Be aware that the default port for the Explorer is port 8080 - the same as Composer Playground, so don't run them at the same time, or change the port number for the Explorer in this file: blockchain-explorer/appconfig.json
Just to reiterate I ran this with the Dev Fabric from Composer installed as per the Composer documentation.
Whilst working with this I did run into a small problem with the sequence of instructions to Build the app, and I have highlighted the extra commands I needed below:
cd blockchain-explorer/app/test
npm install
cd ../
npm install
cd test
npm run test
cd blockchain-explorer
npm install
cd client/
npm install
npm test -- -u --coverage
npm run build