【发布时间】:2019-03-25 17:18:56
【问题描述】:
问题:
我对使用 Hyperledger 的区块链非常陌生。我正在自定义 startNetwork.sh 脚本。所以我创造了这样的东西。
# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1
#removing all the containers
echo "#### Removing all the containers"
echo ""
echo ""
docker rm -f $(docker ps -aq)
echo ""
echo ""
#prune the volumes
echo "#### Prune the network "
echo ""
echo ""
docker volume prune
echo ""
echo ""
#down the previously build networks
echo "##### Removing networks and containers #####"
echo ""
echo ""
docker-compose -f docker-compose-cli.yaml down --volumes
echo ""
echo ""
#Up the network
echo ""
echo "##### Network is under the build #####"
echo ""
echo ""
docker-compose -f docker-compose-cli.yaml up -d
echo ""
echo ""
#starting the cli
echo ""
echo ""
echo "##### Starting the cli incase if it is sleep #####"
docker start cli
echo ""
echo ""
docker exec -e "CORE_PEER_LOCALMSPID=PSPMSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/psp.example.com/users/Admin@psp.example.com/msp" -e "CORE_PEER_ADDRESS=peer0.psp.example.com:7051" -e "CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/psp.example.com/peers/peer0.psp.example.com/tls/ca.crt" peer0.psp.example.com peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
但是当我在 bash 终端上点击 ./startNetwork.sh 时,会出现
的错误2019-03-18 06:42:52.162 UTC [main] InitCmd -> ERRO 001 Cannot run peer because cannot init crypto, folder "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/psp.example.com/users/Admin@psp.example.com/msp" does not exist
但是当我在 cli 容器中发出这个命令时,它运行成功了。有人可以帮我修改这个文件以消除这个错误吗?谢谢!
【问题讨论】:
-
您好,我怀疑这里的答案 -> stackoverflow.com/questions/50229686/… 和这里 -> 将帮助您解决自定义脚本路径问题:stackoverflow.com/questions/49551179/…