Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
stellar-scaffold-cli
CLI toolkit for Stellar smart contract development, providing project scaffolding, build automation, and development workflow tools.
Stellar Scaffold CLI comes with four main commands:
-
stellar scaffold init- Creates a new Stellar smart contract project with best practices and configurations in place, including anenvironments.tomlfile for managing network settings, accounts, and contracts across different environments. -
stellar scaffold upgrade- Transforms an existing Soroban workspace into a full scaffold project by adding frontend components, environment configurations, and project structure. Preserves existing contracts while adding the complete development toolkit. -
stellar scaffold build- Manages two key build processes:- Build smart contracts with metadata and handle dependencies
- Generate TypeScript client packages for frontend integration
The build process respects environment configurations from
environments.tomland handles contract deployment states based on the current environment (controlled viaSTELLAR_SCAFFOLD_ENV). -
stellar scaffold watch- Development mode that monitors contract source files andenvironments.tomlfor changes, automatically rebuilding as needed. Defaults to using thedevelopmentenvironment.
Getting Started
New Project
- Install the CLI:
Or cargo-binstall:
- Create a new 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
Upgrading Existing Workspace
If you have an existing Soroban workspace, you can upgrade it to a full scaffold project:
This will:
- Add the frontend application and development tools
- Generate
environments.tomlwith your existing contracts - Set up environment files and configurations
- Preserve all your existing contract code and structure
- Set up your environment:
- Start development:
Environment Configuration
Projects use environments.toml to define network settings, accounts, and contract configurations for different environments. Example:
[]
= {
name = "standalone",
= true
}
= ["account1", "account2"]
[]
= {
name = "testnet"
}
[]
= {
name = "mainnet"
}
Build Process Details
stellar scaffold build and stellar scaffold watch 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
Setting contract metadata
Contract metadata is set when running stellar scaffold build. You can configure metadata with
[package.metadata.stellar] section in your Cargo.toml file.
For example:
[]
# When set to `true` will copy over [package] section's `name`, `authors`, `homepage` (renamed to `home_domain` to comply with SEP-47), `repository` (renamed to `source_repo` to comply with SEP-47) and `version` (renamed to `binver` to comply with SEP-47)
= true
# Override one of the inherited values
= "my-awesome-contract"
= "ahalabs.dev"
= "https://github.com/AhaLabs/scaffold-stellar"
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: