Saving data on Hyperledger-Composer network

2019-08-18 18:13发布

问题:

I the last weeks I have completed the Principal Hyperledger-Composer tutorials and I have created a private network for testing some features. I have noticed that if you close your PC or stop the fabric (./stopFabric), and restart the private-network, it will be empty. You lose every action you perform in the network using the rest-server (add client, transaction history, etc).

Is there a way for saving my actions? Do I have to use a "multiple-organization-network" (https://hyperledger.github.io/composer/tutorials/deploy-to-fabric-multi-org) for maintaining the status of my data? I have to maintain always online a peer for not loosing my data?

回答1:

please read How to restart the fabric composer without losing the existing data? - you need locate the correct docker-compose.yaml file(s) and (from the directory or providing the path the appropriate command below) preserve them using:

  • Run docker-compose stop to stop the Fabric Containers
  • Run docker-compose start to restart where you left off.