區塊鏈Fabric——【MiniFabric部署】
If you like to learn Hyperledger Fabric or develop your smart contract, or just want to get a feel about Hyperledger Fabric, Minifabric is the tool to get you started. Minifabric can stand up a Fabric network on a small machine like a VirtualBox VM but also can deploy Fabric networks cross multiple production grade servers. Minifabric is small but it allows you to experience the full capabilities of Hyperledger Fabric. You will be able to try all Fabric operations such as channel create, channel join, chaincode install, approve, instantiation. It also supports channel update, private data collection, block query etc. All you need to start with is a docker (18.03 or newer) environment. Minifabric works on both OS X and Linux. Windows support is in the works. If you like to read more before jumping in, please read Minifabric User Guide. For those impatient, please follow the steps below to start things off.————摘自Minifabric官方Github自述
下面是博主自己的安裝程序,希望可以給大家提供一些借鑒
GitHub網址:
https://github.com/hyperledger-labs/minifabric
1.拉取鏡像檔案:
git clone https://github.com/hyperledger-labs/minifabric.git

2.創建兩個站點檔案夾:
mkdir site1
mkdir site2
3.復制站點檔案
cp ./minifabric/minifab ./site1
cp ./minifabric/minifab ./site2
cp ./minifabric/spec.yaml ./site1
cp ./minifabric/spec.yaml ./site2

4.修改站點site1的spec.yaml檔案
cd site1
vi spec.yaml

按下圖去掉標記行的注釋符,保存并退出

5.啟動一個完整的運行Fabric網路
./minifab up -e 7000 -n samplecc -p ''


6.重寫站點site2的spec.yaml檔案
cd ../
cd site2
rm -rf spec.yaml
vi spec.yaml

在打開的檔案內輸入以下內容,保存并退出
fabric:
peers:
- "peer1.org2.example.com"
- "peer2.org2.example.com"
goproxy: "https://goproxy.cn,direct"
7.啟動一個只有兩個對等節點的新組織
./minifab netup -e 7400 -o org2.example.com


8.將org2.example.com加入應用程式渠道
Mcp ./vars/JoinRequest_org2-example-com.json ../site1/vars/NewOrgJoinRequest,json
9.節點匯入,加入Fabric網路
cp ./vars/profiles/endpoints.yaml ../site2/vars
cd ../site2
./minifab nodeimport,join

10.安裝并允許samplecc
./minifab install,approve -n samplecc -p ''

11.批準org1和org2上的鏈碼
cd ../site1
./minifab approve,commit

12.在org2上發現并驗證鏈碼
cd ../site2
./minifab discover,stats

當出現上述狀態顯示時,表示你部署成功了!![撒花]
如果有什么問題,歡迎留言,也歡迎指正文章中的錯誤,

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/257855.html
標籤:區塊鏈
