Skip to content

Latest commit

 

History

History
73 lines (47 loc) · 1.99 KB

backup-procedure.md

File metadata and controls

73 lines (47 loc) · 1.99 KB

SGXWallet Backup Procedure

When SGXWallet is initialized, the server will write the backup key into sgx_data/sgxwallet_backup_key.txt. This key must be securely recorded and stored. Be sure to store this key in a safe place, then go into a docker container and securely remove it with the following command:

docker exec -it <SGX_CONTAINER_NAME> bash && srm -vz ./sgx_data/sgxwallet_backup_key.txt

Master-Slave replication is recommended to support the SGXWallet backup strategy. Below are general instructions for a basic backup and recovery process.

Backup SGXWallet (manual copy)

  1. Stop the container:
docker-compose down
  1. Copy the entire sgx_data directory.

Recover from backup

  1. Edit the docker-compose.yml and add the -b flag to recover from backup.
command: -s -y -d -b
  1. Copy the backed up sgx_data directory to the recovery sgx_data directory.
  2. Create file sgx_data/sgxwallet_backup_key.txt in the recovery directory and write the backup key into it.
  3. Execute:
docker-compose up -d
  1. Edit the docker-compose.yml file, remove the -b flag.

Upgrade SGXWallet

To upgrade SGXWallet to the version with different enclave code you need to backup your data first and then start SGXWallet in backup mode. To do this please follow the instructions:

Ensure you have your backup key.

  1. Stop the container:
docker-compose down
  1. Copy the entire sgx_data directory.

  2. Edit the docker-compose.yml and add the -b flag to recover from backup and change image name.

image: skalenetwork/<NEW_IMAGE>

command: -s -y -d -b
  1. Copy the backed up sgx_data directory to the recovery sgx_data directory.
  2. Create file sgx_data/sgxwallet_backup_key.txt in the recovery directory and write the backup key into it.
  3. Execute:
docker-compose up -d
  1. Edit the docker-compose.yml file, remove the -b flag.