Run scripts/backup.sh on a schedule (recommended: every 6 hours):
# Cron entry
0 */6 * * * /path/to/propchain/scripts/backup.sh /path/to/backupsWhat is backed up:
- Contract source code and configuration
- Deployment artifacts (addresses, ABIs)
- Environment structure (values redacted)
- Workspace manifest (Cargo.toml, Cargo.lock)
- SHA-256 checksums for integrity verification
Retention: Last 30 backups (configurable via MAX_BACKUPS).
./scripts/backup.sh ./my-backupsOn-chain state is inherently backed up by the blockchain. Recovery means redeploying contracts and restoring configuration:
# Restore from backup
tar -xzf propchain_backup_TIMESTAMP.tar.gz
cd propchain_backup_TIMESTAMP
# Verify checksums
sha256sum -c checksums.sha256
# Redeploy contracts
cd contracts && cargo contract build --release# Restore Cargo.toml and Cargo.lock
cp Cargo.toml Cargo.lock /path/to/project/
# Recreate .env from structure
cp env_structure.txt /path/to/project/.env
# Fill in actual values manuallyIf a bridge operation fails:
- Call
recover_failed_bridge(request_id, RecoveryAction::RetryBridge) - If retry fails, use
RecoveryAction::CancelBridgeto release funds - Use
RecoveryAction::RefundGasto compensate for failed gas
If oracle sources are compromised:
- Pause the oracle via admin
- Remove compromised sources (reputation drops below threshold)
- Re-register trusted sources
- Unpause after verification
Run after any recovery:
# Verify backup integrity
sha256sum -c checksums.sha256
# Verify contract compilation
cargo contract build --release
# Run test suite
cargo test --workspace| Severity | Response Time | Action |
|---|---|---|
| Low | 24 hours | Standard recovery procedure |
| Medium | 4 hours | Pause affected contracts, notify team |
| High | 1 hour | Emergency pause all contracts, investigate |
| Critical | Immediate | Emergency pause + bridge lockdown |