这篇文章给大家分享的是有关Hyperledger Fabric如何安装和运行的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
预先安装
注意:以下全部安装和配置都在 Ubuntu16.04.5-server-amd64 上进行
cURL
checck on Ubuntu16.04.5 (input command "curl --help")
Docker
version (17.06.2-ce or greater) (input command "docker --version")
How to install Docker on Ubuntu16.04.5 (See this)
Docker Compose
version (1.14.0 or greater) (input command "docker-compose --version")
How to install Docker Compose on Ubuntu16.04.5 (See this)
Go
version (1.11.x) (input command "go version")
GOPATH (export GOPATH=~/golang/gopath)
PATH (export PATH=$PATH:$GOPATH/bin)
下载源码
源码中含有样例,下载完成后切换到v1.3.0版本的源码
go get github.com/hyperledger/fabric cd $GOPATH/src/github.com/hyperledger/fabric git checkout -b v1.3.0
下载镜像
docker pull hyperledger/fabric-tools:amd64-1.3.0 docker pull hyperledger/fabric-peer:amd64-1.3.0 docker pull hyperledger/fabric-orderer:amd64-1.3.0 docker pull hyperledger/fabric-ca:amd64-1.3.0 docker pull hyperledger/fabric-couchdb:amd64-0.4.14 docker pull hyperledger/fabric-kafka:amd64-0.4.14 docker pull hyperledger/fabric-zookeeper:amd64-0.4.14 docker pull hyperledger/fabric-baseos:amd64-0.4.14为了方便 docker-compose 的配置,将所有的镜像 tag 都改为 latest
docker tag hyperledger/fabric-tools:amd64-1.3.0 hyperledger/fabric-tools:latest docker tag hyperledger/fabric-peer:amd64-1.3.0 hyperledger/fabric-peer:latest docker tag hyperledger/fabric-orderer:amd64-1.3.0 hyperledger/fabric-orderer:latest docker tag hyperledger/fabric-ca:amd64-1.3.0 hyperledger/fabric-ca:latest docker tag hyperledger/fabric-couchdb:amd64-0.4.14 hyperledger/fabric-couchdb:latest docker tag hyperledger/fabric-kafka:amd64-0.4.14 hyperledger/fabric-kafka:latest docker tag hyperledger/fabric-zookeeper:amd64-0.4.14 hyperledger/fabric-zookeeper:latest docker tag hyperledger/fabric-baseos:amd64-0.4.14 hyperledger/fabric-baseos:latest这些镜像都比较大,下载过程请确保网络环境稳定速率快,否则容易中断失败
运行样例
cd $GOPATH/src/github.com/hyperledger/fabric/examples/e2e_cli # 这里的斜杠"/"需要转义 sed -i "s/\/opt\/gopath/\/home\/nealguo\/golang\/gopath/g" *.* base/*.* script/*.*启动过程中会用到很多配置文件和脚本,比如 docker-compose-cli.yaml、base/docker-compose-base.yaml、scripts/script.sh,这些配置文件和脚本中很多路径以 /opt/gopath 开头(即默认 $GOPATH 是 /opt/gopath),
如果 $GOPATH 是其他路径,需要修改这些配置文件和脚本,比如这里用 /home/nealguo/golang/gopath 替换 /opt/gopath(sed 命令参看这里)
cd $GOPATH/src/github.com/hyperledger/fabric/examples/e2e_cli bash network_setup.sh up这里运行样例 e2e_cli,关闭时可以使用命令 “bash network_setup.sh down”
感谢各位的阅读!关于“Hyperledger Fabric如何安装和运行”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。