Ubuntu16.04下安装Hyperledger Fabric 1.0.0
系统环境
* Ubuntu: 16.04
* Go: 1.9.2
* NodeJS: v6.12.0
* Docker: 17.09.0-ce
* HyperLedger Fabric: 1.0.0
安装步骤
1、安装NodeJS,参考《Ubuntu 16.04 安装NodeJs》
2、安装Go,参考《Ubuntu 16.04 安装Go 1.9.2》
3、安装Docker-CE,参考《Ubuntu 16.04安装Docker-CE》
4、安装fabric相关的images
4.1、从fabric的github库(https://github.com/hyperledger/fabric/tree/release/scripts)中down所需的版本,此处我们安装的1.0.0版本,down下“bootstrap-1.0.0.sh“文件
4.2、执行该文件来安装fabric所需的docker镜像
cat bootstrap-1.0.0.sh | sudo -E bash
注意:如果是在windows环境下下载的“bootstrap-1.0.0.sh”文件并上传到Linux中的,因为换行符的不兼容,上述命令如果执行失败,就用下面的命令代替:
cat bootstrap-1.0.0.sh | dos2unix |sudo -E bash
4.3、安装完毕会展示出所有的镜像(或者使用“docker images”命令)
hyperledger/fabric-tools latest 0403fd1c72c7 4 months ago 1.32GB hyperledger/fabric-tools x86_64-1.0.0 0403fd1c72c7 4 months ago 1.32GB hyperledger/fabric-couchdb latest 2fbdbf3ab945 4 months ago 1.48GB hyperledger/fabric-couchdb x86_64-1.0.0 2fbdbf3ab945 4 months ago 1.48GB hyperledger/fabric-kafka latest dbd3f94de4b5 4 months ago 1.3GB hyperledger/fabric-kafka x86_64-1.0.0 dbd3f94de4b5 4 months ago 1.3GB hyperledger/fabric-zookeeper latest e545dbf1c6af 4 months ago 1.31GB hyperledger/fabric-zookeeper x86_64-1.0.0 e545dbf1c6af 4 months ago 1.31GB hyperledger/fabric-orderer latest e317ca5638ba 4 months ago 179MB hyperledger/fabric-orderer x86_64-1.0.0 e317ca5638ba 4 months ago 179MB hyperledger/fabric-peer latest 6830dcd7b9b5 4 months ago 182MB hyperledger/fabric-peer x86_64-1.0.0 6830dcd7b9b5 4 months ago 182MB hyperledger/fabric-javaenv latest 8948126f0935 4 months ago 1.42GB hyperledger/fabric-javaenv x86_64-1.0.0 8948126f0935 4 months ago 1.42GB hyperledger/fabric-ccenv latest 7182c260a5ca 4 months ago 1.29GB hyperledger/fabric-ccenv x86_64-1.0.0 7182c260a5ca 4 months ago 1.29GB hyperledger/fabric-ca latest a15c59ecda5b 4 months ago 238MB hyperledger/fabric-ca x86_64-1.0.0 a15c59ecda5b 4 months ago 238MB
运行已有项目
* 进到fabric-samples/first-network
cd fabric-samples/first-network/
* 生成配置文件
sudo ./byfn.sh -m generate
选择同意,会默认生成mychannel
* 起动项目
sudo ./byfn.sh -m up
* 成功后关闭
sudo ./byfn.sh -m down