您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“mac系統(tǒng)如何搭建fabric”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“mac系統(tǒng)如何搭建fabric”這篇文章吧。
1、go 1.9 以上
2、mac系統(tǒng)安裝docker就可以
3、在$GOPATH/src/github.com/hyperledger
git clone https://github.com/hyperledger/fabric.git
切換版本,因?yàn)槿绻磺袚Q版本,接下來的錯(cuò)誤可能會(huì)和版本不一致有極大的關(guān)系,我切換的是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、添加相應(yīng)組件
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、執(zhí)行腳本
cd fabric/examples/e2e_cli
如果修改該目錄,要修改gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/base目錄下的peer-base.yaml
將網(wǎng)絡(luò)名改成如下名稱即可- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_cli_default
接下來
chmod +x download-dockerimages.sh
./download-dockerimages.sh
此時(shí)我下載的鏡像文件版本如圖:
如果版本不一致會(huì)出現(xiàn)這種問題
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、最后執(zhí)行成功
以上是“mac系統(tǒng)如何搭建fabric”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。