开始hyperledger fabric之旅(1)

in #hyperledger7 years ago (edited)

背景介绍

超级账本(hyperledger)是Linux基金会和IBM共同发起的、专为商业而生的(企业级)区块链技术。作为hyperledger重要的子项目,首个可用于构建应用的产品级解决方案Fabric 1.0的正式版已经发布。

项目地址

fabric

https://github.com/hyperledger/fabric

fabric-ca

https://github.com/hyperledger/fabric-ca

fabric-sdk-node

https://github.com/hyperledger/fabric-sdk-node

fabric-sdk-java

https://github.com/hyperledger/fabric-sdk-java

fabric-sdk-go

https://github.com/hyperledger/fabric-sdk-go

SDK推荐使用fabric-sdk-node或fabric-sdk-java,这两个SDK项目目前贡献者比较多,项目比较稳定。同时如果对fabric-sdk-go感兴趣,可以尝鲜,可以成为贡献者参与项目维护。

另外你可以观看IBM精心策划的HyperLedger Fabric系列微讲堂在线视频学习Fabric

环境准备

操作系统
vagrant@ubuntu:~$ uname -a
Linux ubuntu 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
docker
vagrant@ubuntu:~$ docker -v
Docker version 1.13.0, build 49bf474
docker-compose
vagrant@ubuntu:~$ docker-compose -v
docker-compose version 1.11.2, build dfed245
go
vagrant@ubuntu:~$ go version
go version go1.7.3 linux/amd64

下载Fabric 1.0的docker镜像

docker pull hyperledger/fabric-orderer:x86_64-1.0.0
docker pull hyperledger/fabric-peer:x86_64-1.0.0
docker pull hyperledger/fabric-zookeeper:x86_64-1.0.0
docker pull hyperledger/fabric-couchdb:x86_64-1.0.0
docker pull hyperledger/fabric-kafka:x86_64-1.0.0
docker pull hyperledger/fabric-ca:x86_64-1.0.0
docker pull hyperledger/fabric-ccenv:x86_64-1.0.0
docker pull hyperledger/fabric-javaenv:x86_64-1.0.0
docker pull hyperledger/fabric-tools:x86_64-1.0.0

docker tag hyperledger/fabric-orderer:x86_64-1.0.0 hyperledger/fabric-orderer:latest
docker tag hyperledger/fabric-peer:x86_64-1.0.0 hyperledger/fabric-peer:latest
docker tag hyperledger/fabric-zookeeper:x86_64-1.0.0 hyperledger/fabric-zookeeper:latest
docker tag hyperledger/fabric-couchdb:x86_64-1.0.0 hyperledger/fabric-couchdb:latest
docker tag hyperledger/fabric-kafka:x86_64-1.0.0 hyperledger/fabric-kafka:latest
docker tag hyperledger/fabric-ca:x86_64-1.0.0 hyperledger/fabric-ca:latest
docker tag hyperledger/fabric-ccenv:x86_64-1.0.0 hyperledger/fabric-ccenv:latest
docker tag hyperledger/fabric-javaenv:x86_64-1.0.0 hyperledger/fabric-javaenv:latest
docker tag hyperledger/fabric-tools:x86_64-1.0.0 hyperledger/fabric-tools:latest

下载fabric-samples源码

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

下载bin二进制文件

curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.0.sh | bash

启动网络

./byfn.sh -m up

1.png
2.png

恭喜你,你已经成功运行了一个Fabric网络,并执行了智能合约,脚本具体执行逻辑,下次介绍

清除网络

./byfn.sh -m down

Sort:  

Congratulations @cophey! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Vote
You published your First Post

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @cophey! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You got a First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @cophey! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Comment

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @cophey! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @cophey! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 61059.95
ETH 2677.49
USDT 1.00
SBD 2.61