Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Апробация HLF-1.4.2.docx
Скачиваний:
150
Добавлен:
16.04.2020
Размер:
28.77 Mб
Скачать

1.2 Установка под ос AstraLinux

Аналогично ubuntu.

1.3 Установка под ос CentOs

Отличие от установки на ubuntu заключается в настройке машин на которых будет развернута блокчейн сеть, при этом машину с которой будет производится установка можно не менять.

В centOS редактор nano отсутствует поэтому можно установить его или воспользоваться vi.

sudo vi /etc/sudoers

%wheel ALL=(ALL;ALL) NOPASSWD: ALL #для centOS

Отключаем selinux.

sudo vi /etc/syssconfig/selinux

Для перехода в режим редактирования нужно нажать i для выхода из него esc, для режима команд : команда для выхода без сохранения q! для сохранения изменений w для выхода q.

SELINUX=disabled #меняем строчку

Выполняем команду

sudo setenforce 0

Далее настраиваем фаервол.

sudo firewall-cmd --set-default-zone=trusted

1.4 Установка под ос rhel

аналогично CentOS

1.5 Установка под ос Windows

https://medium.com/@harismumtaz_19503/step-by-step-hyperledger-fabric-installation-on-windows-10-7ad462cea89c

Open developers mode

Go to settings->update & security -> developers For and select Developer mode

Now after successfully “on” the developer mode, we have to “on” subsystem linux feature.

Search “control panel” and goto programs->”Turn windows features on or off”

NOW after your system restart open cmd and try this command

sudo apt-get update

You will get a message to install linux distribution.

By installing linux distribution allows one to use Ubuntu Terminal and run Ubuntu command line utilities including bash, ssh, git, apt and many more.

To install linux distribution on windows.

There are 2 ways:

To download distribution from here https://www.microsoft.com/en-nz/p/ubuntu/9nblggh4msv6?rtc=1&activetab=pivot:overviewtab OR

(I’ll prefer) open cmd “as administrator” and run this command to download linux distribution

lxrun /install

after downloading/installing distribution it will ask you to set username and password. And yeah! You have successfully installed linux distribution on windows now you can see “Bash on Ubuntu” option on your windows menu. Click on it to open ubuntu terminal.

NOW INSTALL CURL

INSTALL DOCKER

You will need to install docker CE Client in Ubuntu Subsystem and install Docker on Windows as well.

INSTALL Docker CE on Ubuntu

OS requirements:

To install Docker CE, you need the 64-bit version of one of these Ubuntu versions:

Bionic 18.04 (LTS)

Xenial 16.04 (LTS)

Trusty 14.04 (LTS)

To check your distribution version use below command:

lsb_release -a

We can install Docker CE in different ways, depending on needs.

here I’m installing CE using repository (preferably) for ease of installation and upgrade tasks.

Install using the repository

Before installing Docker CE for the first time, we need to set up the Docker repository. Afterward, we can install and update Docker from the repository.

Update apt-get

sudo apt-get update

Install packages to allow apt to use a repository over HTTPS:

sudo apt-get install \ apt-transport--https \ ca-certificates \ curl \ Software-properties-common

During installation it will ask you to freed some disk space. Enter “Y” to proceed

Add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Now we have to Verify the key with the fingerprint by searching for the last 8 characters of the fingerprint.

sudo apt-key fingerprint 0EBFCD88

You should see below result successfully.

Now we will install docker stable repository using following command:

sudo add-apt-repository \ “deb [arch=amd64] https;//download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable”

5. After that we need to Update the apt package index.

sudo apt-get update

Haah. we have installed and updated all things required for Docker CE now it’s time to install DOCKER CE.

6. Install the latest version of Docker CE.

sudo apt-get install docker-ce

In between it will ask to acquire some additional space. Press “Y” and proceed

Now after downloading and installing dockers on windows and ubuntu. We need to expose the daemon to port 2375 first by right-clicking the docker icon on taskbar then click setting then check the Expose daemon box.

Now our docker server will be able to connect via Windows network including Ubuntu subsystem. We need to set environment variables in Ubuntu by running.

echo “export DOCKER_HOST=’tcp://0.0.0.0:2375'” >> ~/.bashrc

Above command will add DOCKER_HOST to the variables every time we start a new Bash. On the current bash doesn’t have this variable yet so you can open the new one or run this command.

source ~/.bashrc

sudo apt update

Now open your docker desktop settings and “check” your drive to be shared.Make sure your firewall is off.

Now, turned on File Sharing and gave all the rights to “Users”. Go to your C drive and go to properties by right click on it, Goto sharing tab and click on “Advanced sharing”

Install Docker compose

We also need docker-compose for ease of connecting docker together.

we need to download docker-compose version which is equal or greater than 1.14.0

sudo curl -L “https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

After installing we need to reopen terminal and check the docker-compose version by following command:

docker-compose — version

There are some difficulties with Docker-compose mounting from Windows so we mount the C drive and make a new Workspace there. You can access this C:/workspace through your IDE in windows.

sudo mkdir /c

sudo mount — bind /mnt/c /c

mkdir /c/workspace && cd /c/workspace

Install node

Its recommended to use NodeJS Version 8.x for developing an application on Fabric.I’m installing node using repository.

Install repository

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

2. Install nodejs

sudo apt-get install nodejs

3. Install npm

sudo apt install npm

Note: if you get some errors do below steps and try again from where you skip:

First of all try these commands:

sudo apt-get update

sudo apt-get clean

sudo apt-get autoremove

If error still persists then do this

sudo apt — fix-broken install

sudo apt-get update && sudo apt-get upgrade

sudo dpkg — configure -a

sudo apt-get install -f

Install GO

sudo add-apt-repository ppa:gophers/archive

sudo apt-get update

sudo apt-get install golang-1.9-go

export GOPATH=$HOME/go

Now install Hyperledger Fabric

we are using version v1.4.0-rc1 which was released on December 10, 2018. you can replace the version in bellow command as your need.

cd /c/workspace

curl -sSL https: //goo .gl /6wtTN5 | bash -s v1.4.0-rc1

we have installed fabric Now, we will generate our first fabric sample network.

cd ./fabric-samples/first-network && ./byfn.sh -m generate

It will ask your permission to generate certs and other default configuration. Just proceed by pressing “Y” and it generate sample fabric network for you.

Now it comes to launch our sample network:

./byfn.sh -m up