This guide covers the automated deployment pipeline for Traqora Soroban smart contracts. The deployment system supports testnet and mainnet environments with verification, health checks, and rollback capabilities.
- Rust toolchain with
wasm32-unknown-unknowntarget - Stellar CLI (
cargo install stellar-cli) - Stellar account secret key with sufficient funds
- Network RPC URL and passphrase
.deployments/
├── testnet/
│ ├── latest -> 20250101-120000/
│ ├── 20250101-120000/
│ │ ├── contracts.json
│ │ ├── flight_registry/
│ │ │ └── flight_registry.wasm
│ │ ├── booking/
│ │ │ └── booking.wasm
│ │ └── ...
│ └── rollback-20250101-130000.log
├── mainnet/
│ └── ...
scripts/
├── deploy-contracts.sh # Build + deploy contracts
├── verify-contracts.sh # Verify deployed WASM hashes
├── health-check.sh # Validate contract responses
└── rollback.sh # Rollback to previous deployment
export STELLAR_SECRET_KEY="S..."
./scripts/deploy-contracts.sh testnet my-deployment-tag trueParameters:
- Network:
testnetormainnet - Tag: unique identifier (default: timestamp)
- Verify:
trueto run verification after deploy
./scripts/verify-contracts.sh testnet <tag>Compares deployed WASM hashes against local builds. Fails if any hash mismatch is detected.
./scripts/health-check.sh testnet <tag>Invokes each deployed contract to verify they respond correctly.
./scripts/rollback.sh testnet <target-tag>Reverts the deployment pointer to a previous deployment. Logs the rollback action.
The .github/workflows/deploy-automated.yml workflow handles automated deployments:
| Trigger | Network | Environment |
|---|---|---|
Push to develop |
Testnet | testnet |
Push to main |
Testnet | testnet |
Tag v* |
Mainnet | mainnet |
| Manual dispatch | Configurable | Configurable |
- Determine Network - Selects target network based on branch/tag
- Build & Deploy - Compiles contracts, deploys to network
- Verification - Validates WASM hashes match source
- Health Check - Invokes each contract method
- Upload Artifacts - Stores deployment artifacts for 30 days
- Notification - Sends Slack notification with deployment status
- Migration Check - On mainnet, checks for breaking changes
| Secret | Description |
|---|---|
STELLAR_SECRET_KEY |
Deployer account secret key |
SLACK_WEBHOOK_URL |
Slack webhook for notifications |
When deploying to mainnet, the CI pipeline checks for breaking changes in contract packages. Changes that may require migration:
- Storage schema changes
- Function signature changes
- New required initialization parameters
- Event structure changes
- Automatic: CI stores the previous deployment artifacts
- Manual: Use
scripts/rollback.shto revert to any tagged deployment - Emergency: Re-run the previous successful CI workflow
- WASM hashes match between local build and deployed contract
- Contract responds to basic invocations
- All contract IDs are recorded in deployment artifacts
- No breaking changes detected (mainnet only)
- Deployment notification sent