5 minutes to Install Hyperledger Composer Playground on Ubuntu 18.04 DigitalOcean

Yes, another 5 mins guide. This time to setup Hyperledger Composer on Ubuntu 18.04. Official documentation supports Ubuntu 16.04, but I have tested it on 18.04 and it is working fine. Just follow the steps below and you will be up and running in a few minutes. Should work on other VPS, but I am using DigitalOcean. If you want to just run Fabric 1.4 without Composer, you can follow my other guide here. Just get a basic Ubuntu 18.04 Droplet from DigitalOcean, or 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 1.4.4 and Hyperledger Explorer. We aim to publish a full set of these guides on how to play around with Hyperledger technologies. Chinese version of these articles will be available via Jasmine Yang soon. Eugene Yong tested every line of code in this article. 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 – For new Droplets, always 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 – Add another user “playground”, using root will have all sorts of problems during installation, please make sure you use user “playground” to do it. Just follow the prompts to enter the info. You will need to give it a password which you will need later on.

sudo adduser playground

Step 3 – Set permissions for the new “playground” user account.

sudo usermod -aG sudo playground

Step 4 – Log in as “playground”, we will use this account to do the installation.

su - playground

Step 5 – Install the prerequisites by getting and running the script from github. It will ask for the password of “playground” account to proceed.

curl -O https://hyperledger.github.io/composer/latest/prereqs-ubuntu.sh
chmod u+x prereqs-ubuntu.sh
./prereqs-ubuntu.sh

Step 6 – Log out of “playground” and log back in to proceed. Most of the time, you will ignore these kind of steps on Linux, but this time, please do it, it won’t work otherwise.

exit
su - playground

Step 7 – Install components needed for running Hyperledger Composer.

npm install -g composer-cli composer-rest-server generator-hyperledger-composer yo composer-playground

Step 8 – Install components needed for running Hyperledger Fabric.

curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.4

Step 9 – Start Composer, then you can access it via using your web-browser to http://<Your IP Address>:8080.

composer-playground

That’s it. Will write more about Chaincode next time. Please let me know if you have any questions. This is just a quick way to spin up your own working copy of Composer to play around with. IBM provides a free online one too.

Random Notes:

Why use Composer?
It’s a quick way to do a proof of concept (POC) project with Hyperledger Fabric blockchain. When you have got your head around it, you will likely to build the solution natively on Fabric.

Status of Composer.
IBM has scaled back the team responsible for Composer and will be putting more effort on Fabric instead, read here for more info. All it means for now is that the team won’t add new features to Composer, but will keep it compatible with Fabric 1.x releases. It is working with 1.4.4 now. As explained above, it is mostly a tool useful for POC prototypes. It is still a great tool to use for now. There are 3rd party tools aiming to replace Composer, I might cover it in future tutorials.

Reminder: Check out my other articles on just running Hyperledger Fabric and Hyperledger Explorer. We aim to publish a full set of these guides on how to play around with Hyperledger technologies. Chinese version of these articles will be available via Jasmine Yang soon. Eugene Yong tested every line of code in this article. 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 .

Canonical link

Leave a Reply

Your email address will not be published. Required fields are marked *