(Updated for Explorer 1.1.3 and Fabric 2.3, not officially listed as a supporting v2.3, but it is working. If you prefer, can set it up with v.2.2.x LTS.) Hyperledger Explorer is a browser that can be used to view the activities on a block chain network. The following guide installs Hyperledger Explorer on a basic Ubuntu 20.04 DigitalOcean droplet and it is built upon the sample network of Hyperledger Fabric 2.3.
Depending on the speed of the network connection, you can just about run all the steps below perfectly and install it in 5 mins. Let’s start. (I recommend getting at least the $10 bucks a month Droplet from DigitalOcean, you will need the 2GB RAM to run it smoothly, use my link (Discount code for newbies, I get some free referral credits too) to sign up. Then run the following steps.
Check out my other articles on just running Hyperledger Fabric 2.3 and Hyperledger Composer. We aim to publish a full set of these guides on how to play around with Hyperledger technologies. I am a big fan of Brave browser, if you are into blockchain and crypto, should try it, make a little crypto from your regular web browsing.
Step 1 — Set up droplet
For new droplets, set the locale (choose en_US.UTF-8 if in doubt) and do apt update/upgrade.sudo dpkg-reconfigure locales
sudo apt-get update && sudo apt-get upgrade
Step 2 — Set up new user
There will be errors if you try to install Hyperledger Explorer as a root, therefore, for the rest of the set-up, you will be using the new user “dora” to do it. You will be prompted to set up a new password for the user which you will be using later. You will also need to give “dora” the sudo access by setting the permission. (Eugene Yong picked the name.)sudo adduser dora
sudo usermod -aG sudo dora
Switch user to “dora”.su – dora
Step 3 — Set up the prerequisites
You will need these to run Fabric 2.2 and Explorer will just be using docker.sudo apt-get install curl git docker.io docker-compose nodejs npm python#Updating npm to 5.6.0
sudo npm install email@example.com -g#Setting up docker configuration
sudo usermod -a -G docker $USER
sudo systemctl start docker
sudo systemctl enable docker#Installing golang
tar -xzvf go1.13.6.linux-amd64.tar.gz
sudo mv go/ /usr/local#edit gopath in .bashrc
pico ~/.bashrc#(add these 2 lines to end of .bashrc file)
export PATH=$PATH:$GOPATH/bin#exit and log back in as dora
su – dora
Step 4 — Set up Hyperledger Fabric Test Network
After installing the dependencies, you can now set up Hyperledger Fabric 2.3.curl -sSL https://bit.ly/2ysbOFE | bash -s 2.3.0cd fabric–samples/test–network./network.sh up createChannel
This will bring up the Fabric Test Network creating a channel with it. Check using “docker ps -a” to see if it is up and running.
Step 5 — Download files required to install Hyperledger Explorer
# Now create a new folder for Explorer
cd explorer/# Download the files you need to setup Explorer
wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/master/examples/net1/connection-profile/test-network.json -P connection-profile
Step 6 — Copy your Test Network crypto artifact directory to your explorer folder
cp -r ~/fabric-samples/test-network/organizations/ ~/explorer/
Step 7 — Edit the docker compose file to the right path
pico docker-compose.yaml# Make sure the volumes section is as below:
You can keep the first-network.json untouched, or if you prefer to change the default password, you can edit with the following command:pico connection-profile/test-network.json# Default username and password
Step 8 — Start Hyperledger Explorer
You should be ready to start Explorer.# To start Hyperledger Explorer
docker-compose up -d# If you changed any config, clear it out with this and start again
docker-compose down -v
Your Hyperledger Explorer should be properly set up and you can access it at http://<Your-IP-Address>:8080. If it prompts you to log in, use exploreradmin:exploreradminpw.
Tip: Don’t use Apple Safari for this, you might not see the page properly.
Reminder: Check out my other articles on just running Hyperledger Fabric 2.3 and Hyperledger Composer. We aim to publish a full set of these guides on how to play around with Hyperledger technologies. I am a big fan of Brave browser, if you are into blockchain and crypto, should try it, make a little crypto from your regular web browsing.
There are a few good books on Amazon on Hyperledger Fabric (affiliate links below)
- Hands-On Smart Contract Development with Hyperledger Fabric V2: Building Enterprise Blockchain Applications 1st Edition
- Blockchain with Hyperledger Fabric: Build decentralized applications using Hyperledger Fabric 2, 2nd Edition 2nd ed. Edition
- Programming Hyperledger Fabric: Creating Enterprise Blockchain Applications
- Blockchain Development with Hyperledger: Build decentralized applications with Hyperledger Fabric and Composer
- Hyperledger Cookbook: Over 40 recipes implementing the latest Hyperledger blockchain frameworks and tools 1st Edition, Kindle Edition
By Edward Tsang on .