Canton applications need different configurations for each environment — LocalNet, DevNet, TestNet, and MainNet. This page covers the configuration layers you work with: DPM global settings, project-levelDocumentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
daml.yaml, environment variables, and authentication setup.
DPM Configuration
DPM is Daml’s package manager.dpm can be configured through a config file and environment variables simultaneously. Environment variables take precedence over the config file.
Config file
The config file lives at${DPM_HOME}/dpm-config.yaml:
registry— Override the default location wheredpmpulls SDKs and SDK components. Defaults toeurope-docker.pkg.dev/da-images/publicfor stable releases. Useeurope-docker.pkg.dev/da-images/public-unstablefor unstable releases.registry-auth-path— Override the default auth file for the registry.insecure— Allowdpmto pull from insecure (HTTP) registries.
Environment variables
These override the corresponding config file settings:DPM_REGISTRY— Registry location for SDK pullsDPM_REGISTRY_AUTH— Auth file for registry accessDPM_INSECURE_REGISTRY— Allow insecure registry connectionsDPM_LOG_LEVEL— Log level for commands likedpm installanddpm version(debug,info,error,warn)DAML_PACKAGE— Rundpmcommands in a package context without being in its directory (e.g.,DAML_PACKAGE=/path/to/package)DPM_SDK_VERSION— Override the SDK version globally. This overrides thesdk-versionin alldaml.yamlfiles. It does not affectdpm install.
Project Configuration
daml.yaml
Each Daml package has adaml.yaml that specifies the SDK version, package name, source location, and dependencies. The dpm build command uses this file to resolve dependencies and compile the project.
multi-package.yaml
For projects with multiple connected Daml packages,multi-package.yaml tells dpm how to find and build them:
dpm builds these packages in topological order based on their dependencies.
Environment variable interpolation
Bothdaml.yaml and multi-package.yaml support environment variable interpolation on all string fields. Use ${MY_VARIABLE} syntax:
\ prefix: \${NOT_INTERPOLATED}.
This is useful for extracting common values like SDK version and package version into .envrc files or build system variables. It also allows passing dependency DARs through environment variables, which is helpful when a build system manages DAR artifacts in a cache.
Per-Environment Settings
Each environment typically needs different values for a small set of configuration points. Here’s a pattern for managing them.LocalNet
LocalNet is self-contained. The cn-quickstart Makefile and Docker Compose configuration handle most settings:app-user, app-provider, sv).
DevNet / TestNet / MainNet
For shared networks, you configure connection details and authentication:.envrc.devnet, .envrc.testnet, .envrc.mainnet) and load the appropriate one.
Authentication Configuration
Canton validators protect the Ledger API with JWT-based authentication. Your application needs a valid token to submit commands and read transactions.LocalNet with Keycloak
The cn-quickstart LocalNet includes a pre-configured Keycloak instance. Obtain tokens through the Keycloak token endpoint:Production environments
On DevNet, TestNet, and MainNet, your validator’s auth provider issues tokens. The exact mechanism depends on your validator’s IAM setup, but the flow is the same: your application obtains a JWT and includes it in Ledger API requests as a Bearer token. For gRPC clients, set the token as a call credential. For HTTP/JSON requests, include it in theAuthorization header.
Overriding SDK Components (Advanced)
dpm supports overriding individual SDK components for a single package or an entire multi-package project. In daml.yaml:
multi-package.yaml, the same override-components block applies to all packages. When both files specify overrides, dpm applies multi-package.yaml overrides first, then daml.yaml overrides on top (giving daml.yaml the highest precedence).
Install overridden components with:
Next Steps
- Deployment Progression — Environment differences and promotion checklist
- CI/CD Integration — Using environment configuration in automated pipelines