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.
If you have Windows or Mac, download VBOX from https://www.virtualbox.org/wiki/Downloads
Install Linux Ubuntu 16.0.4 on the VBOX.
# 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
$ 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
$ 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"
$ 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
# 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)
$ 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
$ 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