Hyperledger Fabric 安装(版本1.0.0-beta)

经过几天的摸索,终于成功安装Fabric 安装(版本1.0.0-beta),另外还了解到,每tag 安装有所不一样

root@fabric03 e2e_cli]# git tag 
baseimage-v0.0.11
v0.6.0-preview
v0.6.1-preview
v1.0.0
v1.0.0-alpha
v1.0.0-alpha2
v1.0.0-beta
v1.0.0-rc1
v1.0.1
v1.0.2
v1.0.3
v1.0.4
v1.0.5
v1.0.6
v1.1.0
v1.1.0-alpha
v1.1.0-preview
v1.1.0-rc1

现在把安装v1.0.0-beta版本的步骤记录下来,以下是通过docker-compose工具部署的


1.准备环境

安装 docker git golang docker-compose 比较简单 在这里就不详细说了

[root@fabric03 e2e_cli]# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
yum install docker git golang python-pip
pip install --upgrade pip
pip install docker-compose

2.下载源码

注意要设置GOPATH="/opt/gopath"

mkdir -p /opt/gopath/src/github.com/hyperledger && cd /opt/gopath/src/github.com/hyperledger

git clone https://github.com/hyperledger/fabric.git

git checkout v1.0.0-beta

3.编译以及下载镜像

生成 configtxgen

[root@fabric03 e2e_cli]# pwd 
/opt/gopath/src/github.com/hyperledger/fabric/
[root@fabric03 e2e_cli]# make configtxgen

下载镜像

root@fabric03 e2e_cli]# bash download-dockerimages.sh 
===> Pulling fabric Images
==> FABRIC IMAGE: peer
...
===> List out hyperledger docker images
docker.io/hyperledger/fabric-tools       x86_64-1.1.0-alpha   b7b3d30505d4        7 weeks ago         1.44 GB
docker.io/hyperledger/fabric-tools       x86_64-1.0.0-beta    ae6b0f53cb70        9 months ago        1.32 GB
hyperledger/fabric-tools                 latest               ae6b0f53cb70        9 months ago        1.32 GB
hyperledger/fabric-couchdb               latest               31bbbec3d853        9 months ago        1.48 GB
docker.io/hyperledger/fabric-couchdb     x86_64-1.0.0-beta    31bbbec3d853        9 months ago        1.48 GB
docker.io/hyperledger/fabric-kafka       x86_64-1.0.0-beta    c4ac1c9a4797        9 months ago        1.3 GB
hyperledger/fabric-kafka                 latest               c4ac1c9a4797        9 months ago        1.3 GB
docker.io/hyperledger/fabric-zookeeper   x86_64-1.0.0-beta    2c4ebacb6f00        9 months ago        1.31 GB
hyperledger/fabric-zookeeper             latest               2c4ebacb6f00        9 months ago        1.31 GB
docker.io/hyperledger/fabric-orderer     x86_64-1.0.0-beta    11ff350dd297        9 months ago        179 MB
hyperledger/fabric-orderer               latest               11ff350dd297        9 months ago        179 MB
docker.io/hyperledger/fabric-peer        x86_64-1.0.0-beta    e01c2b645f11        9 months ago        182 MB
hyperledger/fabric-peer                  latest               e01c2b645f11        9 months ago        182 MB
docker.io/hyperledger/fabric-javaenv     x86_64-1.0.0-beta    61c188dca542        9 months ago        1.42 GB
hyperledger/fabric-javaenv               latest               61c188dca542        9 months ago        1.42 GB
docker.io/hyperledger/fabric-ccenv       x86_64-1.0.0-beta    7034cca1918d        9 months ago        1.29 GB
hyperledger/fabric-ccenv                 latest               7034cca1918d        9 months ago        1.29 GB
docker.io/hyperledger/fabric-ca          x86_64-1.0.0-beta    e549e8c53c2e        9 months ago        238 MB
hyperledger/fabric-ca                    latest               e549e8c53c2e        9 months ago        238 MB

[root@fabric03 e2e_cli]# ./generateArtifacts.sh qinzhao
qinzhao

Building cryptogen
make: 进入目录“/opt/gopath/src/github.com/hyperledger/fabric”
Building release/linux-amd64/bin/configtxgen for linux-amd64
mkdir -p release/linux-amd64/bin
CGO_CFLAGS=" " GOOS=linux GOARCH=amd64 go build -o /opt/gopath/src/github.com/hyperledger/fabric/release/linux-amd64/bin/configtxgen -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/configtx/tool/configtxgen/metadata.Version=1.0.0-beta" github.com/hyperledger/fabric/common/configtx/tool/configtxgen
Building release/linux-amd64/bin/cryptogen for linux-amd64
mkdir -p release/linux-amd64/bin
CGO_CFLAGS=" " GOOS=linux GOARCH=amd64 go build -o /opt/gopath/src/github.com/hyperledger/fabric/release/linux-amd64/bin/cryptogen -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/tools/cryptogen/metadata.Version=1.0.0-beta" github.com/hyperledger/fabric/common/tools/cryptogen
Building release/linux-amd64/bin/configtxlator for linux-amd64
mkdir -p release/linux-amd64/bin
CGO_CFLAGS=" " GOOS=linux GOARCH=amd64 go build -o /opt/gopath/src/github.com/hyperledger/fabric/release/linux-amd64/bin/configtxlator -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/tools/configtxlator/metadata.Version=1.0.0-beta" github.com/hyperledger/fabric/common/tools/configtxlator
mkdir -p release/linux-amd64/install
cat: release/linux-amd64/install/../../templates/get-docker-images.in: 没有那个文件或目录
make: 离开目录“/opt/gopath/src/github.com/hyperledger/fabric”

