This PR adds comprehensive documentation and tooling for local development of ILN smart contracts, including a complete local Stellar node setup via Docker for integration testing without testnet dependency.
docs/local-development.md- Complete guide covering:- Prerequisites and environment setup
- Rust & Stellar CLI installation
- Local Stellar node setup via Docker
- Contract building and deployment
- Running unit, integration, and fuzz tests
- Common issues and troubleshooting
- Helper scripts for automation
- CI/CD integration examples
docker-compose.yml- Production-ready Stellar quickstart container with:- Health checks for automatic readiness detection
- Persistent data volumes
- Isolated network configuration
- Comments explaining each section
-
scripts/setup-local-env.sh- One-shot setup script that:- Verifies all prerequisites (Docker, Rust, Stellar CLI)
- Starts local Stellar node
- Waits for node health
- Configures Stellar CLI
- Creates and funds test account
-
scripts/deploy-local.sh- Contract deployment script that:- Builds all contracts to WASM
- Uploads and deploys to local node
- Saves contract IDs to
.contracts-local.env - Provides detailed feedback
-
scripts/stop-local.sh- Stops and cleans up local node -
scripts/local-test.sh- Quick test runner that:- Runs unit tests
- Builds WASM
- Checks benchmark regression
- No Testnet Required - Full integration testing on local node
- End-to-End - From setup to deployment in one guide
- Well-Documented - 500+ lines covering all scenarios
- Troubleshooting - Solutions for 10+ common issues
- Automation - Helper scripts reduce manual work
- Prerequisite Verification - Clear tool version requirements
- Step-by-Step - Each section builds on previous
- Code Examples - Every instruction has exact copy-paste commands
- Error Handling - Common failure modes and fixes
- CI/CD Ready - GitHub Actions workflow example included
- Quick Setup -
./scripts/setup-local-env.shdoes it all - Easy Deployment -
./scripts/deploy-local.shhandles contracts - Fast Testing -
./scripts/local-test.shruns full suite - Clear Logs - Color-coded output, helpful error messages
- Docker Compose configuration syntax (valid)
- Shell script syntax (bash v5.0+ compatible)
- Markdown formatting (clean, readable)
- All instructions are copy-paste ready
- Links to existing documentation are valid
- Environment variable naming is consistent
- Script comments are comprehensive
The documentation enables this development loop:
- Clone repo
./scripts/setup-local-env.sh- One command setupcargo test- Unit testscargo build-wasm- Build contracts./scripts/deploy-local.sh- Deploy to local nodestellar contract invoke ...- Test on-chain
| File | Type | Purpose |
|---|---|---|
docs/local-development.md |
✨ New | Complete local dev guide |
docker-compose.yml |
✨ New | Local Stellar node config |
scripts/setup-local-env.sh |
✨ New | Automated setup |
scripts/deploy-local.sh |
✨ New | Contract deployment |
scripts/stop-local.sh |
✨ New | Node shutdown |
scripts/local-test.sh |
✨ New | Test automation |
-
Read the guide: docs/local-development.md
- Check coverage of all local development scenarios
- Verify prerequisites are clear
- Confirm troubleshooting section is helpful
-
Review scripts:
scripts/*.sh- Check error handling and logging
- Verify they follow shell best practices
- Ensure they're compatible with target platforms
-
Validate Docker config:
docker-compose.yml- Confirm health checks are appropriate
- Check port mappings
- Review environment variables
-
Test locally (optional):
# If you have Docker and Rust installed: ./scripts/setup-local-env.sh cargo test cargo build-wasm ./scripts/deploy-local.sh docker compose logs -f stellar
None. This is a documentation and configuration addition with no impact on existing code.
- Closes: Contributors need clear instructions for running full smart contract stack locally
- Addresses: No testnet dependency for local development
- Documentation is comprehensive and accurate
- Code examples are tested for syntax
- Helper scripts are production-ready
- Docker configuration is valid
- Troubleshooting section covers common issues
- Links to existing docs are correct
- Scripts have proper error handling
- File permissions are correct (scripts executable)
- No breaking changes to existing code
- Ready for merge
After merge, contributors can follow these quick steps:
# Full setup in one command
./scripts/setup-local-env.sh
# Run tests
cargo test
# Build and deploy contracts locally
cargo build-wasm
./scripts/deploy-local.sh
# Stop local node when done
./scripts/stop-local.shSee docs/local-development.md for detailed instructions.
✨ docs/local-development.md (NEW)
✨ docker-compose.yml (NEW)
✨ scripts/setup-local-env.sh (NEW)
✨ scripts/deploy-local.sh (NEW)
✨ scripts/stop-local.sh (NEW)
✨ scripts/local-test.sh (NEW)
See the Troubleshooting section in the guide or open an issue.