Skip to content

Feat/deployment scripts#54

Merged
Jayrodri088 merged 5 commits intoStellarState:mainfrom
KevinMB0220:feat/deployment-scripts
Mar 27, 2026
Merged

Feat/deployment scripts#54
Jayrodri088 merged 5 commits intoStellarState:mainfrom
KevinMB0220:feat/deployment-scripts

Conversation

@KevinMB0220
Copy link
Copy Markdown
Contributor

Edited pr_description_deployment_scripts.md

Aquí la descripción completa, lista para pegar en GitHub:


Description

Adds repeatable deployment and initialisation scripts under scripts/ to replace the manual soroban contract deploy / soroban contract invoke copy-paste commands previously documented in the README.

Two scripts are provided (deploy.sh for Bash, deploy.ps1 for PowerShell) that deploy and initialise all three contracts — invoice-token, invoice-escrow, and payment-distributor — in the correct dependency order, using environment variables loaded from .env.

A .env.example template is also included so contributors have a single source of truth for all required configuration variables.

Closes #11

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 📝 Documentation update
  • 🔧 Configuration change

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

How to Test

  1. Compilar contratos: soroban contract build
  2. cp .env.example .env y llenar credenciales de testnet
  3. macOS/Linux: bash scripts/deploy.sh | Windows: .\scripts\deploy.ps1
  4. Verificar banners [INFO] / [OK] para los 3 contratos y la tabla final de IDs
  5. (Opcional) Poner INVOICE_ESCROW_CONTRACT_ID=<id> en .env y re-correr — confirmar que se salta el deploy pero llama initialize
  • Manual testing completed

Scripts son shell-only, sin paths de contratos Rust en producción — no se requieren tests automatizados.

Additional Notes

  • Orden de dependencias: invoice-token se despliega primero porque su contract ID se pasa como --minter al inicializar invoice-escrow.
  • Sin unwrap(): No se modificó código Rust de contratos.
  • Seguridad: .env ya estaba gitignoreado; .env.example es el único archivo relacionado con credenciales que se commitea.
  • Fix .gitignore: Se eliminó la regla /scripts/ que era de tooling interno y ocultaría los nuevos scripts.

For Reviewers

  • Code quality and readability
  • Security implications (.env permanece gitignoreado)

The previous rule was leftover from maintainer-only tooling.
Public deployment scripts should be versioned.
Defines all environment variables consumed by the deployment scripts:
- STELLAR_NETWORK, STELLAR_SECRET_KEY, ADMIN_PUBLIC_KEY
- PLATFORM_FEE_BPS
- INVOICE_TOKEN_NAME/SYMBOL/DECIMALS/INVOICE_ID
- WASM_* build output paths (with sensible defaults)
- Optional CONTRACT_ID overrides to skip re-deploy

.env is already gitignored; .env.example is explicitly allowed.
Deploys and initialises all three contracts in the correct dependency
order: invoice-token → invoice-escrow → payment-distributor.

Features:
- Loads .env automatically from repo root
- Validates all required env vars and WASM paths before touching the network
- Coloured INFO/OK/WARN/ERROR output for each step
- Passes invoice-escrow contract ID as the token minter at init time
- Skips deploy step if CONTRACT_ID is pre-set in .env (idempotent)
- Prints a final summary table of deployed contract IDs

Closes StellarState#11
Functionally equivalent to deploy.sh for Windows users.

Features:
- Parses .env via Get-Content (no external dependencies)
- Require-Env helper fails fast with descriptive messages
- Coloured Write-Info/Write-Ok/Write-Warn/Write-Err output
- Same deploy-then-init order as the Bash script
- Supports CONTRACT_ID overrides to skip re-deploy

Usage:
  Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  .\scripts\deploy.ps1
- Replace manual copy-paste soroban CLI commands with a reference to scripts/
- Add '📜 How to run scripts' section covering:
    - Prerequisites (soroban-cli, soroban contract build)
    - .env setup via .env.example
    - Bash usage (macOS/Linux)
    - PowerShell usage (Windows)
    - Re-using existing contract IDs
- Add note to Contract Addresses section to copy IDs from script output
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 26, 2026

@KevinMB0220 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

@Jayrodri088 Jayrodri088 merged commit 4b3c7ee into StellarState:main Mar 27, 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.

[Tooling] Add deployment + initialization scripts

2 participants