Hyperledger 1.4 安裝教程


Hyperledger1.4 install

系統環境

Ubuntu 18.04.3 LTS

Install cURL

默認已安裝

Docker and Docker Compose

Docker version 17.06.2-ce or greater is required. Docker Compose version 1.14.0 or greater installed.

安裝 Docker

# step 1: 安裝必要的一些系統工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安裝GPG證書
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 寫入軟件源信息
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新並安裝Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce

配置 Docker 加速器

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io

免sudo使用docker命令

sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo service docker restart
newgrp - docker

Docker Compose 可能需要翻牆安裝

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose  # 其實就是下載下到/usr/local/bin/中並命名爲docker-compose
sudo chmod +x /usr/local/bin/docker-compose

確認已安裝成功

docker --version
    Docker version 19.03.5, build 633a0ea838
docker-compose --version
    docker-compose version 1.24.1, build 4667896b

參考資料

Get Docker Engine - Community for Ubuntu
Ubuntu 18.04更改apt爲阿里雲軟件源
Docker — 從入門到實踐

Go Programming Language

Go version 1.12.x is required.

Install

wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

#You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile:
export PATH=$PATH:/usr/local/go/bin

# While this directory may not exist in a new Go workspace installation, it is populated later by the Fabric build system with a small number of Go executables used by other parts of the build system. So even if you currently have no such directory yet, extend your shell search path as above.
~/.bashrc
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

Node.js Runtime and NPM

If you will be developing applications for Hyperledger Fabric leveraging the Hyperledger Fabric SDK for Node.js, version 8 is supported from 8.9.4 and higher. Node.js version 10 is supported from 10.15.3 and higher.

Node.js

sudo apt-get install -y build-essential
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - #有的時候連不上,多試幾次……
sudo apt-get install -y nodejs

sudo npm install [email protected] -g

Install Samples, Binaries and Docker Images

# If you want a specific release, pass a version identifier for Fabric, Fabric-ca and thirdparty Docker images. The command below demonstrates how to download Fabric v1.4.4
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s -- 1.4.4 1.4.4 0.4.18

The command above downloads and executes a bash script that will download and extract all of the platform-specific binaries you will need to set up your network and place them into the cloned repo you created above. It retrieves the following platform-specific binaries:

  • configtxgen,
  • configtxlator,
  • cryptogen,
  • discover,
  • idemixgen
  • orderer,
  • peer, and
  • fabric-ca-client

and places them in the bin sub-directory of the current working directory.

You may want to add that to your PATH environment variable so that these can be picked up without fully qualifying the path to each binary. e.g.:

export PATH=<path to download location>/bin:$PATH
export PATH=$HOME/fabric-samples/bin:$PATH # 例子
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章