===================================================================================================== This guide is for people who have little to no experience with Linux, but want to get going with Hyperledger’s Fabric solution. =====================================================================================================
What is Hyperledger?Hyperledger is the umbrella open source project that the Linux Foundation has created and hosted since 2015. It aims at advancing and promoting cross-industry blockchain technologies to ensure accountability, transparency, and trust among business partners. As a result, Hyperledger makes business network and transactions more efficient.
As it was already mentioned, this tutorial is for people who have little to no experience with Linux, so let’s start from the beginning.
First of all, we need to have a server with Linux installed on it. Of course, you can use VMWARE, Hyper-V (installed on one of your machines) or you can go with some cloud vendor like AWS, GCP, Azure, IBM, etc. Let’s go with Digital Ocean 😊.
Register at Digital Ocean (if you already don’t have an account) and create a new “Droplet”.
Note: You can use something else, not just an Ubunty. However, for the training purposes, we recommend going with Ubunty.
We don’t need a crazy powerful and expensive server. Right now we can go with something that has 4GB of RAM, 2 CPUs and 80 GB disk:
Name your Droplet. As you can see, we named our: CHFA-fra1–02:
After just a few minutes, our server will be ready. Let’s connect to it. Of course, we need something like putty. Let’s use Kitty😊.
Digital Ocean will ask us to change the password when we connect to our server for the first time. Do so. After password change we should see a similar screen:
Now, let’s start the real work. We will begin with cURL install. First, let’s update our package list and install any newer versions using apt :
sudo apt updatesudo apt -y upgrade
Next, we will install curl using apt :
sudo apt install -y curl
The same we installed curl, we will now install git using apt :
sudo apt install git
As you can guess, Python is also required. Since we are running Ubuntu 18.xx, we should already have the Python version we need automatically installed. We will still perform a double check to ensure Python is installed. Type the following command:
python2.7 — version
If for some unknown reason in return we see an error, we can install it using the following command:
sudo apt install -y python-minimal
Note: We also like to install some extra, like Midnight Commander. Execute the following command:
sudo apt install mc
Now it’s a time to install Docker. Before moving on, let’s update our package list again:
sudo apt updatesudo apt upgrade
We will now use apt to install a few packages Docker is dependent upon:
We need to change the permissions for docker-compose so we can execute it later:
sudo chmod +x /usr/local/bin/docker-compose
Let’s perform a reboot to ensure everything we’ve done is placed into effect.
sudo reboot now
Now, when all pre-requisites are in place, let’s download Hyperledger to our server.
Please change directories into your desktop:
cd ~/Desktop
Note: If you don’t have a directory called Desktop, we would recommend to create it, because some official material from Linux Foundation training (including provided scripts) does refer to the path, that includes directory Desktop. We can create a required folder by using the following syntax:
mkdir ~/Desktop
Use the following command to curl down the fabric-samples project folder, and Docker images for Hyperledger Fabric v1.4:
Please verify that a new fabric-samples folder is now on your desktop:
ls
Now, take a quick look into what this folder holds.
cd fabric-samples && ls
Lastly, let’s do a sanity checks and verify that everything was correctly installed:
git -vdocker-compose -vdocker -v
Now it’s a time to build our “Starter Network”. “Starter Network” is an extremely scaled-down, barebones Hyperledger Fabric network. It has one peer, one organization, and a single Solo orderer.
Please change directories into fabric-samples:
cd ~/Desktop/fabric-samples
Execute the following commands to Bootstrap the Basics:
When startup.sh finishes, we will have our Hyperledger installed and ready for the next steps!
Good luck with your studies 😊.
P.S.
Sometimes when we do copy commands from websites and docs (such as .pdf) and past them into a Linux console, they do not work. There are many reasons for that, and we are not going to talk about them in this article. However, to help you to overcome this issue, please download the following text file (save as) that includes all commands mentioned in the article.