##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
org1.example.com
2018-03-18 15:25:10.776 CST [bccsp] GetDefault -> WARN 001 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.798 CST [bccsp] GetDefault -> WARN 002 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.800 CST [bccsp] GetDefault -> WARN 003 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.801 CST [bccsp] GetDefault -> WARN 004 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.803 CST [bccsp] GetDefault -> WARN 005 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
org2.example.com
2018-03-18 15:25:10.805 CST [bccsp] GetDefault -> WARN 006 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.808 CST [bccsp] GetDefault -> WARN 007 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.809 CST [bccsp] GetDefault -> WARN 008 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.811 CST [bccsp] GetDefault -> WARN 009 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.812 CST [bccsp] GetDefault -> WARN 00a Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.814 CST [bccsp] GetDefault -> WARN 00b Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.815 CST [bccsp] GetDefault -> WARN 00c Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2018-03-18 15:25:10.817 CST [bccsp] GetDefault -> WARN 00d Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.

Using configtxgen -> /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/configtxgen
##########################################################
#########  Generating Orderer Genesis block ##############
##########################################################
2018-03-18 15:25:10.850 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2018-03-18 15:25:10.855 CST [msp] getMspConfig -> INFO 002 intermediate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/ordererOrganizations/example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/ordererOrganizations/example.com/msp/intermediatecerts: no such file or directory]
2018-03-18 15:25:10.855 CST [msp] getMspConfig -> INFO 003 crls folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/ordererOrganizations/example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/ordererOrganizations/example.com/msp/crls: no such file or directory]
2018-03-18 15:25:10.855 CST [msp] getMspConfig -> INFO 004 MSP configuration file not found at [/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/ordererOrganizations/example.com/msp/config.yaml]: [stat /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/ordererOrganizations/example.com/msp/config.yaml: no such file or directory]
2018-03-18 15:25:10.874 CST [msp] getMspConfig -> INFO 005 intermediate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org1.example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org1.example.com/msp/intermediatecerts: no such file or directory]
2018-03-18 15:25:10.875 CST [msp] getMspConfig -> INFO 006 crls folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org1.example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org1.example.com/msp/crls: no such file or directory]
2018-03-18 15:25:10.875 CST [msp] getMspConfig -> INFO 007 MSP configuration file not found at [/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org1.example.com/msp/config.yaml]: [stat /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org1.example.com/msp/config.yaml: no such file or directory]
2018-03-18 15:25:10.875 CST [msp] getMspConfig -> INFO 008 intermediate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org2.example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org2.example.com/msp/intermediatecerts: no such file or directory]
2018-03-18 15:25:10.875 CST [msp] getMspConfig -> INFO 009 crls folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org2.example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org2.example.com/msp/crls: no such file or directory]
2018-03-18 15:25:10.875 CST [msp] getMspConfig -> INFO 00a MSP configuration file not found at [/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org2.example.com/msp/config.yaml]: [stat /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org2.example.com/msp/config.yaml: no such file or directory]
2018-03-18 15:25:10.876 CST [common/configtx/tool] doOutputBlock -> INFO 00b Generating genesis block
2018-03-18 15:25:10.877 CST [common/configtx/tool] doOutputBlock -> INFO 00c Writing genesis block

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
2018-03-18 15:25:10.892 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2018-03-18 15:25:10.895 CST [common/configtx/tool] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2018-03-18 15:25:10.895 CST [common/configtx/tool] doOutputChannelCreateTx -> INFO 003 Writing new channel tx

#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#################################################################
2018-03-18 15:25:10.912 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2018-03-18 15:25:10.915 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2018-03-18 15:25:10.916 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
2018-03-18 15:25:10.931 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2018-03-18 15:25:10.934 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2018-03-18 15:25:10.934 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

4.运行测试

[root@fabric03 e2e_cli]# bash network_setup.sh up
setting to default channel 'mychannel'
mychannel

Using cryptogen -> /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/cryptogen

##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
org1.example.com
...
Creating peer0.org2.example.com ... 
Creating cli ... 

 ____    _____      _      ____    _____           _____   ____    _____ 
