# canton-network-devs/canton-builder-tool architecture

> Architecture diagram of the GitHub repository canton-network-devs/canton-builder-tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/canton-network-devs/canton-builder-tool
- Repository: https://github.com/canton-network-devs/canton-builder-tool

## Overview

Canton Builder Tool is a shell CLI for assembling and operating a local Canton Network from cn-quickstart’s LocalNet compose modules. The principal workflow is: a developer starts the network, the tool selects validators and optional features, and Docker Compose launches the services; the developer can then inspect environment details, mint tokens, deploy a DAR, and manage the running network. The graph also preserves documented authentication, PQS, custom-validator, and lifecycle capabilities. Only the README was available as evidence, so relationships are limited to documented behavior; source-level call ownership could not be verified.

Main entry points: [`canton`](https://github.com/canton-network-devs/canton-builder-tool/blob/main/canton) (Canton CLI), [`scripts/start.sh`](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/start.sh) (Start network), [`scripts/lib/modules.sh`](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/modules.sh) (Compose modules), [`scripts/env.sh`](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/env.sh) (Environment details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI operations"]
  node_cli["Canton CLI"]
  node_start["Start network<br/>[start.sh]"]
  node_stop["Stop network<br/>[stop.sh]"]
  node_status["Network status<br/>[status.sh]"]
  node_env["Environment details<br/>[env.sh]"]
  node_token["Token minting<br/>[token.sh]"]
  node_deploy["DAR deployment<br/>[deploy.sh]"]
  node_logs["Log viewing<br/>[logs.sh]"]
  node_reset["Network reset<br/>[reset.sh]"]
  node_validator["Validator management<br/>[validator.sh]"]
end

subgraph group_assembly["Network assembly"]
  node_compose["Compose assembly<br/>[compose.sh]"]
  node_modules["Compose modules<br/>[modules.sh]"]
  node_registry["Validator registry<br/>[registry.sh]"]
  node_ports["Port allocation<br/>[portalloc.sh]"]
end

subgraph group_configuration["Runtime configuration"]
  node_auth["Auth mode<br/>[auth.sh]"]
  node_customenv["Custom environment<br/>[customenv.sh]"]
  node_overlays["Network overlays"]
end

subgraph group_services["LocalNet services"]
  node_compose_runtime["Docker Compose"]
  node_localnet["Canton LocalNet"]
  node_keycloak["Keycloak"]
  node_pqs[("PQS / Scribe")]
  node_wallets["Wallet UIs"]
  node_ledger["Participant APIs"]
end

node_developer(("Developer"))

node_developer -->|"runs commands"| node_cli
node_cli -->|"starts"| node_start
node_cli -->|"stops"| node_stop
node_cli -->|"checks status"| node_status
node_cli -->|"prints details"| node_env
node_cli -->|"mints tokens"| node_token
node_cli -->|"uploads DAR"| node_deploy
node_cli -->|"tails logs"| node_logs
node_cli -->|"resets network"| node_reset
node_cli -->|"manages validators"| node_validator
node_start -->|"selects modules"| node_modules
node_start -->|"selects validators"| node_registry
node_start -->|"drives"| node_compose
node_compose -->|"runs services"| node_compose_runtime
node_compose_runtime -->|"starts"| node_localnet
node_modules -.->|"optionally includes"| node_keycloak
node_modules -.->|"optionally includes"| node_pqs
node_localnet -->|"provides"| node_wallets
node_localnet -->|"provides"| node_ledger
node_token -.->|"uses auth mode"| node_auth
node_env -.->|"uses auth mode"| node_auth
node_start -.->|"applies configuration"| node_overlays
node_validator -.->|"manages entries"| node_registry

click node_cli "https://github.com/canton-network-devs/canton-builder-tool/blob/main/canton"
click node_start "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/start.sh"
click node_stop "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/stop.sh"
click node_status "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/status.sh"
click node_env "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/env.sh"
click node_token "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/token.sh"
click node_deploy "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/deploy.sh"
click node_logs "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/logs.sh"
click node_reset "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/reset.sh"
click node_validator "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/validator.sh"
click node_compose "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/compose.sh"
click node_modules "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/modules.sh"
click node_registry "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/registry.sh"
click node_ports "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/portalloc.sh"
click node_auth "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/auth.sh"
click node_customenv "https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/customenv.sh"
click node_overlays "https://github.com/canton-network-devs/canton-builder-tool/tree/main/overlays"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_start,node_stop,node_status,node_env,node_token,node_deploy,node_logs,node_reset,node_validator toneBlue
class node_compose,node_modules,node_registry,node_ports toneAmber
class node_auth,node_customenv,node_overlays toneMint
class node_compose_runtime,node_localnet,node_keycloak,node_pqs,node_wallets,node_ledger toneRose
class node_developer toneIndigo
```

## Components

### CLI operations

- [Canton CLI](https://github.com/canton-network-devs/canton-builder-tool/blob/main/canton): `canton`
- [Start network](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/start.sh): `scripts/start.sh`
- [Stop network](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/stop.sh): `scripts/stop.sh`
- [Network status](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/status.sh): `scripts/status.sh`
- [Environment details](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/env.sh): `scripts/env.sh`
- [Token minting](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/token.sh): `scripts/token.sh`
- [DAR deployment](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/deploy.sh): `scripts/deploy.sh`
- [Log viewing](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/logs.sh): `scripts/logs.sh`
- [Network reset](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/reset.sh): `scripts/reset.sh`
- [Validator management](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/validator.sh): `scripts/validator.sh`

### Network assembly

- [Compose assembly](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/compose.sh): `scripts/lib/compose.sh`
- [Compose modules](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/modules.sh): `scripts/lib/modules.sh`
- [Validator registry](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/registry.sh): `scripts/lib/registry.sh`
- [Port allocation](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/portalloc.sh): `scripts/lib/portalloc.sh`

### Runtime configuration

- [Auth mode](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/auth.sh): `scripts/lib/auth.sh`
- [Custom environment](https://github.com/canton-network-devs/canton-builder-tool/blob/main/scripts/lib/customenv.sh): `scripts/lib/customenv.sh`
- [Network overlays](https://github.com/canton-network-devs/canton-builder-tool/tree/main/overlays): `overlays`

### LocalNet services

- **Docker Compose**
- **Canton LocalNet**
- **Keycloak**
- **PQS / Scribe**
- **Wallet UIs**
- **Participant APIs**

### Other components

- **Developer**

## Connections

- Developer → Canton CLI: runs commands (evidence: `README.md`)
- Canton CLI → Start network: starts (evidence: `README.md`)
- Canton CLI → Stop network: stops (evidence: `README.md`)
- Canton CLI → Network status: checks status (evidence: `README.md`)
- Canton CLI → Environment details: prints details (evidence: `README.md`)
- Canton CLI → Token minting: mints tokens (evidence: `README.md`)
- Canton CLI → DAR deployment: uploads DAR (evidence: `README.md`)
- Canton CLI → Log viewing: tails logs (evidence: `README.md`)
- Canton CLI → Network reset: resets network (evidence: `README.md`)
- Canton CLI → Validator management: manages validators (evidence: `README.md`)
- Start network → Compose modules: selects modules (evidence: `README.md`)
- Start network → Validator registry: selects validators (evidence: `README.md`)
- Start network → Compose assembly: drives (evidence: `README.md`)
- Compose assembly → Docker Compose: runs services (evidence: `README.md`)
- Docker Compose → Canton LocalNet: starts (evidence: `README.md`)
- Compose modules → Keycloak: optionally includes (evidence: `README.md`)
- Compose modules → PQS / Scribe: optionally includes (evidence: `README.md`)
- Canton LocalNet → Wallet UIs: provides (evidence: `README.md`)
- Canton LocalNet → Participant APIs: provides (evidence: `README.md`)
- Token minting → Auth mode: uses auth mode (evidence: `README.md`)
- Environment details → Auth mode: uses auth mode (evidence: `README.md`)
- Start network → Network overlays: applies configuration (evidence: `README.md`)
- Validator management → Validator registry: manages entries (evidence: `README.md`)
