Codementor Events

Install HyperLedger Fabric at Win 10

Published Mar 23, 2019
Install HyperLedger Fabric at Win 10

Hyperledger Fabric only runs on Unix-based operating systems. As a result, it will not be able to run on Windows without setting up a virtual machine (or via Docker at Win 10 Pro/Ent.). In this arcle I'm explaining in simple steps how to install and setup a ubuntu virtual machine vm at Win 10, followed by step to install HyoerLedfer Fabric and getting it up and running:

credit goes to medium, I used it with required modifications

Create VM

  1. Download VMware Player, you can use virtualbox as an alternate.
  2. Download Ubuntu ISO
  3. Install vmware player
  4. Create VM of Ubuntu using vmware player

Prepare the VM

$ sudo dpkg-reconfigure locales   // choose en_US.UTF-8 if in doubt
$ sudo apt-get update
$ sudo apt-get upgrade

Install pre-requists

$ sudo apt-get install curl git docker.io docker-compose golang nodejs npm

Install Docker

$ sudo usermod -a -G docker $USER
$ sudo systemctl start docker
$ sudo systemctl enable docker
$ sudo chmod 666 /var/run/docker.sock

Install Hyperledger Fabric

  1. Check the latest version of fabric repository, at the time of writting this post, it is 1.4
  2. Install Fabric
$ curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.0
  1. Check if fabric is installed, you should see big "END" once done
$ cd fabric-samples/first-network
$ ./byfn.sh generate
$ ./byfn.sh up
  1. Check if fabric docker is running smoothly
$ docker ps -a
  1. Stop the network
$ ./byfn.sh down

Now it is time to install the composer, you can test and lear it from here:

Install Composer

  1. Create new user, when asked about the full name, use something different than the full name used of the main user, to avoid confusion next time you are logging on.
    Note: if you need to keep things with the same user, jump to step number 4 followed by step number 7 directly
$ sudo adduser playground
  1. Set permission for the new user
sudo usermod -aG sudo playground
  1. Login as the new user
su - playground
  1. 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
  1. Logout and login with the new user to get things activated properly
$ exit
$ su - playground
  1. Install components needed for running Hyperledger Fabric
$ curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.0
  1. Install components needed for running Hyperledger Composer
$ npm install -g composer-cli composer-rest-server generator-hyperledger-composer yo composer-playground
  1. Start Composer
$ composer-playground
  1. Open your browser and check it:
http://localhost:8080
Discover and read more posts from Hasan Yousef
get started
post commentsBe the first to share your opinion
Show more replies