Error: error getting endorser client for invoke: endorser client failed to connect to localhost:7051

After installing the chain code and interacting with the network, it appears Error: error getting endorser client for invoke: endorser client failed to connect to localhost:7051: failed to create new connection: context deadline exceeded
that the environment variables are not set properly.
Set the environment variables as:

export FABRIC_CFG_PATH=/home/yulin/blockchain/fabric/Hyperledger/peer
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_ADDRESS=peer0.org1.example.com:7051
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp
export CORE_PEER_ADDRESS=localhost:7051

Guess you like

Origin blog.csdn.net/weixin_44029550/article/details/114890678