Skip to main content
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.

Repository Overview

Clone the repository:
The repository uses Nix and Direnv for reproducible development dependencies. If you prefer not to use Nix, work directly in the 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
The Provider and User each run on their own validator. License purchases involve Canton Coin payments processed through the Splice wallet system.

Running the Application

Once running, the frontend is accessible in your browser. See the QuickStart walkthrough for a step-by-step guide.

Extending the Example

Adding Your Own Templates

Create new .daml files in the daml/ directory. After writing your templates:
The build system regenerates Java bindings from the updated DAR file, so your backend can reference the new templates immediately.

Modifying the Backend

The backend follows a standard Spring Boot layout. To add a new endpoint:
  1. Define the endpoint in common/openapi.yaml
  2. Add the service implementation in backend/src/main/java/.../service/
  3. Add PQS queries in repository/ if you need to read contract data
  4. Add Ledger API commands in ledger/ if you need to submit transactions
  5. Rebuild with make build-backend

Custom Frontend

The React frontend consumes the backend’s REST API. To modify it:
  1. Update or add components in frontend/src/components/
  2. Regenerate the API client if you changed openapi.yaml
  3. Rebuild with make build-frontend
The frontend never interacts with the Ledger API directly — all ledger access goes through the backend.

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 by dpm codegen-js. See SDKs and APIs for a comparison of both approaches.