- 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
- 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
- Smart contract upgrading reference
- Glossary of concepts
Build the Daml Archive (.dar) file¶
In this section, you will compile your Daml smart contract into a Daml Archive (.dar) file, which is essential for deploying and executing contracts on a Daml ledger. By the end, you will have a fully packaged unit ready for distribution in a multi-party system. Let’s get started!
Open a terminal and navigate to the root directory of your Daml project.
Run the following command to build your .dar file:
daml build
This command compiles your Daml code and produces a Dar file in the ./.daml/dist/ directory.
Once the build completes, check the ./.daml/dist/ directory for your newly created .dar file. The name follows this format:
<project-name>-<version>.dar
If you don’t see the expected output, check the terminal logs for errors and ensure your contract compiles correctly.
For more details on compiling your DAR file, see How to build Daml Archive (.dar) files
Once you’ve built your DAR file, you may want to check out Manage Daml packages and archive for guidance on loading it into your participant.
Next up¶
In Data types you will learn about Daml’s type system, and how you can think of templates as tables and contracts as database rows.