canton-network-docs
cn
cn-quickstart - Canton Network Docs
Skip to main content
The repository uses Nix and Direnv for reproducible development dependencies. If you prefer not to use Nix, work directly in the
Once running, the frontend is accessible in your browser. See the QuickStart walkthrough for a step-by-step guide.
The build system regenerates Java bindings from the updated DAR file, so your backend can reference the new templates immediately.
The cn-quickstart repository is a complete example application that demonstrates how to build, test, and run a Canton Network application. It includes Daml smart contracts, a Java backend, a React frontend, and a LocalNet environment for local development.Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
Repository Overview
Clone the repository:quickstart/ directory and manage dependencies (JDK, Node.js, dpm) manually.
Project Structure
The Reference Application
cn-quickstart implements a software licensing workflow with four parties:- App Provider — Creates and sells licenses
- App User — Purchases and holds licenses
- Super Validator (SV) — Operates the payment infrastructure
- DSO Party — The decentralized synchronizer operator for Canton Coin
Running the Application
Extending the Example
Adding Your Own Templates
Create new.daml files in the daml/ directory. After writing your templates:
Modifying the Backend
The backend follows a standard Spring Boot layout. To add a new endpoint:- Define the endpoint in
common/openapi.yaml - Add the service implementation in
backend/src/main/java/.../service/ - Add PQS queries in
repository/if you need to read contract data - Add Ledger API commands in
ledger/if you need to submit transactions - Rebuild with
make build-backend
Custom Frontend
The React frontend consumes the backend’s REST API. To modify it:- Update or add components in
frontend/src/components/ - Regenerate the API client if you changed
openapi.yaml - Rebuild with
make build-frontend
Switching Architectures
cn-quickstart uses a fully mediated architecture (backend handles all ledger access). You can switch to a CQRS pattern where the frontend submits commands directly to the Ledger API using TypeScript bindings generated bydpm codegen-js. See SDKs and APIs for a comparison of both approaches.
Related Pages
- QuickStart walkthrough — Step-by-step guide to running the demo
- Project structure — Detailed breakdown of every directory and file
- LocalNet — The Docker Compose environment powering local development
- Backend development — Patterns from the cn-quickstart backend