官网文档: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.6curl: (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
原文地址:https://www.cnblogs.com/TingHL/p/9496428.html
时间: 2024-10-09 19:42:01