hyperledger fabric 1.0環境搭建出錯記錄
cp: cannot stat 'build/docker/gotools/bin/protoc-gen-go': No such file or directory(找不到protoc-gen-go檔案)
編譯生成 protoc-gen-go
#編譯生成 protoc-gen-go
cd $GOPATH
gopm get -g -d github.com/golang/protobuf/protoc-gen-go
go install github.com/golang/protobuf/protoc-gen-go
#確認在$GOPATH/bin出現protoc-gen-go執行檔案
如果出現檔案或者命令沒找到的錯誤,複製go 的相關檔案到 fabric 編譯環境
cp $GOPATH/bin/protoc-gen-go $GOPATH/src/github.com/hyperledger/fabric/build/docker/gotools/bin/
cp $GOPATH/bin/gocov $GOPATH/src/github.com/hyperledger/fabric/build/docker/gotools/bin/
錯誤:
執行make docker遇到:core/chaincode/shim/java/javabuild.sh: line 51: gradle: command not found
解決辦法:刪除openjdk
安裝:oracle jdk1.8
手動gradle,註釋掉core/chaincode/shim/java/javabuild.sh裡面的gradle命令
啟動 ./network_setup.sh up
錯誤:2017-09-12 14:17:49.952 UTC [grpc] Printf -> DEBU 003 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 211.139.178.49:7050: i/o timeout"; Reconnecting to {orderer.example.com:7050
<nil>}
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================
解決辦法:
修改宿主機hosts /etc/hosts ,在實際環境中,建議通過配置 DNS 而不是修改 /etc/hosts 檔案
127.0.0.1 orderer.example.com
修改 base/peer-base.yaml,新增 volumes:
volumes:
-/etc/hosts:/etc/hosts
錯誤:不能生成創世塊
解決辦法:
[email protected]:~/go/src/github.com/hyperledger/fabric/examples/e2e_cli/channel-artifacts# ls
channel.tx genesis.block Org1MSPanchors.tx Org2MSPanchors.tx
[email protected]:~/go/src/github.com/hyperledger/fabric/examples/e2e_cli/channel-artifacts# rm -rf genesis.block/
錯誤:
[[email protected] e2e_cli]# ../../build/bin/configtxgen -profile TwoOrgsOrdererGenesis
2017-09-17 05:54:50.525 PDT [common/configtx/tool] main -> INFO 001 Loading configuration
2017-09-17 05:54:50.525 PDT [common/configtx/tool/localconfig] Load -> CRIT 002 Error reading configuration: Unsupported Config Type ""
2017-09-17 05:54:50.525 PDT [common/configtx/tool] func1 -> ERRO 003 Could not find configtx.yaml. Please make sure that FABRIC_CFG_PATH is set to a path which contains configtx.yaml
解決辦法:
[[email protected] e2e_cli]# export FABRIC_CFG_PATH=$PWD
[[email protected] e2e_cli]# ../../build/bin/configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
錯誤:
cli | 2017-09-19 14:58:59.485 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AC3060A1508021A0608B3E184CE0522...EBE756E2B3F85609A68E923C9B9499B3
cli | 2017-09-19 14:58:59.485 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: 57743FC2DDB7C9C207351F728119716FF214994F050D89C3D19805B9923A5DA4
cli | Error: Got unexpected status: BAD_REQUEST
cli | Usage:
cli | peer channel create [flags]
cli |
cli | Flags:
cli | -c, --channelID string In case of a newChain command, the channel ID to create.
cli | -f, --file string Configuration transaction file generated by a tool such as configtxgen for submitting to orderer
cli | -t, --timeout int Channel creation timeout (default 5)
cli |
cli | Global Flags:
cli | --cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
cli | --logging-level string Default logging level and overrides, see core.yaml for full syntax
cli | -o, --orderer string Ordering service endpoint
cli | --test.coverprofile string Done (default "coverage.cov")
cli | --tls Use TLS when communicating with the orderer endpoint
cli | -v, --version Display current version of fabric peer server
cli |
cli | !!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
cli | ================== ERROR !!! FAILED to execute End-2-End Scenario ==================
cli |
cli | sleep: missing operand
cli | Try 'sleep --help' for more information.
解決辦法:
類似這樣的錯誤,是因為channel已經建立,命名衝突
<EXACT_TIMESTAMP> UTC [msp] Sign -> DEBU 064 Sign: digest: 5ABA6805B3CDBAF16C6D0DCD6DC439F92793D55C82DB130206E35791BCF18E5F
Error: Got unexpected status: BAD_REQUEST
Usage:
peer channel create [flags]
- 1
- 2
- 3
- 4
解決辦法:移除docker,重新啟動。執行最後一個命令即可
1)刪除一個容器 docker rm
2)強制刪除一個容器 docker rm -f
3)強制刪除全部容器 docker rm -f $(docker ps -aq)
$GOPATH
cp: cannot stat 'build/docker/gotools/bin/protoc-gen-go': No such file or directory(找不到protoc-gen-go檔案)
編譯生成 protoc-gen-go
#編譯生成 protoc-gen-go
cd $GOPATH
gopm get -g -d github.com/golang/protobuf/protoc-gen-go
go install github.com/golang/protobuf/protoc-gen-go
#確認在$GOPATH/bin出現protoc-gen-go執行檔案
如果出現檔案或者命令沒找到的錯誤,複製go 的相關檔案到 fabric 編譯環境
cp $GOPATH/bin/protoc-gen-go $GOPATH/src/github.com/hyperledger/fabric/build/docker/gotools/bin/
cp $GOPATH/bin/gocov $GOPATH/src/github.com/hyperledger/fabric/build/docker/gotools/bin/
錯誤:
執行make docker遇到:core/chaincode/shim/java/javabuild.sh: line 51: gradle: command not found
安裝:oracle jdk1.8