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.gitcd 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進行測試
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsIyZuBnL5kTN4E2MwUTZ1MGNwMjMldTNjFGMjBzMmlzMhdjZxQmZyEWNmZGMh9CXt92Yu4GZjlGbh5SZslmZxl3Lc9CX6MHc0RHaiojIsJye.png)
6.遠端調試源碼
啟動應用,擷取uuid
node --inspect app.js
遠端端口映射
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