- 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
- 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
- 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)
- 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
Configuration¶
dpm has both global, and project-specific configurations
Global Configuration¶
Configuration options¶
dpm can be configured via (simultaneously):
config file:
${DPM_HOME}/dpm-config.yaml
config |
purpose |
|---|---|
registry |
override the default location where dpm pulls SDKs and SDK components. The values are |
registry-auth-path |
override the default auth (file) used for the registry |
insecure |
allow |
environment variables: which take precedence over similar fields in
dpm-config.yaml
config |
purpose |
|---|---|
DPM_REGISTRY |
override the default location where dpm pulls SDKs and SDK components. The values are |
DPM_REGISTRY_AUTH |
override the default auth (file) used for the registry |
DPM_INSECURE_REGISTRY |
allow |
DPM_LOG_LEVEL |
for controlling log level of commands like |
DAML_PACKAGE |
allows running |
DPM_SDK_VERSION |
allows overriding the SDK version being used. It’s a global override that overrides the sdk version specified in any and all daml.yaml(s). It also overrides the SDK version used outside package or multi-package context. It doesn’t affect the behavior of the install command(s) |
Project Configuration¶
dpm also uses daml.yaml and multi-package.yaml for single- and multi-package project configuration.
Multi-package Configuration file (multi-package.yaml)¶
The multi-package.yaml file is used to inform Daml Build and the IDE of projects containing multiple
connected Daml packages.
An example is given below:
packages:
- ./path/to/package/a
- ./path/to/package/b
packages: an optional list of directories containing Daml packages, and by extension, daml.yaml config files. These allow Daml Multi-Build to
find the source code for dependency DARs and build them in topological order.
The multi-package also includes a dars field, for providing additional information to Daml Studio.
See Daml Studio Jump to definition for more details.
Environment Variable Interpolation¶
Both the daml.yaml and multi-package.yaml config files support environment variable interpolation on all string fields.
Interpolation takes the form of ${MY_ENVIRONMENT_VARIABLE}, which is replaced with the content of MY_ENVIRONMENT_VARIABLE from the
calling shell. These can be escaped and placed within strings according to the environment variable interpolation semantics.
This allows you to extract common data, such as the sdk-version, package-name, or package-version outside of a package’s daml.yaml. For example,
you can use an .envrc file or have these values provided by a build system. This feature can also be used for specifying dependency DARs, enabling you to either store
your DARs in a common folder and pass its directory as a variable, shortening the paths in your daml.yaml, or pass each dependency as a
separate variable through an external build system, which may store them in a temporary cache.
The following example showcases this:
sdk-version: ${SDK_VERSION}
name: ${PROJECT_NAME}_test
source: daml
version: ${PROJECT_VERSION}
dependencies:
// Using a common directory
${DEPENDENCY_DIRECTORY}/my-dependency-1.0.0.dar
${DEPENDENCY_DIRECTORY}/my-other-dependency-1.0.0.dar
// Passed directly by a build system
${DAML_FINANCE_DAR}
${MY_DEPENDENCY_DAR}
Escape syntax uses the \ prefix: \${NOT_INTERPOLATED}.
(Advanced) Overriding SDK Components¶
dpm supports overriding components for an installed SDK for a single package and/or a multi-package project.
in daml.yaml¶
sdk-version: 3.4.0-snapshot.20251013.1566.e75a9cf
override-components:
damlc:
version: 3.4.0-snapshot.20251007.14274.0.ve2024cd6
in multi-package.yaml¶
You can use the same override-components yaml object in a multi-package.yaml too. This applies the specified overrides to all packages.
packages:
- ./daml-pkg-1
- ./daml-pkg-2
override-components:
damlc:
version: 3.4.0-snapshot.20251007.14274.0.ve2024cd6
When both multi-package.yaml and one of its packages’ daml.yaml simultaneously override components, dpm overlays daml.yaml’s components on top of multi-package.yaml’s:
Starting with the components of package’s SDK, which is specified in its
daml.yamlOverlay
override-componentsofmulti-project.yamlOverlay
override-componentsofdaml.yaml, so effectively this has the highest precedence in case of conflicts
Components specified in override-components must be installed by running
> dpm install package
in a package containing the daml.yaml or multi-package.yaml