Tags: blockchain canton daml makefile
Building on Canton requires fast feedback loops. Testing locally before deploying to a testnet saves time and costs. This guide walks through a complete workflow: create a contract, build it, spin up a sandbox, and verify it works via the JSON API.
mkdir -p testContract
cd testContract
daml init
This creates the boilerplate:
testContract/
├── daml.yaml # Project metadata
└── daml/
└── Main.daml # Smart contract code
Create daml/Main.daml:
What this does:
daml build
Output:
2026-04-07 20:17:41.33 [INFO] [build]
Created .daml/dist/testContract-1.0.0.dar
The .dar file (DAML ARchive) is like a JAR—it bundles your compiled smart contract.
Create a Makefile at the project root:
make start
This builds your contract and spins up:
localhost:6865
localhost:7575
Test the JSON API health check:
curl http://localhost:7575/readyz
Response:
[+] ledger ok (SERVING)
readyz check passed
Check the version:
curl http://localhost:7575/v2/version
You'll get detailed ledger capabilities. If both curl commands succeed, your sandbox is live.