在安装完链码,要与网络进行交互时,出现Error: error getting endorser client for invoke: endorser client failed to connect to localhost:7051: failed to create new connection: context deadline exceeded
说明环境变量没有设置好。
设置环境变量为:
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/Admin@org1.example.com/msp