/ ___|  |_   _|    / \    |  _ \  |_   _|         | ____| |___ \  | ____|
\___ \    | |     / _ \   | |_) |   | |    _____  |  _|     __) | |  _|  
 ___) |   | |    / ___ \  |  _ <    | |   |_____| | |___   / __/  | |___ 
|____/    |_|   /_/   \_\ |_| \_\   |_|           |_____| |_____| |_____|

Channel name : mychannel
Creating channel...
2018-03-18 07:29:02.837 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2018-03-18 07:29:02.837 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2018-03-18 07:29:02.837 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AAD070A6708031A0C08BEAAB8D50510...6D7963631A0A0A0571756572790A0161 
2018-03-18 07:29:02.837 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: 220C2ABEF437BC9AC0C73643A84427F51BBF760C79620F4BB4D06A5B517AC3A2 
Query Result: 90
2018-03-18 07:29:23.748 UTC [main] main -> INFO 008 Exiting.....
===================== Query on PEER3 on channel 'mychannel' is successful ===================== 

===================== All GOOD, End-2-End execution completed ===================== 


 _____   _   _   ____            _____   ____    _____ 
| ____| | \ | | |  _ \          | ____| |___ \  | ____|
|  _|   |  \| | | | | |  _____  |  _|     __) | |  _|  
| |___  | |\  | | |_| | |_____| | |___   / __/  | |___ 
|_____| |_| \_| |____/          |_____| |_____| |_____|

搞定

[root@fabric03 e2e_cli]# docker ps 
CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS              PORTS                                              NAMES
62664eef4f38        dev-peer1.org2.example.com-mycc-1.0   "chaincode -peer.a..."   10 minutes ago      Up 10 minutes                                                          dev-peer1.org2.example.com-mycc-1.0
fef4f609fb5b        dev-peer0.org1.example.com-mycc-1.0   "chaincode -peer.a..."   10 minutes ago      Up 10 minutes                                                          dev-peer0.org1.example.com-mycc-1.0
274082c69284        dev-peer0.org2.example.com-mycc-1.0   "chaincode -peer.a..."   10 minutes ago      Up 10 minutes                                                          dev-peer0.org2.example.com-mycc-1.0
db08126b70d7        hyperledger/fabric-tools              "/bin/bash -c './s..."   11 minutes ago      Up 11 minutes                                                          cli
99b641c25b69        hyperledger/fabric-peer               "peer node start"        11 minutes ago      Up 11 minutes       0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp     peer0.org2.example.com
3749d0011992        hyperledger/fabric-orderer            "orderer"                11 minutes ago      Up 11 minutes       0.0.0.0:7050->7050/tcp                             orderer.example.com
6cf95ca6553d        hyperledger/fabric-peer               "peer node start"        11 minutes ago      Up 11 minutes       0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp     peer0.org1.example.com
37be876216f5        hyperledger/fabric-peer               "peer node start"        11 minutes ago      Up 11 minutes       0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp     peer1.org1.example.com
75ae8f6cc10d        hyperledger/fabric-peer               "peer node start"        11 minutes ago      Up 11 minutes       0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp   peer1.org2.example.com

参考文档

http://hyperledger-fabric.readthedocs.io/en/latest/samples.html

http://hyperledger-fabric.readthedocs.io/en/latest/samples.html#binaries

http://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在线安装eclipse-site-1.0.0-rc2,您可以按照以下步骤行操作: 1. 打开Eclipse IDE(集成开发环境)。 2. 在Eclipse菜单中,选择“Help”(帮助)选项。 3. 在“Help”下拉菜单中,选择“Eclipse Marketplace”(Eclipse市场)选项。 4. 弹出“Eclipse Marketplace”对话框后,点击该对话框中的“Search”(搜索)框。 5. 输入“eclipse-site-1.0.0-rc2”作为搜索关键字,然后按下Enter键。 6. 在搜索结果列表中找到“eclipse-site-1.0.0-rc2”插件。您可以通过查看插件的描述和评级来确定是否是您所需要的版本。 7. 点击插件旁边的“Go”(前往)按钮,该按钮会将您带到插件的详细信息页面。 8. 在插件详细信息页面上,您将找到插件的安装按钮。点击该按钮开始安装过程。 9. 安装过程可能需要一些时间,因此请耐心等待。在安装完成之前,请不要关闭Eclipse IDE。 10. 安装完成后,您将收到一个消息提示,提示您重新启动Eclipse IDE。按照提示重启Eclipse IDE。 11. 重启后,您已成功完成eclipse-site-1.0.0-rc2的在线安装。您可以使用该插件行开发和其他相应的操作。 请注意,以上步骤是基于Eclipse IDE的标准安装过程。根据您使用的Eclipse的版本和具体环境,某些步骤可能会有所不同。因此,在安装之前,最好先检查相关文档或向社区寻求帮助,以确保正确安装所需插件。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值