Skip to content

Implement contract hot-reload development workflow with Soroban CLI #617

Description

@Smartdevs17

Context

Developing Soroban contracts requires a manual compile -> deploy -> test loop that takes 30+ seconds per iteration, severely hampering productivity.

Current Limitation/Problem

No hot-reload for contract development. Each code change requires cargo build, deploy WASM to testnet, and invoke contract tests.

Expected Outcome

Watch mode: filesystem watcher automatically re-compiles contracts on source change, deploys to local Soroban standalone, and runs contract integration tests. Iteration time <3s.

Acceptance Criteria

  • File watcher: chokidar or fswatch monitoring contracts/**/*.rs for changes
  • Incremental rebuild: on change, run cargo build --target wasm32-unknown-unknown for changed crate only
  • Redeploy: deploy new WASM blob to local Soroban standalone node
  • Test runner: run affected contract integration tests after deploy
  • Error reporting: compilation errors displayed with file:line:col and error message
  • Skip unchanged: contracts not modified are not rebuilt (incremental compilation)
  • Performance: full loop (save -> rebuild -> redeploy -> test result) <3s for single contract change
  • Edge case: multiple changes in rapid succession (debounce 500ms)

Technical Scope

  • scripts/contract-watch.sh - watch mode orchestrator
  • scripts/contract-build.sh - incremental build with dependency graph
  • contracts/Makefile - make watch target with hot-reload flag
  • .github/workflows/contracts.yml - CI uses same build script
  • docs/CONTRACT_DEV.md - hot-reload workflow documentation

Metadata

Metadata

Assignees

Labels

200-points200 point issueStellar WaveIssues in the Stellar wave programdrips-waveIssues in the Drips Wave programhighHigh complexity issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions