Module 0 · Lesson 4 · ~20 min read + exploration
Now that you know the words, let's walk the map. This lesson orients you in the actual Canton source repository — where things live, what components talk to what, and where Go tooling plugs in.
Primary source: github.com/digital-asset/canton (Apache 2.0). It's large. Don't try to read all of it. Use it as a reference — grep first, read selectively, follow types to their definitions.
Other repos you'll orbit:
daml repo's ledger-api/grpc-definitions/ — the protobuf files you'll import in your Go client.Canton uses a multi-module sbt build. At the top level, you'll see something like this (names and exact structure shift between versions — treat this as a guide, not a spec):
As a Go-side contributor, you almost never edit this code. You read it for two reasons:
These matter most for Go contributors. The Ledger API protobuf definitions are the contract between your Go client and any Canton participant. They live in the daml repo, not canton, though canton consumes them:
Those .proto files are what you'll feed protoc or buf to generate Go stubs. Exact path may shift with versions — find . -name '*.proto' | grep ledger from the daml repo root is your friend.
In Module 7 you'll clone the daml repo, check out a tag matching the Canton version you're running, copy the ledger-api/grpc-definitions/ tree into your Go module, and run buf generate (or protoc) to get Go stubs. This is the standard workflow for any Canton Go client.
Four services cover 90% of integration code:
| Service | What it does | Typical use |
|---|---|---|
CommandService |
Submit a command and wait for its outcome (success / completion details). | CLI that creates or transfers a contract and wants to block on result. |
CommandSubmissionService |
Submit a command; don't wait. Track outcome via CompletionService. |
High-throughput integrators where blocking per-submission is wasteful. |
UpdateService |
Stream transaction updates (creates and archives) from a given offset. | Indexers, integrations, "what changed for my parties since X" queries. |
StateService |
Query current active contract set (ACS) and ledger offsets. | Bootstrapping an indexer, reconciliation, snapshotting. |
Additional services — PartyManagementService, PackageService, VersionService — exist for admin tasks and discovery. You'll meet them incidentally.
Beyond the Ledger API, Canton exposes an Admin API (gRPC) for node operations: topology management, DAR uploads, party provisioning, health checks. Also protobuf-defined, also a target for Go ops tooling. You'll see these live under community/admin-api/ in the Canton repo.
If you end up building a Canton-ops CLI in Go, you'll likely be calling both APIs: Ledger API for data plane, Admin API for control plane.
A Canton deployment is a set of JVM processes:
For local development, the Canton sandbox bundles all of this into a single container. The capstone uses it.
Digital Asset does not ship an official Go SDK for the Ledger API today — that's part of why "Go for Canton" is a real contribution area. Existing Go code in and around Canton lives in several places:
Scan these to spot real entry points: issues tagged "good first issue" or "tooling" on digital-asset/canton; community repos under the Digital Asset GitHub org; the Digital Asset developer forum; Canton-related Go repositories searchable via topic:canton language:go on GitHub.
When you want to see real code, not just diagrams:
command_service.proto. The service definition is the cleanest form of the API surface.SubmitAndWait). Find the Scala handler that implements it.docs/ directory or the official docs site.Don't try to read top-down. Canton has too much code for that to work.
ledger-api/grpc-definitions/.CommandService, CommandSubmissionService, UpdateService, StateService.You're done with Module 0. Go play with the Daml playground exercise, then come back and start Module 1 to actually learn Go.