Coinmonks

Coinmonks is a non-profit Crypto Educational Publication. Other Project — https://coincodecap.com/ & Email — gaurav@coincodecap.com

Containerizing Blockchain Explorer and Integrate with Existing Hyperledger Fabric Network.

3 min readMay 2, 2020

--

Photo by Launchpresso on Unsplash

Setting networks locally is a really challenging task on a different machine, here we will be using the power of docker to create a docker image once and run anywhere.

In this article, we will create a blockchain explorer image and integrate it with the existing blockchain network. I am assuming You are already aware of how to create a working Hyperledger fabric network, if not you can go through my youtube series.

This block will be very short and simple as we do not need to take care of a lot of things. Let's start.

I have created Youtube Video for containerizing blockchain Explorer and integrate with your own fabric network.

Clone git repo from HERE.

Open the docker-compose file, It will be like below.

Here we have defined two services for
1. Blockchain Explorer
2. Postgresql

The only thing we need to add is Mounting volumes.

  1. config.json

Here we have defined profile: fabric-network.json which is available inside the connection-profile folder.

2. fabric-network.json

In this folder, we have mentioned the configuration requires to connect the fabric network. Here we will be fetching data from peer0. If you want to fetch data for any other peer, you can make necessary changes as per-peer configuration.

Copy the crypto-config folder from your working fabric network and paste inside the repo. you can replace the existing folder.

Note: Please provide ORG admin private key with the correct name. For a different version of the cryptogenic binary, its get generated like below:
1. 1bebc656f198efb4b5bed08ef42cf3b2d89ac86f0a6b928e7a172fd823df0a48_sk

2. priv_sk

Go to the home(Repository) folder and run below command

docker-compose up -d

This command will up both services, as per your exported port, you can access UI on localhost:8080

If you are not able to see anything running on localhost:8080, please check a log of the container with the following command.

docker logs explorer.mynetwork.com -f

Please as per the error log, make necessary changes in a specific file.

Cleaning network: run below command to stop and remove both containers

docker-compose down

In case if you are facing any issue, please let me know, I would love to help you. You can get in touch with me on linked in or Instagram.
https://www.instagram.com/pavanadhavofficial/
https://www.linkedin.com/in/pavan-adhav/

Thank you.

References

Get Best Software Deals Directly In Your Inbox

--

--

Coinmonks
Coinmonks

Published in Coinmonks

Coinmonks is a non-profit Crypto Educational Publication. Other Project — https://coincodecap.com/ & Email — gaurav@coincodecap.com

Pavan Adhav
Pavan Adhav

No responses yet