这篇文章主要为大家展示了“mac系统如何搭建fabric”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“mac系统如何搭建fabric”这篇文章吧。
1、go 1.9 以上
2、mac系统安装docker就可以
3、在$GOPATH/src/github.com/hyperledger
git clone https://github.com/hyperledger/fabric.git
切换版本,因为如果不切换版本,接下来的错误可能会和版本不一致有极大的关系,我切换的是v1.0.0-beat
$ git checkout v1.0.0-beta
4、安装homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
5、添加相应组件
brew install gnu-tar --with-default-names
brew install libtool
make configtxgen
编译成功后:
build/bin/configtxgen CGO_CFLAGS=" " GOBIN=/Users/johndoe/work/src/github.com/hyperledger/fabric/build/bin go install -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.0.0-snapshot-8d3275f -X github.com/hyperledger/fabric/common /metadata.BaseVersion=0.3.0 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric" github.com/hyperledger/fabric/common/configtx/tool/configtxgen Binary available as build/bin/configtxgen``
6、执行脚本
cd fabric/examples/e2e_cli
如果修改该目录,要修改gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/base目录下的peer-base.yaml
将网络名改成如下名称即可- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_cli_default
接下来
chmod +x download-dockerimages.sh
./download-dockerimages.sh
此时我下载的镜像文件版本如图:
如果版本不一致会出现这种问题
Attempting to Query PEER0 ...3 secs
Attempting to Query PEER0 ...6 secs
Attempting to Query PEER0 ...9 secs
Attempting to Query PEER0 ...12 secs
Attempting to Query PEER0 ...15 secs
Attempting to Query PEER0 ...18 secs
Attempting to Query PEER0 ...21 secs
Attempting to Query PEER0 ...24 secs
Attempting to Query PEER0 ...27 secs
Attempting to Query PEER0 ...30 secs
Attempting to Query PEER0 ...33 secs
Attempting to Query PEER0 ...37 secs
Attempting to Query PEER0 ...40 secs
Attempting to Query PEER0 ...43 secs
Attempting to Query PEER0 ...46 secs
Attempting to Query PEER0 ...49 secs
Attempting to Query PEER0 ...52 secs
Attempting to Query PEER0 ...55 secs
。。
所以一定要确保版本的一致性
7、最后执行成功
以上是“mac系统如何搭建fabric”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。