Fabric 環境搭建遇到問題及解決
Fabric 環境搭建遇到問題及解決
1、基本環境搭建
(1)下載原始碼
go get
緩慢:直接通過git clone下載
mkdir ~/go/src/github.com/hyperledger/ -p
git clone https://github.com/hyperledger/fabric.git
(2)編譯fabric檔案
編譯fabric檔案make all
時報錯
/usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:56:6: too many errors0000
Makefile:199: recipe for target 'build/bin/orderer' failed
make: *** [build/bin/orderer] Error 2
舊版本go殘留,刪除原版本重新安裝
rm /usr/local/go -rf
(3)編譯fabric檔案
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
卡住
目前發現是高概率卡住,多重試幾次
卡住可以修改代理
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
(4)編譯fabric檔案
Building github.com/client9/misspell/cmd/misspell -> misspell
go: github.com/AlekSi/gocov-xml@v0.0.0-20190121064608-3a14fb1c4737: Get "https://proxy.golang.org/github.com/%21alek%21si/gocov-xml/@v/v0.0.0-20190121064608-3a14fb1c4737.mod": dial tcp 216.58.200.241:443: i/o timeout
gotools.mk:39: recipe for target 'gotool.misspell' failed
make: *** [gotool.misspell] Error 1
(5)編譯fabric檔案
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz: temporary error (try again later)
ERROR: unsatisfiable constraints:
在images下面的五個資料夾中的Dockerfile檔案 From下面一行新增
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
2、執行byfn
(1)generate出錯
2020-04-12 09:03:11.604 UTC [common.tools.configtxgen.localconfig] completeInitialization -> PANI 004 etcdraft configuration missing
2020-04-12 09:03:11.604 UTC [common.tools.configtxgen] func1 -> PANI 005 etcdraft configuration missing
panic: etcdraft configuration missing [recovered]
panic: etcdraft configuration missing
goroutine 1 [running]:
github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc0000b3e40, 0x0, 0x0, 0x0)
/root/go/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:230 +0x545
...
github.com/hyperledger/fabric/internal/configtxgen/genesisconfig.Load(0x7ffd11f3d5cd, 0x17, 0x0, 0x0, 0x0, 0x0)
/root/go/src/github.com/hyperledger/fabric/internal/configtxgen/genesisconfig/config.go:247 +0x313
main.main()
/root/go/src/github.com/hyperledger/fabric/cmd/configtxgen/main.go:268 +0xf56
+ res=2
+ set +x
Failed to generate orderer genesis block...
目前原因未知,是2.0之後出現的問題,下載別人編譯好的configtxgen檔案就可以正常執行了
(2)部署chaincode出錯
+ set +x
Error: error getting chaincode bytes: failed to calculate dependencies: incomplete package: github.com/hyperledger/fabric-contract-api-go/contractapi
!!!!!!!!!!!!!!! Chaincode packaging on peer0.org1 has failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
需要配置go國內代理
go env -w GOPROXY=https://goproxy.cn
export GOPROXY=https://goproxy.cn
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
https://www.cnblogs.com/zoujiaojiao/p/12606909.html
(3)建立通道失敗
Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'mychannel': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application/Org2MSP be at version 0, but it is currently at version 1
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
未清除掛載掛在資訊volume和networks
清空所有未使用的docker掛載資訊(慎用)
docker volume prune
清理沒有再被任何容器引用的networks
docker network prune
(4)install chaincode error
Error: error getting chaincode deployment spec for mycc: error getting chaincode package bytes: failed to calculate dependencies: incomplete package: github.com/hyperledger/fabric-chaincode-go/pkg/cid
!!!!!!!!!!!!!!! Chaincode installation on peer0.org1 has failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
相同的還有github.com/hyperledger/fabric-chaincode-go/shim
錯誤
還有google.golang.org/protobuf/encoding/prototext
github.com/golang/protobuf/proto
github.com/hyperledger/fabric-protos-go/peer
google.golang.org/grpc
golang.org/x/net/trace
暫時的解決辦法
docker-compose.yaml
中新增volumes
- /root/go/src/:/opt/gopath/src/
然後手動把所有依賴放入對應的本地伺服器位置上
``
git clone https://github.com/protocolbuffers/protobuf-go.git
git clone https://github.com/hyperledger/fabric-protos-go.git
git clone https://github.com/grpc/grpc-go.git
git clone https://github.com/golang/net.git
git clone https://github.com/googleapis/go-genproto.git
git clone https://github.com/golang/sys.git
真正的解決辦法:需要go.mod go.sum等檔案可以參考chaincode/sacc
(5)approveformyorg超時
+ peer lifecycle chaincode approveformyorg --tls true --cafile /opt/gopath/src/github.com/hyperledg er/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer1.example.com/msp/tlscacerts /tlsca.example.com-cert.pem --channelID mychannel --name mycc --version 1 --init-required --package -id mycc_1:40aec53f0ee0193b0bd6b63862425298d90e9c3496a840bb54366b2fd66bd18f --sequence 1 --waitForE vent
+ set +x
2020-04-28 12:07:10.782 UTC [cli.lifecycle.chaincode] setOrdererClient -> INFO 001 Retrieved channe l (mychannel) orderer endpoint: orderer1.example.com:7050
Error: timed out waiting for txid on all peers
===================== Chaincode definition approved on peer0.org1 on channel 'mychannel' ========== ===========
可能是configtx.yaml中的OrdererEndpoints
填寫錯誤 找不到節點
相關文章
- CentOS下搭建LAMP環境及遇到的問題CentOSLAMP
- Windows 10 下搭建 Homestead 環境 Vagrant up 所遇到的問題及解決Windows
- react native搭建環境時遇到的問題React Native
- 解決所有環境問題
- WSL中配置EDA環境:遇到的問題以及解決辦法
- Hyperledger Fabric 2.x 環境搭建
- 搭建TS環境遇到的問題
- webpack(1)安裝環境與解決環境問題Web
- Harbor搭建及配置 問題解決
- 搭建Laravel Sail開發環境遇到的版本不匹配問題解決方法LaravelAI開發環境
- 搭建Hyperledger Fabric 2.3.2開發環境及簡單案例執行開發環境
- 快速搭建一個Fabric 1.0的環境
- Selenium+Python自動化測試環境搭建和搭建過程遇到的問題解Python
- 解決NLTK包下載出錯問題及NLP環境測試
- 近期工作遇到的問題及解決方式收藏
- nodejs 近期所遇到的問題及解決NodeJS
- 裝SAP GUI時遇到的問題及解決GUI
- 用conda安裝庫時遇到環境查詢失敗問題解決方案
- redis 安裝及安裝遇到的問題解決Redis
- windows安裝tomcat遇到問題及解決方案WindowsTomcat
- 遇到問題的解決方法
- 一、Windows 環境搭建問題彙總Windows
- AWD平臺搭建及遇到的問題分析
- FastDFS與Nginx的搭建及遇到的問題ASTNginx
- 區塊鏈學習之Fabric的環境搭建區塊鏈
- 嵌入式Linux開發環境搭建,問題ping、nfs的解決Linux開發環境NFS
- 原始碼安裝apache(附遇到的問題及解決)原始碼Apache
- UG程式設計常遇到的問題及解決方法程式設計
- VMware下安裝Ubuntu遇到的問題及解決方案Ubuntu
- 行者APP適配國外環境問題解決APP
- iOS 搭建XMPP環境時新增依賴庫報錯及解決iOS
- 環境搭建及介紹
- PHP環境配置-虛擬機器配置及問題解決(VM下的NAT)PHP虛擬機
- linux伺服器環境搭建問題Linux伺服器
- 深入理解Fabric環境搭建的詳細過程
- Mac環境中搭建Hadoop相關問題及處理辦法MacHadoop
- 基於Debian搭建Hyperledger Fabric 2.4開發環境及執行簡單案例開發環境
- MAC 安裝 VMAF 遇到的問題及解決方法記錄Mac