ChainBelow

Hyperledger Fabric, SDK and Composer

Installing Hyperledger Fabric 1.4 LTS

Installing Fabric Developers version only on Ubuntu 16.0.4

Prerequisites

Having installed NPM and Node 8.x

        $ npm set prefix ~/.npm
        $ PATH="$HOME/.npm/bin:$PATH"
        $ PATH="./node_modules/.bin:$PATH"
    

Propagate the changes

      
        $ source ~/.bashrc
    

Install Docker and Docker-Compose

        # Install docker
        $ sudo apt-get update
        $ sudo apt-get install \
            apt-transport-https \
            ca-certificates \
            curl \
            gnupg-agent \
            software-properties-common
        $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
        $ sudo add-apt-repository \
           "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
           $(lsb_release -cs) \
           stable"
        sudo apt-get update
        sudo apt-get install docker-ce docker-ce-cli containerd.io
        
        # Manage Docker as a non-root user
        sudo groupadd docker
        sudo usermod -aG docker $USER
        
        #### Logout and Log back
        
        # Install docker-compose
        sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
        sudo chmod +x /usr/local/bin/docker-compose        
    

Download VSCODE from https://code.visualstudio.com/ and install the IBM Blockchain Platform plug-in. Now you are ready to build and excecute Smart Contracts.


Installing Hyperledger Fabric 1.2

If you have Windows or Mac, download VBOX from https://www.virtualbox.org/wiki/Downloads

Install Linux Ubuntu 16.0.4 on the VBOX.

Hyperledger Fabric 1
Hyperledger Fabric 2
Hyperledger Fabric 3

Linux and MacOS Pre-Requisites

  • Operating System - Ubuntu Linux 14.04 / 16.04 LTS (both 64-bit) or MacOS 10.12.x
  • Docker Engine: Version 17.03 or higher
  • Docker-Compose: Version 1.8 or higher
  • Node.JS: 8.9 or 8.x
  • npm: v5.x
  • git: 2.9.x or higher
  • Python: 2.7.x
  • A code editor of your choice, Hyperledger recommends VSCode.

Linux and MacOS Additional Pre-Install

        # Install xcode command line tools
        $ xcode-select --install

        # Install HomeBrew
        $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

        # Install NodeJS (MacOS)
        $ brew install node@8

        # Install NodeJS (Ubuntu)
        $ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
        $ sudo apt-get install -y nodejs

        # Install Docker CE (MacOS)
        https://docs.docker.com/docker-for-mac/install/

        # Install Docker CE (Ubuntu)
        https://store.docker.com/editions/community/docker-ce-server-ubuntu

        # Install Git Client (MacOS)
        https://sourceforge.net/projects/git-osx-installer/files/

        # Install Git (Ubuntu)
        $ apt-get install git-core 
    

Mac OS OpenSSL

            $ brew unlink openssl && brew link openssl --force
            $ brew install openssl
            $ export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
            
            # headers
            $ export LDFLAGS="-L/usr/local/opt/openssl/lib"
            $ export CPPFLAGS="-I/usr/local/opt/openssl/include"
            
            $ brew install softhsm        
    

Linux Ubuntu OpenSSL

        $ sudo apt-get -y install libssl-dev
        $ export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

        # headers
        $ export LDFLAGS="-L/usr/local/opt/openssl/lib"
        $ export CPPFLAGS="-I/usr/local/opt/openssl/include"
    

Common OpenSSL

            $ curl -O https://dist.opendnssec.org/source/softhsm-2.0.0.tar.gz
            $ tar -xvf softhsm-2.0.0.tar.gz
            $ cd softhsm-2.0.0
            $ ./configure --disable-non-paged-memory --disable-gost
            $ make
            $ sudo make install
            $ sudo mkdir -p /var/lib/softhsm/tokens
            $ sudo chmod 777 /var/lib/softhsm/tokens
            $ softhsm2-util --init-token --slot 0 --label "ForComposer" --so-pin 1234 --pin 98765432
      

Common Reset Earlier Docker

            # Destroy old docker
            $ docker kill $(docker ps -q)
            $ docker rm $(docker ps -aq)
            $ docker rmi $(docker images dev-* -q)
            $ docker rm $(docker ps -a -q)
            $ docker rmi $(docker images -q)      
      

Common Hyperledger Composer Install

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

Common Hyperledger Fabric Install

            $ mkdir fabric-dev-servers && cd fabric-dev-servers

            $ curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.tar.gz
            $ tar -xvf fabric-dev-servers.tar.gz
            
            $ export FABRIC_VERSION=hlfv12
            $ ./downloadFabric.sh   
            
            # Start Fabric12
            $ ./startFabric.sh