您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。