简体   繁体   中英

Hyperledger Fabric byfn instantiate fails - chaincode exists

Hi All I have a 3 peer 1 orderer organization running and I want to bring the network down and clear ledgers while keeping the crypto. Here is what I have run to bring network down:

first on orderer: docker-compose -f docker-compose-cli.yaml down --volumes

Then on peers: - docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml down --volumes

  • docker-compose -f docker-compose-kafka.yaml down --volumes

  • docker rm -f $(docker ps -aq) && docker rmi -f $(docker images | grep "dev\\|none\\|test-vp\\|peer[0-9]-" | awk '{print $3}')

one peers all volumes are not present even with "docker ps -aq". Therefore I bring the network up with all the docker-compose up commands on each peer.

Finally on the orderer when I run ./byfn.sh up it runs fine until instantiate then fails with chaincode exists..

You need to delete couchdb too because chaincode information can be inside. Have you try ?

docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
docker rmi -chaincode-

If you want to keep the data of the ledger(and so not delete the couchdb) you can also do a simple upgrade chaincode instead of instantiate ( https://hyperledger-fabric.readthedocs.io/en/release-1.3/chaincode4noah.html#upgrade )

Issue has been fixed. I had to first remove the ./couch folder where the data is stored, and increase the timer of peer channel create to 10 seconds in script.sh when running byfn up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM