Install Hyperledger Explorer with docker hub

ihwoo
3 min readJul 14, 2020

--

I have install Hyperledger Explorer on the WSL 2. In the paper, i explain the way to install Hyperledger Explorer with docker image. i assume basic application(Ubuntu18.04LTS, docker, docker-compose)was already installed on your environment.

  1. Download Hyperledger Explorer
  2. network configuration
  3. modifydocker-compose.yaml
  4. Initialize DB
  5. execute

1. Download Hyperledger Explorer

Execute following command on your Linux terminal to download Hyperledger Explorer.

 git clone https://github.com/hyperledger/blockchain-explorer.git

2. network configuration

modify config,connection,crypto-config following your blockchain network. In my case, i create examples/dronenetwork folder to management network configuraion files.

crypto-config was copied from blockchain network. Edit config.json and connection-profile following your environment. See the following link.

3. Modify docker-compose.yaml

Check your Hyperledger Fabric version.

In my case, i use Fabric 1.4 and Nodejs 8.17.0. So i choice 1.0.0-rc2 for my environment.

after then, go to the blockchain-explorer folder and modify docker-compose.yaml file.

In Docker-compose.yaml, we need to modify ‘image:’ and ‘volumes:’. In previous step, we check the version of explorer. modify ‘image:’ following yours.

In my case, i modify explorer-db version as 1.0.0-rc2, explorer as1.0.0-rc2, premetheous as latest, and grafana as6.3.6. See the following picture.

And i modify volumes path from net1 to dronenetwork. As you can see in the ‘explorer:mynetwork.com:volumes:’, it was changed to ./explorer/examples/dronenetwork/~~. It is the path of network management folder that i mentioned in Step 2.

4. Initialize DB

before we start, we need to initialize DB. If we missing this step, we can see database error like ‘already exist in DB , Kindly re-run the DB scripts to proceed docker’.

At first, run following command to run explorer-db.

docker run -it hyperledger/explorer-db:1.0.0-rc2

connect bash and execute ./createdb.sh with following command. check your explorer-db ID with ‘docker ps’ command.

docker exec -it <ID> bash
./createdb.sh

5. execute

Now, we can run Hyperledger Explorer. Go to the blockchain-explorer folder and execute following command.

docker-compose up

Possible Error and solution

  • Fail to connect before the deadline-> check blockchain network, and connection-profile. check your url. Especially, if you have error on the orderer, check the address declaration of orderer on connection-profile.
  • Access denied -> check your crypto-config file. Make sure both crypto-config in blockchain-explorer and blockchain-network is exactly same. Check your adminPrivateKey and signedCert path in your connection-profile that is exactly same on your crypto-config folder.

--

--

No responses yet