Skip to content

feat: set up Soroban testnet deployment pipeline (#160)#181

Merged
ayshadogo merged 2 commits into
Dfunder:mainfrom
snowrugar-beep:feat/issue-160-testnet-deployment-pipeline
May 28, 2026
Merged

feat: set up Soroban testnet deployment pipeline (#160)#181
ayshadogo merged 2 commits into
Dfunder:mainfrom
snowrugar-beep:feat/issue-160-testnet-deployment-pipeline

Conversation

@snowrugar-beep
Copy link
Copy Markdown
Contributor

Summary

Closes #160

Adds a production-ready, idempotent deployment script for the StellarAid core contract. The script handles testnet, sandbox, and mainnet deployments from a single entry point, persists deployment records, and prevents accidental re-deploys.

Changes

scripts/deploy.sh

The core deliverable. Key behaviours:

Feature Detail
Funded keypair Reads SOROBAN_ADMIN_SECRET_KEY from .env (or environment)
Contract ID output Printed to stdout and written to .stellaraid_contract_id
Deployment record Saved to deployments/<network>.json with contract ID, RPC URL, and timestamp
Idempotent If deployments/<network>.json already contains a contract ID, the script exits early with a message instead of re-deploying
Multi-network Accepts testnet (default), sandbox, or mainnet as first argument
Validation Fails fast if WASM is missing or secret key is unset

deployments/.gitkeep

Tracks the deployments/ directory so the path exists for CI and contributors without committing environment-specific JSON files.

.gitignore

Excludes deployments/*.json and .stellaraid_contract_id from version control.

Usage

# Copy and fill in your funded testnet key
cp .env.example .env
# SOROBAN_ADMIN_SECRET_KEY=S...

# Build the WASM first
make build-wasm

# Deploy to testnet
bash scripts/deploy.sh testnet
# → deployments/testnet.json created

# Re-running is safe (idempotent)
bash scripts/deploy.sh testnet
# ℹ️  Contract already deployed on testnet: C...

Acceptance Criteria

Criterion Status
Deploy script at scripts/deploy.sh
Uses funded testnet admin keypair from .env
Outputs deployed contract ID
Deployment record saved to deployments/testnet.json
Re-deployable (idempotent)

- Add scripts/deploy.sh: idempotent deploy script for testnet/sandbox/mainnet
  - Loads funded admin keypair from .env (SOROBAN_ADMIN_SECRET_KEY)
  - Outputs deployed contract ID to stdout
  - Saves deployment record to deployments/<network>.json
  - Skips re-deploy if deployments/<network>.json already exists (idempotent)
  - Validates WASM exists and secret key is set before attempting deploy
- Add deployments/ directory tracked via .gitkeep
- Update .gitignore to exclude deployments/*.json and .stellaraid_contract_id

Usage:
  bash scripts/deploy.sh testnet   # deploy to Stellar testnet
  bash scripts/deploy.sh sandbox   # deploy to local sandbox
  bash scripts/deploy.sh mainnet   # deploy to mainnet

Closes Dfunder#160
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@snowrugar-beep Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ayshadogo
Copy link
Copy Markdown
Contributor

@snowrugar-beep

Please resolve conflicts

@snowrugar-beep
Copy link
Copy Markdown
Contributor Author

@ayshadogo conflicts resolved.

Copy link
Copy Markdown
Contributor

@ayshadogo ayshadogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution

@ayshadogo ayshadogo merged commit 8a78f1b into Dfunder:main May 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set up Soroban testnet deployment pipeline

2 participants