安裝、部署超級賬本(hyperledger 2.2)遇到的坑
安裝部署是按照官方檔案的步驟進行的
官方檔案連線:https://hyperledger-fabric.readthedocs.io/zh_CN/release-2.2
以下列出我在安裝時遇到的問題及解決辦法
curl: (7) Failed to connect to xxx port 443: Connection refused
搜尋xxx,我這裡演示的是Bit.ly,得到ip地址:67.199.248.10(選一個即可)
(2)替換系統的host檔案
這裡由於是系統檔案需要複製一份出來修改。
把 67.199.248.10 bit.ly 放在檔案最後儲存,最後再替換掉原本的。
(3)執行你要執行的命令就可以了
下載映象很慢或者總是不成功,可以設定映象加速器
這裡推薦阿里映象加速器:https://cr.console.aliyun.com/cn-hangzhou/mirrors
進入網站後需要註冊登陸,搜尋容器映象服務,點選映象中心>>映象加速器
就可以看到如何設定的教學了。
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': chaincode already successfully installed
獲取已新增到通道分類賬中的汽車列表,在test-network目錄下執行
peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}'
時,出現
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': chaincode already successfully installed
解決辦法:檢視報錯資訊,我們可以知道,鏈碼 fabcar 沒有在通道上被定義,所以我們進入對應目錄,執行啟動指令:cd /your path/fabric-samples/fabcar
後,執行./startFabric.sh
,等待完成即可。
最後再繼續執行之前的指令 peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}'
,可以得到如下結果:
[{"Key":"CAR0","Record":{"make":"Toyota","model":"Prius","colour":"blue","owner":"Tomoko"}},{"Key":"CAR1","Record":{"make":"Ford","model":"Mustang","colour":"red","owner":"Brad"}},{"Key":"CAR2","Record":{"make":"Hyundai","model":"Tucson","colour":"green","owner":"Jin Soo"}},{"Key":"CAR3","Record":{"make":"Volkswagen","model":"Passat","colour":"yellow","owner":"Max"}},{"Key":"CAR4","Record":{"make":"Tesla","model":"S","colour":"black","owner":"Adriana"}},{"Key":"CAR5","Record":{"make":"Peugeot","model":"205","colour":"purple","owner":"Michel"}},{"Key":"CAR6","Record":{"make":"Chery","model":"S22L","colour":"white","owner":"Aarav"}},{"Key":"CAR7","Record":{"make":"Fiat","model":"Punto","colour":"violet","owner":"Pari"}},{"Key":"CAR8","Record":{"make":"Tata","model":"Nano","colour":"indigo","owner":"Valeria"}},{"Key":"CAR9","Record":{"make":"Holden","model":"Barina","colour":"brown","owner":"Shotaro"}}]