Daml packages (DARs) are the deployment units for on-ledger logic. Managing them across environments and organizations requires more oversight than typical software artifacts because every validator that participates in a workflow needs the same packages.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.
DAR Lifecycle
A DAR file goes through several stages:- Build —
dpm buildcompiles your Daml source into a DAR. The output is deterministic: the same source and SDK version produces the same DAR. - Test — Upload the DAR to a sandbox or LocalNet and run your test suite against it.
- Store — Publish the DAR to an artifact repository (Artifactory, Nexus, S3, or your CI system’s artifact storage).
- Distribute — Share the DAR with counterparties who need it on their validators.
- Deploy — Upload the DAR to production validators and vet it.
- Deprecate — After a successful upgrade cycle, unvet old package versions.
Version Pinning
Pin the SDK version in yourdaml.yaml to avoid accidental upgrades:
dpm install package to install the SDK version specified in daml.yaml. The pinned sdk-version field ensures everyone on the team builds with the same SDK version.
Dependency Management
Multi-package projects usemulti-package.yaml to declare dependencies between packages. dpm build resolves and builds them in topological order.
For external dependencies (packages published by other organizations), manage them as DAR files in your project:
Artifact Repositories
Store production DARs in a dedicated artifact repository alongside version metadata. A typical structure:Distributing Packages to Counterparties
The same DAR files must be deployed on all validators hosting parties involved in the workflow. Daml code defines the API for state and workflows synchronized across validators, similar to.proto files for a gRPC server shared with gRPC client developers.
It is recommended to store Daml code in a separate repo from backend and frontend code and provide app user organizations with a tarball or read-only access to this repo. This allows organizations to review and build the code to ensure confidence in the behavior of the DAR file installed on their validators.
Practical steps for distribution:
- Publish DARs to a shared artifact repository that counterparties can access
- Provide build instructions so counterparties can compile from source and verify the DAR matches
- Include a changelog documenting what changed between versions
- Communicate upgrade timelines (see Upgrade Deployment)
Package Modularization
- Stakeholder-oriented modules — Modularize workflows based on stakeholder interaction to simplify upgrades and maintain privacy. DAR files only need to be distributed to validators hosting the parties involved in the workflow.
- Public and private APIs — Minimize public workflows and store internal workflows in separate DAR files to allow more flexibility in adapting to evolving business needs. Separate interface definitions in their own package for better workflow management. Use interface definitions to specify public APIs which will make application upgrades easier.
- Test code separation — Keep test code in separate DAR files from production code. Test DARs should not be deployed to production validators.
Next Steps
- Security Best Practices — Securing your packages and deployment pipeline
- Performance — Optimization strategies for Canton applications