How to: Hyperledger Explorer

Hyperledger Explorer has some requisites (like Postgres) you need to meet in order to get it to work.

Preparations

Important: Make sure you have all prerequisites installed following the instructions from https://github.com/hyperledger/blockchain-explorer

  1. Clone https://github.com/hyperledger/blockchain-explorer.git
    1. Postgres can be troublesome in Mac - this article makes it easier: https://medium.com/@Umesh_Kafle/postgresql-and-postgis-installation-in-mac-os-87fa98a6814d
  2. Put special care to Database Setup and Build Hyperledger Explorer.
  3. Execute script to create the DB: cd app/persistence/fabric/postgreSQL/db/ && ./createdb.sh

On Hurley

  1. Create the network with: hurl new -o 3 -c 2 -u 2
  2. Hurley will generate files in ~/hyperledger-fabric-network/

Configuration for Hyperledger Explorer

  1. We need to configure blockchain-explorer/app/platform/fabric/config.json
  2. IMPORTANT: Don't use the default config.json, instead do the following:
    1. Rename config.json to config-bak.json
    2. Create a copy of config-balance-transfer.json and rename it to config.json (both files in the folder: ./app/platform/fabric/)
    3. Modify the configuration with the values in the file ~/hyperledger-fabric-network/network-profiles/org1.network-profile.yaml
      1. One easy way to do this is by going to https://codebeautify.org/yaml-to-json-xml-csv and converting from YAML to JSON and replacing the values of the field network-1 in the new config.json.
      2. Put special care to the "clients" object, as it has to follow the standard brought by the config-balance-transfer.json instead of the one brought by Hurley. Instead of just one client, it should be wrapped in a "clients" object. It should look like this:
        "clients": {
                "client-1": {
                  "organization": "org1MSP",
                  "channel": "ch1",
                  "credentialStore": {
                    "path": "/Users/walter/hyperledger-fabric-network/.hfc-org1",
                    "cryptoStore": {
                      "path": "/Users/walter/hyperledger-fabric-network/.hfc-org1"
                    }
                  }
                }
              },
        			
  3. Once values are correctly injected you are all set to start Hyperledger Explorer (./start.sh)
  4. Finally go to http://localhost:8080/#/ and enjoy! Also the API can be found here http://localhost:8080/api-docs

Special thanks to  Alex Ramil Aguel for testing this out and putting the tutorial together!

Results should look like this

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us