Successfully implemented automated Futurenet deployment infrastructure for the FiatBridge smart contract, including deployment scripts, GitHub Actions CI/CD workflow, and comprehensive documentation.
- Location:
stellar-contracts/scripts/deploy_fiat_bridge_futurenet.sh - Purpose: Bash-based deployment script for manual local deployments
- Features:
- Parameterized by environment variables
- Automatic WASM contract building
- Contract ID extraction and file output
- GitHub Actions output integration
- Location:
stellar-contracts/src/bin/deploy_fiat_bridge_futurenet.rs - Purpose: Rust-based deployment binary alternative
- Features:
- Built-in dependency management
- Structured error handling
- Soroban CLI integration
Workflow File: .github/workflows/deploy-futurenet.yml
Features:
- Triggered on push to
release/**branches - Conditional on
stellar-contracts/**changes - Environment: Futurenet (requires
FUTURENET_ADMIN_SECRET_KEYsecret) - Automatic artifact generation
- Deployment status tracking
- GitHub Step Summary output
Steps:
- Checkout code
- Setup Rust toolchain (wasm32-unknown-unknown target)
- Install Soroban CLI
- Cargo cache for performance
- Build WASM contract
- Deploy to Futurenet
- Upload contract ID artifact
- Create deployment status
- Post summary to Actions
File: stellar-contracts/DEPLOYMENT.md
Contents:
- Prerequisites and tool setup
- Local deployment instructions (Bash and Rust options)
- Environment variables reference
- Automated CI/CD setup guide
- Output format documentation
- Verification steps
- Troubleshooting guide
- Security considerations
Parameterization through environment variables:
| Variable | Purpose | Default |
|---|---|---|
FUTURENET_ADMIN_SECRET_KEY |
Admin account secret key | Required |
FUTURENET_RPC_URL |
RPC endpoint | https://rpc-futurenet.stellar.org |
FUTURENET_NETWORK_PASSPHRASE |
Network identifier | Test SDF Future Network ; April 2020 |
OUTPUT_FILE |
Contract ID output path | ./contract_id_futurenet.txt |
Scripts output contract ID in two ways:
File Output:
# contract_id_futurenet.txt
CABC1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF123456
GitHub Actions Output:
$GITHUB_OUTPUT: contract_id=CABC1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF123456
Artifact:
- Uploaded for 90 days retention
- Named:
contract-deployment-{sha} - Downloadable from Actions page
✅ Deploy script parameterised by environment variable
- Multiple parameterization points for flexibility
- Sensible defaults for Futurenet
- Clear documentation of required variables
✅ Outputs contract ID to a file for downstream scripts
- Primary output:
contract_id_futurenet.txt - Configurable via
OUTPUT_FILEvariable - GitHub Actions integration for CI/CD
✅ GitHub Actions workflow that deploys on push to release/ branches*
- Workflow file:
.github/workflows/deploy-futurenet.yml - Pattern:
release/**branches - Triggered only on relevant code changes
- Environment-based secrets management
- done
export FUTURENET_ADMIN_SECRET_KEY="your-key"
bash stellar-contracts/scripts/deploy_fiat_bridge_futurenet.sh
cat contract_id_futurenet.txtexport FUTURENET_ADMIN_SECRET_KEY="your-key"
cargo run --release --bin deploy_fiat_bridge_futurenet- Configure
FUTURENET_ADMIN_SECRET_KEYin GitHub Secrets - Push to
release/branch - Workflow automatically deploys contract
- Contract ID available in artifacts
- Secret key management through GitHub Secrets
- No hardcoded credentials
- Environment variable isolation
- Network validation
- Error handling for failed deployments
✅ Script validation ✅ Environment variable substitution ✅ Workflow trigger conditions ✅ Artifact generation ✅ Error handling
- Add Testnet deployment workflow
- Add Public network deployment workflow (with approval gates)
- Add contract verification script
- Add initialization parameter configuration
- Add multi-environment deployment strategy