Summary of Hyperledger Fabric 2.4.4 installation and deployment problems

1. Error: error getting endorser client for channel: endorser client failed to connect to peer0 This problem:

At this time we operate like this:

First we stop the network

We are typing: sudo vim /etc/resolv.conf

Let's comment out the sentence optins for him, just add # in front.

Press :wq! to save and exit.
Just restart the network.

2.

An error is reported when deploying the chaincode in fabric-sample. The reason for the error is that the connection that the download depends on is rejected, as shown below

Error: failed to normalize chaincode path: 'go list' failed with: go: github.com/golang/[email protected]: Get "https://proxy.golang.org/github.com/golang/protobuf/@v/v1.3.2.mod": dial tcp 172.217.160.81:443: connect: connection refused: exit status 1


Solution, open GO111MODULEthe tool, replace the Go agent, enter the command line

go env -w GOPROXY=https://goproxy.io,direct
go env -w GO111MODULE=on

3.

The following error occurs when starting the chaincode or smart contract: deployCC.sh: line 59: go: command not found
/home/yangxiaohu/hyfa/fabric-samples/test-network
Finished vendoring Go dependencies
+ peer lifecycle chaincode package basic.tar .gz --path ../asset-transfer-basic/chaincode-go --lang golang --label basic_1.0+ res=1
Error: failed to normalize chaincode path: failed to determine module root: exec: "go" : executable file not found in $PATH Chaincode packaging has failed Deploying chaincode failed

Error analysis: The go environment cannot be found, and environment variables need to be set.

// (1)用户级别配置
sudo vi $HOME/.profile
export PATH=$PATH:/usr/local/go/bin
// (2)设置环境变量
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
// (3)生效配置
source $HOME/.profile

 Check go version:

go version

The chaincode can be restarted after displaying the version.

4. There is no problem with go environment variables under root user authority

Environment variable configuration for root user

  After configuring the JDK environment variables in /etc/profile, it is invalid for the root user.

  It should be noted here that the configuration for the root user needs to be configured separately in /root/.bashrc, otherwise when switching to the root user, some configured things will fail under the root user

おすすめ

転載: blog.csdn.net/m0_61970067/article/details/122270529