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