天天看点

运行第一个Hyperledger Fabric程序

1.下载fabric源码。建立相应的文件目录,下载源码仓库。或者只下载download-dockerimages.sh

mkdir -p ~/go/src/github.com/hyperledger

cd ~/go/src/github.com/hyperledger

git clone

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

cd fabric

git checkout release-1.1

2.使用download-dockerimages.sh,下载fabric镜像文件

cd examples/e2e_cli/

source download-dockerimages.sh -c x86_64-1.1.0 -f x86_64-1.1.0

3.下载fabric-samples源码

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

4.运行balance-transfer。

1.修改package.json中的fabric-client和fabric-ca-client的版本为1.1.0。新增grpc:1.9.1,防止出现Cannot read property 'getConnectivityState' of undefined

2.按照README.md进行安装。

cnpm install

docker-compose -f artifacts/docker-compose.yaml up -d

PORT=4000 node app

5.使用POSTMAN进行测试

运行第一个Hyperledger Fabric程序

6.远程调试源码

启动应用,获取uuid

node --inspect app.js
运行第一个Hyperledger Fabric程序

远程端口映射

ssh -L 9221:localhost:9229 [email protected]

进入调试页面

chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost:9221/0867e9ef-36b9-4468-805d-0c67db284198

7.运行testAPIs.sh

安装jq

sudo apt-get install jq

运行testAPIs.sh

./testAPIs.sh