(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 firstname.lastname@example.org -g
#Setting up docker configuration
sudo usermod -a -G docker $USER
sudo systemctl start docker
sudo systemctl enable docker
tar -xzvf go1.13.6.linux-amd64.tar.gz
sudo mv go/ /usr/local
#edit gopath in .bashrc
#(add these 2 lines to end of .bashrc file)
#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.0
./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
# 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
# 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:
# 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.
By Edward Tsang on .