區塊鏈小白,哦不大白,啥都不懂,踩坑踩的太多了
部署了兩個月有點頭目了,記錄一下,好記性不如爛筆頭嘛
一、運行 ./network.sh deployCC 命令時出現以下錯誤
Error: failed to normalize chaincode path: ‘go list’ failed with: go: github.com/golang/protobuf@v1.3.2: Get “https://proxy.golang.org/github.com/golang/protobuf/@v/v1.3.2.mod”: dial tcp 34.64.4.113:443: connect: connection refused: exit status 1
Chaincode packaging on peer0.org1 has failed
Deploying chaincode failed

解決辦法
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
再次運行 ./network.sh deployCC 就沒error了

二、運行yum update時出現以下錯誤
已加載插件: fastestmirror,security
/var/run/yum.pid已被鎖定,PID為1610的另一個程式正在運行,
解決辦法
洗掉檔案后再次運行yum即可,
rm -f /var/run/yum.pid
三、此步設定環境變數后執行命令出現錯誤

命令:
peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"function":"InitLedger","Args":[]}'
Error: error getting client certificate: failed to load config for PeerClient: unable to load peer.tls.rootcert.file: open /root/go/src/github.com/hyperledger/fabric/fabric-samples/config/tls/ca.crt: no such file or directory

原因:前邊設定環境變數的五條命令我是一起復制粘貼上去運行的
解決辦法
每條命令分別運行

第一條命令export CORE_PEER_TLS_ENABLED=true我前邊執行過一次,這里不再執行,
運行出這個結果即成功了
INFO 001 Chaincode invoke successful. result: status:200
第一次接觸centos 7,hyperledger fabric,如有錯誤還請指教,互相學習,學習愉快!!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/199497.html
標籤:java
下一篇:CSS的文本樣式
