Hyperledger Fabric First-network环境搭建

##########安装基础软件##########
## 后面会使用的的基础软件包

yum install -y git vim wget curl 

##########安装docker##########
## 下载依赖软件

yum install -y yum-utils device-mapper-persistent-data lvm2
## 设置docker源,加速下载
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache
yum -y install docker-ce
docker version
systemctl start docker
systemctl enable docker

curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version

##########安装go##########
curl -O https://dl.google.com/go/go1.13.8.linux-amd64.tar.gz
tar -C /usr/local/ -xzvf go1.13.8.linux-amd64.tar.gz

echo "export GOROOT=/usr/local/go" >> /etc/profile
echo "export GOPATH=/home/goProject" >> /etc/profile
echo "export GOBIN=\$GOPATH/bin" >> /etc/profile
echo "export PATH=\$PATH:\$GOROOT/bin" >> /etc/profile
echo "export PATH=\$PATH:\$GOPATH/bin" >> /etc/profile
source /etc/profile
go version

##########安装node###########
## 下载nodejs,再调整npm版本 

wget https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.gz
sudo tar --strip-components 1 -xzvf node-v* -C /usr/local
node  --version
npm install [email protected] -g



##########下载fabric-samples##########
## 配置国内docker源,加速下载
echo '{"registry-mirrors":["http://hub-mirror.c.163.com","https://docker.mirrors.ustc.edu.cn","https://reg-mirror.qiniu.com","https://dockerhub.azk8s.cn","https://registry.docker-cn.com"]}' >> /etc/docker/daemon.json

curl -sSkL https://bit.ly/2ysbOFE | bash -s -- 2.0.0 1.4.6 0.4.18
## wget https://bit.ly/2ysbOFE
## sh 2ysbOFE -s -- 1.4.6 1.4.6 0.4.18

export PATH=/root/fabric-samples/bin:$PATH

##########启动测试##########
cd fabric-samples/first-network/
./byfn.sh down
./byfn.sh generate
./byfn.sh up
./byfn.sh --help
## 启动ca 并使用couchdb存储世界状态
## ./byfn.sh up -a -s couchdb

当出现以下界面即代表first-network启动成功

Hyperledger Fabric First-network环境搭建_第1张图片

你可能感兴趣的:(Hyperledger,Fabric)