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.
- Stop the container:
docker-compose down
- Copy the entire
sgx_data
directory.
- Edit the
docker-compose.yml
and add the-b
flag to recover from backup.
command: -s -y -d -b
- Copy the backed up
sgx_data
directory to the recoverysgx_data
directory. - Create file
sgx_data/sgxwallet_backup_key.txt
in the recovery directory and write the backup key into it. - Execute:
docker-compose up -d
- Edit the
docker-compose.yml
file, remove the-b
flag.
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.
- Stop the container:
docker-compose down
-
Copy the entire
sgx_data
directory. -
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
- Copy the backed up
sgx_data
directory to the recoverysgx_data
directory. - Create file
sgx_data/sgxwallet_backup_key.txt
in the recovery directory and write the backup key into it. - Execute:
docker-compose up -d
- Edit the
docker-compose.yml
file, remove the-b
flag.