Stack Overview
Smart Contract Layer
Daml
Daml is Canton’s smart contract language—a functional language designed for multi-party workflows.
Example:
Daml Compiler
The Daml compiler (dpm build) compiles Daml source code into DAR files (Daml Archives) that can be deployed to participant nodes.
Application Layer
Backend Integration
Your backend connects to Canton via the Ledger API.
Language support:
- TypeScript/JavaScript (code generation available via
dpm codegen-js) - Java (code generation available via
dpm codegen-java) - Any language via gRPC or JSON API
Code Generation
Generate type-safe bindings from your Daml code:- Type-safe contract representations
- Command submission helpers
- Event handling utilities
Frontend
Use any web framework. Common choices:
The frontend typically connects via your backend, which handles Ledger API communication.
Development Tools
Daml SDK
The Daml SDK bundles everything needed for Canton development:dpm (Daml Package Manager)
Manage dependencies and build workflows:VS Code Extension
The Daml VS Code extension (Daml Studio) provides:- Syntax highlighting
- Type checking
- Error diagnostics
- Code navigation
- Integrated terminal
dpm studio from your project directory.
Infrastructure Components
LocalNet
LocalNet is a local Global Synchronizer simulation for development:- Local synchronizer
- Local participant node(s)
- Test Canton Coin
- No external dependencies
Participant Node
The participant node is the portion of the validator that hosts the Canton runtime which:- Hosts your parties
- Stores contract data
- Executes Daml logic
- Exposes the Ledger API
PQS (Participant Query Store)
PQS provides SQL-based querying for complex data access:
PQS maintains a PostgreSQL database synchronized with ledger state.
Development Workflow
Typical Flow
Steps
- Write Daml contracts defining your business logic
- Compile with
daml build - Test locally with Daml Script or LocalNet
- Build backend integration
- Deploy to DevNet for integration testing
- Promote through TestNet to MainNet
QuickStart Project
The cn-quickstart repository provides a complete example that includes build tooling:Tool Comparison with Other Platforms
Next Steps
QuickStart
Run the example application.
Module 3: Daml
Start writing smart contracts.