Backups and recovery
Set up backups before funding. Keep copies off-site, verify them after state changes, and test recovery while the original SGX host is still available.
What to back up
In the standard ~/nomad deployment, Nomad can upload these two files to Amazon S3:
| File | Contents |
|---|---|
data/eoa.bin | Sealed account keys, account lifecycle, fee accounting, and pending execution or inventory state. |
data/key.bin | Sealed signal-decryption key and its signer policy. |
Keep a separate protected copy of:
data/config.toml,compose.yaml, and any referenced environment files, such asbackup.envandtelemetry.env.- The running Nomad version.
- Funding addresses, transfer receipts, and withdrawal records.
data/deposit_session.jsonif a deposit is unfinished. It stores the total, not the address table.
Encrypt configuration archives and protect their access credentials separately. Do not send backups to us or commit them to source control. Production account state is SGX-sealed; debug state is plaintext and must never hold real funds.
Recovery limits
A sealed backup may not open on replacement hardware. Recovery needs a compatible enclave on the original SGX platform. Copying a disk, replacing a VM, or restoring a cloud snapshot does not establish that compatibility.
Nomad has no production mnemonic export or general cross-host key migration command. Losing the original platform can therefore leave funds inaccessible even if you have backups.
Contact us before replacing a funded host. Plan a withdrawal while it still works, and retain access until balances and obligations are reconciled.
Why platform identity and backup age matter
SGX sealing keys derive from platform secrets. eoa.bin binds the enclave signer identity; key.bin also binds the exact enclave identity.
An older snapshot can omit newer accounts, transactions, or fee records. Restoring it cannot reverse onchain activity. Keep multiple versions and review the recovery point with us if the node has operated since the snapshot.
Amazon S3 backups
Nomad can upload the two sealed files when it saves state. Bucket versioning keeps earlier copies available for recovery. Complete this setup before your first deposit. Configuration and deployment files need a separate protected archive.
Create a private, versioned bucket
Use an administrative AWS identity for setup and a separate, restricted identity for the node.
In the S3 console:
- Create a general purpose bucket with a unique name in your chosen region.
- Keep Block Public Access enabled. Use Bucket owner enforced ownership with ACLs disabled.
- Enable Bucket Versioning. Wait 15 minutes before the first uploads, as AWS recommends.
- Keep default encryption enabled. This guide uses SSE-S3; SSE-KMS also needs KMS permissions and a key-retention plan.
- Choose a separate prefix for each node, such as
node-01.
Add a bucket policy denying requests where aws:SecureTransport is false. Protect administration with MFA. Keep deletion privileges away from the node and retain historical versions according to your recovery policy.
The examples use YOUR_BUCKET_NAME, region eu-central-1, and prefix node-01. Replace them consistently with your values.
Grant scoped access
Attach this policy to the node’s AWS identity. It allows uploads, downloads, and version listing for that node, without delete or bucket-administration permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListBucketVersions",
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME",
"Condition": {
"StringLike": { "s3:prefix": ["node-01/*"] }
}
},
{
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:GetObject", "s3:GetObjectVersion"],
"Resource": [
"arn:aws:s3:::YOUR_BUCKET_NAME/node-01/eoa.bin",
"arn:aws:s3:::YOUR_BUCKET_NAME/node-01/key.bin"
]
}
]
}Check that other attached policies do not grant broader access. Versioning does not protect against an identity authorized to delete historical versions. See AWS’s permission reference.
Pass credentials to the container
Nomad’s backup client reads environment variables. It does not use AWS CLI profiles or automatically fetch EC2 instance-role credentials.
From ~/nomad, create a restricted file:
umask 077
touch backup.env
chmod 600 backup.envEdit it with your values. Never commit the credentials:
AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
AWS_REGION=eu-central-1For temporary credentials, also set AWS_SESSION_TOKEN and renew it before expiry. Recreate the container after rotating credentials.
Add the file under the nomad service in compose.yaml:
env_file:
- ./backup.envIf you use telemetry, include ./telemetry.env in the same list. Docker administrators can read these variables, so restrict host and Docker access.
Configure automatic uploads
Add this table to data/config.toml:
[backup.s3]
bucket = "YOUR_BUCKET_NAME"
region = "eu-central-1"
prefix = "node-01"
timeout_secs = 30Use a prefix without a trailing slash. Omit endpoint for Amazon S3; that field is for S3-compatible services.
For a new node, continue to funding. For an existing node, schedule a restart to apply the environment and configuration:
docker compose up -d --force-recreate nomad
docker compose logs --tail=100 nomadNomad writes to node-01/eoa.bin and node-01/key.bin at supported state-save points. There is no separate upload command or fixed backup interval.
Verify uploads
On a new node, expect eoa.bin during the deposit process and key.bin after the first successful startup. Once the node is running, verify both files:
docker compose run --rm nomad backup list
docker compose run --rm nomad backup list --file eoa
docker compose run --rm nomad backup list --file keyCheck that both files have version IDs and expected modification times. Watch logs for S3 backup warnings. An upload failure may leave the node running, so monitor backups separately from API health.
The files upload asynchronously and independently. Their latest versions may not form a consistent pair, and arrival order alone does not establish which state is newest.
During maintenance, stop the node and compare downloaded versions with the local sealed-file hashes. Use backups and recovery to stage files safely.
Inspect older versions with the AWS CLI
Nomad’s listing does not paginate through a long history. Use the AWS CLI or console for older versions, from a trusted workstation with scoped credentials:
aws s3api list-object-versions \
--bucket YOUR_BUCKET_NAME \
--prefix node-01/ \
--query 'Versions[].{Key:Key,Version:VersionId,Latest:IsLatest,Modified:LastModified}'Download a specific version with the AWS CLI
If native retrieval fails, inspect the AWS error and download the chosen version into a protected staging location:
umask 077
aws s3api get-object \
--bucket YOUR_BUCKET_NAME \
--key node-01/eoa.bin \
--version-id EOA_VERSION_ID \
./eoa.bin.recoveryUse the exact key and version ID for each file. Never download over live state.
Take a consistent local snapshot
Stop every Nomad process using the state, including one-off deposit or withdrawal commands. Wait for a clean shutdown. From ~/nomad:
docker compose stop nomad
docker compose ps -a
sudo install -d -m 0700 snapshots
snapshot_name="nomad-$(date -u +%Y%m%dT%H%M%SZ).tar.gz"
sudo tar -czf "snapshots/$snapshot_name" data compose.yaml
sudo sha256sum "snapshots/$snapshot_name"Add any referenced files, such as telemetry.env or backup.env, to the archive. The command creates a local, unencrypted copy. Encrypt it, copy it off-site, and verify it can be read.
Record the running version, host identity, snapshot time, and the sealed files’ hashes and S3 version IDs. Restart after the snapshot is complete:
docker compose up -d nomadRestore without overwriting live state
Stop the service and any one-off Nomad process. Preserve the existing files, even if they appear corrupt. Restore into a separate directory first.
Copy the configuration and edit its enclave.seal_path to "./restore-check":
sudo install -d -m 0700 data/restore-check
sudo cp -p data/config.toml data/restore-check.toml
sudoedit data/restore-check.tomlWith S3 credentials configured, list versions and restore the selected files. Replace each version ID with the exact value from your backup history:
docker compose run --rm nomad backup list
docker compose run --rm nomad --config /root/.config/nomad/restore-check.toml \
backup restore --file eoa --version-id EOA_VERSION_ID
docker compose run --rm nomad --config /root/.config/nomad/restore-check.toml \
backup restore --file key --version-id KEY_VERSION_ID
sudo sha256sum data/restore-check/eoa.bin data/restore-check/key.binRestore does not lock the running enclave’s state or validate sealed contents. Never target live files. It also does not recover config.toml.
Compare hashes, version times, enclave identity, and transaction history. The two files upload separately, so their newest versions are not necessarily a matching snapshot. We can help select a compatible pair and reconcile activity since the backup.
While the node remains stopped, install the selected files with restricted permissions. Start one instance on the original compatible platform. Check unsealing, attestation, balances, fees, and backup uploads.
If unsealing fails, keep the files and logs and contact us. Do not initialize new state over a funded deployment.
Restore defaults
Without --version-id, restore downloads the latest object. It refuses to overwrite an existing destination unless --force is supplied. Use explicit versions and an empty staging directory for recovery.
Test the recovery process
Periodically download a version into staging and compare its hash with a known stopped-state snapshot. This checks storage access and file integrity.
A full test also needs controlled unsealing and balance reconciliation on compatible hardware, with only one instance using the accounts. Arrange that maintenance window with us before a recovery emergency.