- Rust: 1.70+ with WebAssembly target
- Soroban CLI: Latest version
- Cargo: Rust package manager
- curl: For API interactions
- jq: For JSON parsing
- git: Version control
# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
# Add WebAssembly target
rustup target add wasm32-unknown-unknown
# Install Soroban CLI
cargo install --locked soroban-cli
# Verify installations
rustup --version
cargo --version
soroban --version-
Generate a test account:
soroban keys generate --seed test-deployer --network testnet
-
Fund the account on testnet:
ACCOUNT=$(soroban keys show test-deployer) curl "https://friendbot.stellar.org?addr=$ACCOUNT"
-
Verify balance:
soroban account balance --account test-deployer --network testnet
Create a .env.local file in the project root:
cp .env.example .env.localEdit .env.local with your credentials:
# Your Soroban secret key
export SOROBAN_SECRET_KEY="SBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Network configuration
export SOROBAN_NETWORK=testnet
export SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
# Deployment settings
export DEPLOYMENT_NETWORK=testnet
export VALIDATION_INTERVAL=300
export MAX_RETRIES=3Load the environment:
source .env.local-
Go to your repository: Settings → Secrets and variables → Actions
-
Create a new secret:
- Name:
SOROBAN_SECRET_KEY - Value: Your actual secret key (starts with
S)
- Name:
Using GitHub CLI:
# Get your secret key
SECRET_KEY=$(soroban keys show test-deployer --reveal)
# Add to GitHub
gh secret set SOROBAN_SECRET_KEY --body "$SECRET_KEY"# Navigate to project root
cd /workspaces/Sanctifier
# Build the wrapper contract
cargo build -p runtime-guard-wrapper --release --target wasm32-unknown-unknown
# Verify WASM artifact
ls -lah target/wasm32-unknown-unknown/release/runtime_guard_wrapper.wasmUsing the CLI tool:
# Deploy with validation
sanctifier deploy ./contracts/runtime-guard-wrapper \
--network testnet \
--secret-key "$SOROBAN_SECRET_KEY" \
--validate
# Deploy without validation
sanctifier deploy ./contracts/runtime-guard-wrapper \
--network testnet \
--secret-key "$SOROBAN_SECRET_KEY"# Standard deployment
bash scripts/deploy-soroban-testnet.sh \
--network testnet \
--interval 300
# Dry run (no actual deployment)
bash scripts/deploy-soroban-testnet.sh \
--network testnet \
--dry-run
# Without continuous validation
bash scripts/deploy-soroban-testnet.sh \
--network testnet \
--no-continuous
# With debug logging
bash scripts/deploy-soroban-testnet.sh \
--network testnet \
--debugCheck the deployment logs:
# View deployment manifest
cat .deployment-manifest.json | jq .
# View deployment log
tail -f .deployment.logThe workflow file is located at: .github/workflows/soroban-deploy.yml
The workflow runs on:
- Push to main branch (if contract files changed)
- Schedule (every 6 hours for continuous validation)
- Manual trigger (via
workflow_dispatch)
Edit the workflow file to customize:
# In .github/workflows/soroban-deploy.yml
on:
push:
branches: ["main"]
paths:
- "contracts/runtime-guard-wrapper/**"
schedule:
- cron: "0 */6 * * *" # Every 6 hours
workflow_dispatch:
inputs:
network:
default: "testnet"
dry_run:
default: false-
Build & Test
- Checkout code
- Install Rust toolchain
- Build runtime guard wrapper
- Verify WASM artifact
-
Deploy
- Run deployment script
- Collect deployment manifest
- Upload artifacts
-
Continuous Validation
- Download deployment manifest
- Run validation tests
- Generate validation report
-
Notification
- Create deployment status check
- Post summary to README
# List recent workflow runs
gh run list --workflow soroban-deploy.yml
# View latest run details
gh run view --workflow soroban-deploy.yml
# View logs for a specific run
gh run view <RUN_ID> --logThe validate-runtime-guards.sh script runs:
- Health Check - Verifies contract operations
- Statistics - Retrieves contract stats
- Execution Monitoring - Tests guarded execution
- Event Emission - Validates event logs
- Storage Accessibility - Checks storage access
- Performance Baseline - Measures execution time
- Error Handling - Tests error conditions
- Concurrent Operations - Tests concurrent calls
# Run validation suite for a deployed contract
bash scripts/validate-runtime-guards.sh \
--contract-id C1234567890123456789012345678901234567890123456789012345 \
--network testnet
# View validation results
cat .validation-results.json | jq .The deployment script includes a built-in validation loop:
bash scripts/deploy-soroban-testnet.sh \
--network testnet \
--interval 300 \
--no-validate falseThis will:
- Deploy contracts
- Run validation tests every 300 seconds
- Continue running indefinitely
- Log all results
# Follow validation log in real-time
tail -f .deployment.log
# Check deployment manifest for status
jq '.deployments[] | {name, status, last_validated}' .deployment-manifest.jsonError: "target wasm32-unknown-unknown not found"
# Install the WebAssembly target
rustup target add wasm32-unknown-unknownError: "soroban command not found"
# Install Soroban CLI
cargo install --locked soroban-cli
# Verify installation
soroban --versionError: "SOROBAN_SECRET_KEY not found"
# Check environment variable
echo $SOROBAN_SECRET_KEY
# Set it if missing
export SOROBAN_SECRET_KEY="SBXXXXXXXX..."Error: "Insufficient balance"
# Fund your account on testnet
ACCOUNT=$(soroban keys show test-deployer)
curl "https://friendbot.stellar.org?addr=$ACCOUNT"
# Check balance
soroban account balance --account test-deployer --network testnetError: "RPC connection failed"
# Check network is accessible
soroban network list
soroban network info --network testnet
# Test RPC endpoint
curl -s https://soroban-testnet.stellar.org/healthError: "Contract health check failed"
# Check contract is deployed
soroban contract read \
--id C1234567... \
--network testnet
# Invoke health check directly
soroban contract invoke \
--id C1234567... \
--network testnet \
-- health_checkWorkflow not triggering on push
- Check branch protection rules
- Verify secrets are set correctly
- Check workflow file syntax with:
gh workflow list
"Error: Secret not found"
# Verify secret exists
gh secret list
# Update secret if needed
gh secret set SOROBAN_SECRET_KEY --body "new-value"- ✅ Never commit
.env.localto version control - ✅ Use GitHub Secrets for CI/CD credentials
- ✅ Rotate keys regularly
- ✅ Use separate accounts for testnet/mainnet
- ✅ Review deployment logs regularly
- ✅ Validate deployments before promoting to mainnet
- ✅ Always do a dry run first:
--dry-run - ✅ Test on testnet before mainnet
- ✅ Enable continuous validation
- ✅ Monitor deployment logs
- ✅ Keep deployment manifests for audit trail
- ✅ Document all deployments
- ✅ Run full validation suite after deployment
- ✅ Enable continuous validation loop
- ✅ Set appropriate validation intervals
- ✅ Monitor validation reports
- ✅ Alert on failed validations
- ✅ Review performance metrics
- Set up local environment (follow Environment Setup)
- Test local deployment with
--dry-run - Configure GitHub Secrets
- Push changes to trigger workflow
- Monitor deployment in Actions tab
- Validate deployed contracts
- Review logs and manifests
- Setup alerts for failed deployments
For questions or issues, refer to the Troubleshooting section or check the Sanctifier Issues.