最近接手了公司的BAAS平台,底层是fabric, 所以试着搭建了下fabric平台。
1. 安装Ubuntu 14.04
2. 安装docker
#wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce_18.09.2~3-0~ubuntu-bionic_amd64.deb
#wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce-cli_18.09.2~3-0~ubuntu-bionic_amd64.deb
# wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/containerd.io_1.2.2-3_amd64.deb
# dpkg -i containerd.io_1.2.2-3_amd64.deb
# dpkg -i docker-ce-cli_18.09.2~3-0~ubuntu-bionic_amd64.deb
# dpkg -i docker-ce_18.09.2~3-0~ubuntu-bionic_amd64.deb
安装完成,验证下
#
3. 安装docker-compose
# apt install python-pip
# pip install docker-compose
验证下:
# docker-compose version
docker-compose version 1.23.2, build 1110ad0
docker-py version: 3.7.0
CPython version: 2.7.15rc1
OpenSSL version: OpenSSL 1.1.0g 2 Nov 2017
4. 安装go
# apt install golang-go
# apt install gccgo-go
#验证 go version
5. 脚本快速安装fabric
#下载fabric-release-1.4.zip 文件,具体下载链接为:https://github.com/hyperledger/fabric
# unzip fabric-release-1.4.zip
# cd fabric-release-1.4/scripts/
# ./bootstrap.sh 会下载docker images 和配置文件
# cd first-network/
# sudo ./byfn.sh -m generate -c ljchannel
# sudo ./byfn.sh -m up -c ljchannel
出现start 和end 图像,显示成功
注意:docker 和docker-compose 版本一定要对,一开始是apt 直接安装的docker,
报错“failed to connect to peer0.org1.example.com:7051:”
解决方案:升级docker 版本为 18.09, docker-compose 版本为:1.23.2