hyperledger fabric Mac環境配置
Step:官網文件 :https://hyperledger-fabric.readthedocs.io/en/latest/releases.html
1、安裝docker for mac
2、安裝cURL, mac 環境中已經安裝了cURL
3、安裝docker and docker compose
4、安裝Homebrew 官網: https://brew.sh/index_zh-cn.html
終端安裝命令
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
5、安裝Go語言
brew install go
6、下載 hyperledger fabric samples
a、終端執行 git clone https://github.com/hyperledger/fabric-samples.git
cd fabric-samples
b、下載平臺特定的二進位制檔案 hyperledger-fabric-darwin-amd64-1.0.5.tar.gz(下載非常慢)
curl -sSL https://goo.gl/byy2Qj | bash -s 1.0.5
離線下載地址(較快)
c、解壓hyperledger-fabric-darwin-amd64-1.0.5.tar.gz生成bin資料夾,將bin放入fabric-samples資料夾https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html
7、開啟 sh 連線 或是 https://goo.gl/byy2Qj ,複製所有內容,終端輸入命令: vi init.sh , 貼上所有sh檔案內容。
註釋到37、38行,如下在行前家#即可
# echo "===> Downloading platform binaries"
# curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fab
按esc退出編輯,輸入 :wq(儲存並退出) 按enter 退出vim編輯模式,返回終端命令列。
8、下載 docker image, 執行init.sh檔案:先授權,終端輸入:chmod 777 init.sh (777代表授權init.sh可讀可寫許可權);enter後在輸入 ./init.sh(請先在docker的preference裡的daemon裡的registry mirrors中新增代理下載地址http://8890cb8b.m.daocloud.io,以保證快速下載
官方文件:https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html