2 releases
new 0.0.1-alpha.1 | May 13, 2025 |
---|---|
0.0.1-alpha | May 12, 2025 |
#678 in Authentication
42 downloads per month
73KB
1.5K
SLoC
stellar-scaffold-cli
CLI toolkit for Stellar smart contract development, providing project scaffolding, build automation, and development workflow tools.
Stellar Scaffold CLI comes with three main commands:
-
stellar scaffold init
- Creates a new Stellar smart contract project with best practices and configurations in place, including anenvironments.toml
file for managing network settings, accounts, and contracts across different environments. -
stellar scaffold build
- Manages two key build processes:- Build smart contracts and handle dependencies
- Generate TypeScript client packages for frontend integration
The build process respects environment configurations from
environments.toml
and handles contract deployment states based on the current environment (controlled viaSTELLAR_SCAFFOLD_ENV
). -
stellar scaffold dev
- Development mode that monitors contract source files andenvironments.toml
for changes, automatically rebuilding as needed. Defaults to using thedevelopment
environment.
Getting Started
- Install the CLI:
cargo install --git https://github.com/ahalabs/scaffold-stellar stellar-scaffold-cli
- Create a new project:
stellar scaffold init my-project
cd my-project
This creates:
- A smart contract project with recommended configurations
- A frontend application based on scaffold-stellar-frontend
- Environment configurations for both contract and frontend development
- Set up your environment:
cp .env.example .env
- Start development:
stellar scaffold dev --build-clients
Environment Configuration
Projects use environments.toml
to define network settings, accounts, and contract configurations for different environments. Example:
[development]
network = {
name = "standalone",
run_locally = true
}
accounts = ["account1", "account2"]
[staging]
network = {
name = "testnet"
}
[production]
network = {
name = "mainnet"
}
Build Process Details
stellar scaffold build
and stellar scaffold dev
manage:
- Smart contract compilation and deployment based on environment
- TypeScript client package generation for frontend integration
- Network and account management (create/fund accounts in development)
- Contract initialization via constructor args and post-deploy scripts
The build process ensures:
- Correct dependency resolution and build order
- Environment-specific contract deployments
- TypeScript client generation for frontend integration
- Contract state verification and updates
Environment Variables
STELLAR_SCAFFOLD_ENV
: Sets current environment (development/staging/production)STELLAR_ACCOUNT
: Default account for transactionsSTELLAR_RPC_URL
: RPC endpoint URLSTELLAR_NETWORK_PASSPHRASE
: Network passphrase
For More Information
See the full documentation:
Dependencies
~61–84MB
~1.5M SLoC