HyperLedger Fabric中fabric-samples 安装

Posted tinghl

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HyperLedger Fabric中fabric-samples 安装相关的知识,希望对你有一定的参考价值。

官网文档:https://hyperledger-fabric.readthedocs.io/en/release-1.0/samples.html

版本:v1.0

1.下载fabric-samples

选择文件位置,下载fabric-samples

git clone https://github.com/hyperledger/fabric-samples.git
cd fabric-samples

2.下载Platform-specific Binaries

官方文档指导方式为:

curl -sSL https://goo.gl/kFFqh5 | bash -s 1.0.6

但是第二步操作起来,我这边会出现如下错误:

[email protected]:~/go/src/github.com/hyperledger/fabric-samples$ curl -sSL https://goo.gl/kFFqh5 | bash -s 1.0.6
curl: (7) Failed to connect to goo.gl port 443: Connection timed out

所以,我采取了其他方式下载必需的二进制代码:

进入fabric-samples文件夹下的scripts文件夹,运行其中的bootstrap.sh脚本

(参考来源:https://github.com/hyperledger/fabric-samples)

cd scripts
./bootstrap.sh 

3.测试

运行结束后,进行测试。我们使用first-network 例子。

cd first-network
#创建genesis block .
/byfn.sh -m generate
#启动网络 .
/byfn.sh -m up

运行结果:

Starting with channel ‘mychannel‘ and CLI timeout of ‘10000‘
Continue (y/n)?y
proceeding ...
Creating network "net_byfn" with the default driver
Creating peer0.org1.example.com
Creating peer1.org1.example.com
Creating peer0.org2.example.com
Creating orderer.example.com
Creating peer1.org2.example.com
Creating cli


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

Channel name : mychannel
Creating channel...

................
2017-05-16 17:08:01.366 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2017-05-16 17:08:01.366 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2017-05-16 17:08:01.366 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AB1070A6708031A0C08F1E3ECC80510...6D7963631A0A0A0571756572790A0161
2017-05-16 17:08:01.367 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: E61DB37F4E8B0D32C9FE10E3936BA9B8CD278FAA1F3320B08712164248285C54
Query Result: 90
2017-05-16 17:08:15.158 UTC [main] main -> INFO 008 Exiting.....
===================== Query on PEER3 on channel ‘mychannel‘ is successful =====================

===================== All GOOD, BYFN execution completed =====================


 _____   _   _   ____
| ____| |  | | |  _ |  _|   |  | | | | | |
| |___  | |  | | |_| |
|_____| |_| _| |____/

 

4.结束网络运行

./byfn.sh -m down

 





以上是关于HyperLedger Fabric中fabric-samples 安装的主要内容,如果未能解决你的问题,请参考以下文章

Hyperledger Fabric 1.0 从零开始——Fabric源码及镜像文件处理

Hyperledger Fabric入门 -------- ( Hyperledger-fabric-doc.pdf)

Hyperledger Fabric 1.1安装部署-Fabric Samples

Fabric系列 - Hyperledger开源项目介绍

Fabric系列 - Hyperledger开源项目介绍

Hyperledger Fabric 智能合约实战 安装fabric