1.问题:E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
原因:同时有两个apt在运行,需要删除锁定文件并重启服务
解决方案:
sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo apt update
ps -A | grep apt
kill -9 processnumber
./prereqs-ubuntu.sh
2.问题:You don't seem to have a generator with the name “hyperledger-composer:businessnetwork” installed.
原因:缺少安装步骤,安装缺失
解决方案:
npm install -g composer-cli@0.20
npm install -g composer-rest-server@0.20
npm install -g generator-hyperledger-composer@0.20
npm install -g yo
npm install -g composer-playground@0.20
3.问题:npm install -g composer-playground@0.20
npm ERR! Unexpected end of JSON input while parsing near '...30","composer-connect'
npm ERR! Unexpected end of JSON input while parsing near '...30","composer-connect'
原因:先清除缓存,再重新安装
解决方案:
npm cache clean --force
npm install -g composer-cli@0.20
4.问题:执行
composer network start --networkName tutorial-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card
出错
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: failed to execute transaction a659d1031b007a09748bb9a2bac810d9dabb113bf00ad09bf8afa5d5ed18b93f: failed to register tutorial-network:0.0.1 as launching: chaincode tutorial-network:0.0.1 has already been launched
Command failed
原因:下载过多,安装超时,再次安装部分重复导致安装失败
解决方案:
cd ..
./stopFabric.sh
./teardownFabric.sh
./startFabric.sh
./createPeerAdminCard.sh
cd ~/tutorial-network/
cd tutorial-network/
composer network install --card PeerAdmin@hlfv1 --archiveFile tutorial-network@0.0.1.bna
composer network start --networkName tutorial-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card
5.