- Overview
- Tutorials
- Getting started
- Get started with Canton and the JSON Ledger API
- Get Started with Canton, the JSON Ledger API, and TypeScript
- Get started with Canton Network App Dev Quickstart
- Using the JSON Ledger API
- Deploy Quickstart to DevNet
- Appendix
- Get started with smart contract development
- Basic contracts
- Test templates using Daml scripts
- Build the Daml Archive (.dar) file
- Data types
- Transform contracts using choices
- Add constraints to a contract
- Parties and authority
- Compose choices
- Handle exceptions (Deprecated)
- Work with dependencies
- Functional programming 101
- The Daml standard library
- Test Daml contracts
- Next steps
- Application development
- Getting started
- Development how-tos
- Component how-tos
- Explanations
- References
- Application development
- Smart contract development
- Daml language cheat sheet
- Daml language reference
- Overview: Template Structure
- Reference: Templates
- Reference: Choices
- Reference: Updates
- Reference: Data Types
- Reference: Built-in Functions
- Reference: Expressions
- Reference: Functions
- Reference: Daml File Structure
- Reference: Daml Packages
- Reference: Contract Keys
- Reference: Interfaces
- Reference: Exceptions (Deprecated)
- Fixity, Associativity and Precedence
- Daml standard library
- DA.Action.State.Class
- DA.Action.State
- DA.Action
- DA.Assert
- DA.Bifunctor
- DA.Crypto.Text
- DA.Date
- DA.Either
- DA.Exception
- DA.Fail
- DA.Foldable
- DA.Functor
- DA.Internal.Interface.AnyView.Types
- DA.Internal.Interface.AnyView
- DA.List.BuiltinOrder
- DA.List.Total
- DA.List
- DA.Logic
- DA.Map
- DA.Math
- DA.Monoid
- DA.NonEmpty.Types
- DA.NonEmpty
- DA.Numeric
- DA.Optional
- DA.Record
- DA.Semigroup
- DA.Set
- DA.Stack
- DA.Text
- DA.TextMap
- DA.Time
- DA.Traversable
- DA.Tuple
- DA.Validation
- GHC.Show.Text
- GHC.Tuple.Check
- Prelude
- Daml Script
- Smart contract upgrading reference
- Glossary of concepts
Digital Asset Package Manager (Dpm)¶
dpm is a command-line tool that allows users to run the SDK components.
It is a drop-in replacement for the Daml Assistant,
which will be removed as of the 3.5 SDK release.
Pre-requisites¶
Dpm runs on Windows, macOS and Linux.
For full functionality, you must have installed:
JDK 17 or greater, installed and part of your
JAVA_HOME. If you do not already have a JDK installed, try OpenJDK or Eclipse Adoptium.
Install¶
When installing dpm, you can set the DPM_HOME environment variable to change the location where the SDK and any future updates are installed. The default is:
${HOME}/.dpm/on Mac and Linux%APPDATA%/.dpm/on Windows
Installation Instructions¶
To install the latest version:
Mac/Linux Installation¶
curl https://get.digitalasset.com/install/install.sh | sh
Windows Installation¶
Download and run the windows installer, which will install the dpm sdk and set up the PATH variable for you.
Manual Installation Instructions¶
If you prefer a more manual installation process, see Manual Installation Instructions.
Managing and Upgrading SDK Versions¶
You can manage SDK versions manually by using dpm install.
To install the SDK version specified in the daml.yaml, run:
dpm install package
To install a specific SDK version, for example version 3.4.11, run:
dpm install 3.4.11
To see the active SDK version:
dpm version --active
3.4.11
To list the installed SDK versions, including the currently active one (marked with *):
dpm version
3.4.10
* 3.4.11
To additionally list all the SDK versions that can be installed, as well as the installed versions:
dpm version --all
To get the list in a machine readable format:
dpm version --all -o json
[
{
"version": "3.4.9",
"remote": true
},
{
"version": "3.4.10",
"installed": true,
"remote": true
},
{
"version": "3.4.11",
"installed": true,
"remote": true,
"active": true
}
]
Operate¶
dpm build: Build a Daml package or projectThis builds the Daml project according to the project config file
daml.yaml(see configuration files).In particular, it will use the dpm SDK (specified in the
sdk-versionfield indaml.yaml) to resolve dependencies and compile the Daml project.Given a
daml.yamland.damlsource files, thedpm buildcommand will generate a .dar for this package. See How to build Daml Archives for how to define a package and build it to a DAR.dpm test: Test the current Daml project or the given files by running all test declarations.This runs all daml scripts defined within a package.
Daml Scripts are top level values of type
Script (), from thedaml-scriptpackage. This package mimics a Canton Ledger Client for quick iterative testing, and direct support within Daml Studio. The command runs these scripts against a reference Ledger called the IDE Ledger, which implements the core functionality of the Canton Ledger without the complexity of multi-participant setups.It is most useful for verifying the fundamentals of your ledger model, before moving onto integration testing via the Ledger API directly, or the Daml Codegen.
dpm testalso provides code coverage information for templates and choices used.dpm clean: Clean a Daml package or projectThis removes any Daml artifact files created in your package during a daml build, including DARs.
dpm codegen-alpha-java: codegen (alpha) for javadpm codegen-alpha-scala: codegen (alpha) for scaladpm codegen-alpha-typescript: codegen (alpha) for typescriptdpm codegen-java: Daml to Java compilerdpm codegen-js: Daml to JavaScript compilerdpm canton-console: Canton console clientdpm daml-shell: daml-shell client for PQSdpm damlc: Compiler and IDE backend for the Daml programming languagedpm docs: Generate documentation for a daml package from its documentation commentsdpm init: Initialize adaml.yamlproject configuration file in the current directorydpm install: Install new SDK versions manuallydpm inspect-dar: Inspect a DAR archivedpm new: Create a new Daml packagedpm pqs: participant query storedpm sandbox: Run full Canton installation in a single processdpm script: Daml Script Binarydpm studio: Launch Daml Studiodpm upgrade-check: Check upgrade validity between package versions
dpm validate-darValidate a DAR archiveNote that you need to update your project config file to use the new version.
Configuration¶
Project configuration (daml.yaml)¶
Each Daml project contains a daml.yaml file that defines the project’s SDK version, dependencies, and build settings.
If a daml.yaml file doesn’t exist in your project, you can create one with:
dpm init
dpm Global configuration (dpm-config.yaml)¶
Global configuration is stored at ${DPM_HOME}/dpm-config.yaml and is optional. It can be used for purposes such as:
Registry URL — Override the default OCI registry for SDK components.
Authentication — Point to registry credentials.
Insecure registry — Allow HTTP connections to a registry.
Variable interpolation¶
Both daml.yaml and dpm-config.yaml support variable interpolation, which lets you avoid hardcoded values (such as registry URLs or credentials paths) and reference environment variables or other dynamic values.
daml assistant to dpm migration steps¶
This section provides a step-by-step guide for projects originally built with the Daml assistant.
Migration steps¶
Install Dpm
Follow the installation instructions above.
Verify Dpm is in your PATH
dpm versionRemove
~/.daml/binfrom your PATHEdit your shell configuration file (e.g.,
~/.bashrc,~/.zshrc,~/.profile) and remove any line that adds~/.daml/binto yourPATHRemove the Daml assistant
rm -rf ~/.daml
Create a project configuration if needed
If a
daml.yamlfile doesn’t already exist in your project, generate one:dpm initReplace
damlcommands withdpmMost commands map directly. See the command migration table below.
Six
damlcommands have been removed and replaced with Declarative API, Canton Console, JSON API, and/or gRPC API calls. See removed command replacements for full details.Review project configuration
Review your
daml.yamlto ensure it is compatible with dpm. Audit parent directories for staledaml.yamlfiles. Delete orphan or invalid files.Review global configuration (optional)
Review or create
${DPM_HOME}/dpm-config.yamlif you need to customize registry, authentication, or other global settings.Set up variable interpolation (optional)
Use variable interpolation in your configuration files to avoid hardcoded values.
Update CI/CD pipelines (if applicable)
Update any CI/CD pipeline scripts that reference
damlcommands to use the correspondingdpmcommands instead.
Command migration table¶
daml command |
dpm command |
purpose |
|---|---|---|
daml new |
dpm new |
Create a new Daml project |
daml build |
dpm build |
Compile the Daml project |
daml test |
dpm test |
Run tests for the Daml project |
daml install |
dpm install |
Install Daml SDK components |
daml codegen java |
dpm codegen-java |
Java code generation |
daml codegen js |
dpm codegen-js |
TypeScript code generation |
daml damlc |
dpm damlc |
Invoke the daml compiler |
daml studio |
dpm studio |
Open project in Visual Studio |
daml sandbox |
dpm sandbox |
Launch a Daml Sandbox |
Use Declarative API – OR – JSON / gRPC API |
Allocate parties on a ledger |
|
JSON / gRPC API |
list parties on a ledger |
|
Use Declarative API – OR – JSON / gRPC API |
Upload (and vet) dars on a ledger |
|
gRPC API |
Fetch a Dar from a ledger. |
|
JSON / gRPC API |
Package a Daml project |
|
dpm sandbox dpm build Use Declarative API – OR – JSON / gRPC to upload/allocate |
Start a local Daml Ledger |
Removed command replacements¶
The following daml commands have no direct dpm equivalent. Use the Declarative API, Canton Console, JSON API, or gRPC API instead.
daml ledger allocate-parties¶
Method |
Details |
|---|---|
Declarative API |
|
Canton Console |
|
JSON API |
|
gRPC |
|
daml ledger list-parties¶
Method |
Details |
|---|---|
Canton Console |
|
JSON API |
|
gRPC |
|
daml ledger upload-dar¶
Method |
Details |
|---|---|
Declarative API |
|
Canton Console |
|
JSON API |
|
gRPC |
|
daml ledger fetch-dar¶
Method |
Details |
|---|---|
JSON API |
|
gRPC |
|
daml packages¶
Method |
Details |
|---|---|
Canton Console |
|
JSON API |
|
gRPC |
|
daml start¶
Replace with dpm sandbox combined with dpm build. Use the Declarative API or JSON/gRPC API to upload DARs and allocate parties as needed.
See dpm sandbox for details on running a local Canton installation.
Unstable releases (advanced operation)¶
To install unstable SDKs you need to configure dpm to look for them by setting the
registry configuration field or DPM_REGISTRY environment variable to europe-docker.pkg.dev/da-images/public-unstable, then you can use the same dpm install command:
dpm install <unstable SDK version>
Command Help¶
To see information about any command, run it with --help.