How do you persist data after a reboot?


#1

I created a Strato system using the Azure Strato template. The system was working fine and I was able to create users, upload contracts, and execute those contracts. To save money I am shutting down my instance after I am finished using it for the day. When I started it back up, all of the blocks and records of transactions were present, but the users and contracts have disappeared. I know that since it uses Docker, it has to be set up to be persistent, but apparently it isn’t. Although it appears that the blockchain itself is preserved somehow.

I would like to be able to use BlockApps in a production environment and have the administration interface for management and use the API to execute transactions from other applications, but that isn’t going to work if it can’t survive a server reboot.

My questions are: 1) Is there a way to persist data upon reboots? 2) Is there a Pro version that has this feature? 3) If it is used in a cluster, are the nodes able to retrieve data from the other nodes so that as long as you don’t reboot them all at once you keep your data? Not that this is completely acceptable because you may have a rack lose power and end up rebooting all the servers.


#2

You can preserve blockchain data between reboots by following the steps in strato-getting-started:

  • git clone https://github.com/blockapps/strato-getting-started
  • cd strato-getting-started
  • NODE_HOST=<machine_public_host_or_external_ip> ./strato.sh

Please use a fresh VM with:

  • at least 2 cores (although 4 is recommended)
  • Linux OS
  • dependencies installed - which are docker and docker-compose

It may be helpful to schedule a phone call to discuss this in more detail - here’s a link to my calendar to schedule.


#3

@eli I really appreciate your response and helpfulness. The instance that I established was in Azure, but since there is no dependency on their service I would like to go ahead and deploy it on a test cluster that we already have hosted. We have 5 nodes. It is likely that we will be changing configurations, so something I would like to discuss is how to either how to pack up and relocate the Docker containers or activate nodes on new systems, synchronize them, then deactivate the old ones. I am interested in knowing what the recommended way of doing that is. I am looking forward to talking to you!


#4

Hey @zachariah - how’s it going? Were you able to get started with the REST APIs?


#5

@eli yes! Now that I understand how to submit the arguments in POST, I have rewritten my Solidity code to allow you to change all of the variables in the contract in a single statement.