Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,68 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: rustfmt
- run: cargo fmt --all --check
- run: WRAITH_PROPTEST_CASES=16384 cargo test --workspace --test properties

stellar-deploy-dryrun:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
defaults:
run:
working-directory: stellar
continue-on-error: true
steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Setup Stellar CLI
uses: stellar/setup-soroban@v1
with:
version: "22.0.1"

- name: Cache Cargo build
uses: actions/cache@v4
with:
path: |
stellar/target
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-stellar-dryrun-${{ hashFiles('stellar/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-stellar-dryrun-

- name: Run deploy dry-run
env:
STELLAR_ADMIN_SECRET: ${{ secrets.FUTURENET_TEST_SECRET }}
RPC_URL: https://rpc-futurenet.stellar.org
IDENTITY_NAME: wraith-dryrun-ci
run: |
./scripts/deploy-dryrun.sh 2>&1 | tee deploy-dryrun-output.txt

- name: Parse and save contract IDs
run: |
cat deploy-dryrun-output.txt | grep -E '(stealth-announcer|stealth-registry|stealth-sender|wraith-names)\s' | \
awk '{print $1, $2}' > contract-ids.txt || true
echo "### Deploy Dry-Run Results" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat deploy-dryrun-output.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

- name: Upload dry-run output
uses: actions/upload-artifact@v4
if: always()
with:
name: deploy-dryrun-results
path: |
stellar/deploy-dryrun-output.txt
stellar/contract-ids.txt

solana:
needs: changes
if: needs.changes.outputs.solana == 'true'
Expand Down
77 changes: 76 additions & 1 deletion stellar/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ contracts. It was written after completing a full futurenet dry-run on
## Quick Reference

```
# Dry-run (no real transactions)
# One-command end-to-end dry-run (futurenet)
STELLAR_ADMIN_SECRET=<secret> ./scripts/deploy-dryrun.sh

# Legacy dry-run (prints commands without executing)
cd stellar
./deploy.sh futurenet <identity> --dry-run

Expand All @@ -21,6 +24,78 @@ cd stellar

---

## One-Command End-to-End Dry-Run

`scripts/deploy-dryrun.sh` is a self-contained script that performs a full
futurenet deployment — build → deploy → wire → register a name → announce →
scan → verify — and prints contract IDs with stellar.expert links.

It is **idempotent**: re-running with the same `STELLAR_ADMIN_SECRET` produces
the same contract IDs (deterministic deploy salts).

### Usage

```bash
# Minimal (uses default RPC: https://rpc-futurenet.stellar.org)
STELLAR_ADMIN_SECRET=SCVAL... ./scripts/deploy-dryrun.sh

# Custom RPC + identity name
STELLAR_ADMIN_SECRET=SCVAL... \
RPC_URL=https://custom-rpc.example.com \
IDENTITY_NAME=my-deployer \
./scripts/deploy-dryrun.sh
```

### Requirements

- `STELLAR_ADMIN_SECRET` env var (Stellar secret key, must be funded on futurenet)
- `stellar-cli >= 22.0.1` (or `soroban-cli`)
- Rust `wasm32-unknown-unknown` target installed
- The admin account must have sufficient XLM balance (≥ 10 XLM recommended)

### What It Does

1. **Preflight** — checks env vars, tooling, network reachability, account balance
2. **Build** — `cargo build --target wasm32-unknown-unknown --release`
3. **Optimize** — `stellar contract optimize` on each WASM
4. **Deploy** — deploys all 4 contracts with deterministic salts
5. **Wire** — `init` on `stealth-sender` with the announcer contract ID
6. **Smoke tests**:
- Register a test name in `wraith-names`
- Resolve the name
- Emit an `announce` event via `stealth-announcer`
- Query `stealth-registry`
- Verify `stealth-sender` initialization
7. **Summary** — prints all 4 contract IDs + stellar.expert links

### CI Integration

This script runs on the `stellar-nightly` schedule in CI. See
`.github/workflows/ci.yml` for the `stellar-deploy-dryrun` job.

### Expected Output (excerpt)

```
═══ Results ═══

Contract Contract ID
─────── ───────────
stealth-announcer CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBB4
stealth-registry CBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBB5
stealth-sender CCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBB6
wraith-names CDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBB7

Stellar Expert links:
├─ Announcer: https://futurenet.stellar.expert/explorer/futurenet/contract/...
├─ Registry: https://futurenet.stellar.expert/explorer/futurenet/contract/...
├─ Sender: https://futurenet.stellar.expert/explorer/futurenet/contract/...
└─ Names: https://futurenet.stellar.expert/explorer/futurenet/contract/...

✔ Dry-run complete.
```

---

## Prerequisites

| Tool | Minimum Version | Install |
Expand Down
Loading
Loading