# 開発の道具

> Cantonのアプリを作る道具の全体と、SDKの版の合わせ方と、開発の進む順と、道具とAPIの選び方と、Daml StudioでのDamlの書き方を、章の中の図解で追います。

- URL: https://cardene.dev/diagrams/canton-dev-tools
- 公開日: 2026-11-22
- 更新日: 2026-11-22
- トピック: Blockchain
- タグ: Canton
- 親の図解: [Canton Networkの全体像](https://cardene.dev/diagrams/canton-network.md): トランザクションの中身を関わるpartyにだけ見せるCanton Networkについて、部品ごとの役割と、1つのトランザクションが部品の間をどう流れるかを段ごとに追います。
- 子の図解: [アプリを作る道具の全体を知る](https://cardene.dev/diagrams/canton-dev-toolkit.md): Cantonのアプリを作る道具と部品が何で、SDKの版をどう入れて合わせ、開発をどの順で進めるかを、2つの図と表で追います。
- 子の図解: [アプリを作る道具とAPIを選ぶ](https://cardene.dev/diagrams/canton-sdk-and-api-choice.md): Cantonのアプリを作る時に、Daml SDKとコード生成とgRPCのLedger APIとJSON APIとPQSとWallet SDKがそれぞれ何をし、いつ使うかを、2つの図と表で追います。
- 子の図解: [場面ごとに道具を選びIDEを整える](https://cardene.dev/diagrams/canton-dev-toolchain.md): Cantonのアプリを書く、試す、統合する、調べるの場面ごとに使う道具と、Daml StudioとバックエンドのIDEの整え方を、2つの図と表で追います。
- 子の図解: [VS CodeでDamlを書く](https://cardene.dev/diagrams/canton-daml-studio-ide.md): Daml StudioがVS CodeでDamlを書く間に示すエラーと型とテストの結果と、複数のpackageの環境の扱いを、2つの図と表で追います。

前の章「Cantonでの開発の学び始め」では、自分の経験や目的に合う学びの道を選ぶ所を見ました。
この章では、Cantonのアプリを作る道具を追います。

まず、アプリと道具と基盤の部品が何で、Daml SDKの版をどう入れてネットワークに合わせ、開発をどの順で進めるかを見ます。

https://cardene.dev/diagrams/canton-dev-toolkit

続いて、Daml SDKと、コード生成と、Ledger APIの2つの形と、PQSと、Wallet SDKがそれぞれ何をし、いつ使うかを見ます。

https://cardene.dev/diagrams/canton-sdk-and-api-choice

さらに、書く、試す、統合する、調べるの場面ごとに使う道具と、Daml StudioとバックエンドのIDEの整え方を見ます。

https://cardene.dev/diagrams/canton-dev-toolchain

最後に、Daml StudioがVS CodeでDamlを書く間に何を示し、複数のpackageの環境をどう扱うかを見ます。

https://cardene.dev/diagrams/canton-daml-studio-ide

図の語は、それぞれの頁が説明します。

下の図は、この章の4つの頁が扱う物を、dpmとPQSとCanton Consoleと、Daml SDKとVS CodeとValidator Nodeの順に置きます。
虫眼鏡の印が付いた部品を押すと、その部品の中へ入ります。
外側へ戻る時は、右上の「戻る」か、上に並んだ名前を押します。
部品の中へ入ると、名前の並びの下にその部品を説明する頁の題が出て、押すとその頁を開きます。

```dragon
architecture 開発に関わる部品を外から内へ
group Top as 開発に関わる部品 [icon: net]
  box Dpm as dpm [note: 開発の主な入口, color: blue, icon: app, link: /diagrams/canton-dev-toolkit]
  box Pqs as PQS [note: 台帳のイベントをテーブルに写す, color: rose, icon: db, link: /diagrams/canton-dev-toolchain]
  box Con as Canton Console [note: ノードを調べて管理する, color: slate, icon: app, link: /diagrams/canton-dev-toolchain]
  box Sdk as Daml SDK [note: 開発に要る道具を束ねる, color: coin, icon: card, link: /diagrams/canton-sdk-and-api-choice]
  box Vsc as VS Code [note: OSを問わずに動くエディタ, color: blue, icon: app, link: /diagrams/canton-daml-studio-ide]
  box Val as Validator Node [note: コマンドを処理する, color: slate, icon: server, link: /diagrams/canton-sdk-and-api-choice]
end
group VscIn as VS Codeの中 [color: blue, icon: app]
  box Ds as Daml Studio [note: Damlの言語の支援を与える, icon: app, link: /diagrams/canton-dev-toolchain]
  box Side as サイドバー [note: ファイルの構造が出る, icon: card, link: /diagrams/canton-daml-studio-ide]
  box Ed as エディタ [note: Damlのファイル, icon: card, link: /diagrams/canton-daml-studio-ide]
  box Pan as 横のパネル [note: テストの結果が出る, icon: card, link: /diagrams/canton-daml-studio-ide]
end
group ValIn as Validator Nodeの中 [color: slate, icon: server]
  box Pn as Participant Node [note: Canton runtimeを載せる, icon: server, link: /diagrams/canton-dev-toolkit]
  box Lapi as Ledger API [note: コマンドを送りトランザクションを読む, icon: net, link: /diagrams/canton-sdk-and-api-choice]
end
group LapiIn as Ledger APIの中 [color: slate, icon: net]
  box Json as JSON API [note: HTTPとJSONで扱う, icon: net, link: /diagrams/canton-sdk-and-api-choice]
  box Grpc as gRPCのLedger API [note: 高い性能と型付けに向く, icon: net, link: /diagrams/canton-dev-toolkit]
end

step 開発に関わる部品を外から内へ
  say dpmは、プロジェクトの設定ファイルが指すDaml SDKの版を入れます。dpmのDaml Studioを開くコマンドを打つと、Damlの拡張付きでVS Codeが開きます。PQSは、validatorの台帳の状態と同期したPostgreSQLのデータベースを保ち、Canton Consoleは、validatorのACSを照会できます。PQSが同期し、Canton Consoleが照会する相手は、Validator Nodeです。
  Dpm -> Sdk: 版を入れる
  Dpm -> Vsc: 開く
  Pqs -> Val: 同期する
  Con -> Val: ACSを照会する
  source CantonのChoose Your Path [url: https://docs.canton.network/appdev/get-started/choose-your-path]
  source CantonのThe Canton Development Stack [url: https://docs.canton.network/appdev/modules/m1-development-stack]
  source CantonのCanton for Blockchain Developers [url: https://docs.canton.network/appdev/modules/m2-canton-for-ethereum-devs]
  source CantonのConcept Translation Tables [url: https://docs.canton.network/appdev/modules/m2-concept-translation]
  source CantonのSDKs and Tools [url: https://docs.canton.network/sdks-tools/overview]
  source CantonのDaml SDK [url: https://docs.canton.network/sdks-tools/sdks/daml-sdk]
  source CantonのDevelopment Tools Overview [url: https://docs.canton.network/appdev/tooling/development-tools-overview]
  source CantonのIDE Setup [url: https://docs.canton.network/appdev/tooling/ide-setup]
  source CantonのSDKs and APIs [url: https://docs.canton.network/appdev/modules/m4-sdks-apis]
  source CantonのBackend Development [url: https://docs.canton.network/appdev/modules/m4-backend-dev]
  source CantonのDaml Studio [url: https://docs.canton.network/sdks-tools/development-tools/daml-studio]

step VS Codeの中
  say Daml Studioは、Damlのために作った言語の支援を与えるVS Codeの拡張です。Daml Studioは、打つ間にDaml compilerを背後で動かし、型のエラーをエディタに示します。ファイルの構造はサイドバーに、テストの結果は横のパネルに出ます。エディタのScript Resultsのボタンを押すと、横のパネルが開きます。
  Ds -> Ed: 型のエラーを示す
  Ed -> Pan: ボタンで開く
  source CantonのDevelopment Tools Overview [url: https://docs.canton.network/appdev/tooling/development-tools-overview]
  source CantonのIDE Setup [url: https://docs.canton.network/appdev/tooling/ide-setup]
  source CantonのSDKs and Tools [url: https://docs.canton.network/sdks-tools/overview]
  source CantonのThe Canton Development Stack [url: https://docs.canton.network/appdev/modules/m1-development-stack]
  source CantonのSDKs and APIs [url: https://docs.canton.network/appdev/modules/m4-sdks-apis]
  source CantonのDaml Studio [url: https://docs.canton.network/sdks-tools/development-tools/daml-studio]

step Validator Nodeの中
  say Participant Nodeは、validatorのうちCanton runtimeを載せる部分で、Ledger APIを出します。Ledger APIは、コマンドを送り、トランザクションを読むための主なAPIです。
  Pn -> Lapi: 出す
  source CantonのChoose Your Path [url: https://docs.canton.network/appdev/get-started/choose-your-path]
  source CantonのThe Canton Development Stack [url: https://docs.canton.network/appdev/modules/m1-development-stack]
  source CantonのCanton for Blockchain Developers [url: https://docs.canton.network/appdev/modules/m2-canton-for-ethereum-devs]
  source CantonのConcept Translation Tables [url: https://docs.canton.network/appdev/modules/m2-concept-translation]
  source CantonのSDKs and Tools [url: https://docs.canton.network/sdks-tools/overview]
  source CantonのDaml SDK [url: https://docs.canton.network/sdks-tools/sdks/daml-sdk]
  source CantonのDevelopment Tools Overview [url: https://docs.canton.network/appdev/tooling/development-tools-overview]
  source CantonのSDKs and APIs [url: https://docs.canton.network/appdev/modules/m4-sdks-apis]
  source CantonのBackend Development [url: https://docs.canton.network/appdev/modules/m4-backend-dev]

step Ledger APIの中
  say Ledger APIは、validatorのParticipant Nodeが出す、gRPCかJSON APIの通信の形で使えます。Canton 3.xでは、JSON APIはvalidatorに組み込まれ、全ての呼び出しを、gRPCのLedger APIのエンドポイントを通る形に訳します。
  Json -> Grpc: 訳して通す
  source CantonのChoose Your Path [url: https://docs.canton.network/appdev/get-started/choose-your-path]
  source CantonのThe Canton Development Stack [url: https://docs.canton.network/appdev/modules/m1-development-stack]
  source CantonのCanton for Blockchain Developers [url: https://docs.canton.network/appdev/modules/m2-canton-for-ethereum-devs]
  source CantonのConcept Translation Tables [url: https://docs.canton.network/appdev/modules/m2-concept-translation]
  source CantonのSDKs and Tools [url: https://docs.canton.network/sdks-tools/overview]
  source CantonのDaml SDK [url: https://docs.canton.network/sdks-tools/sdks/daml-sdk]
  source CantonのDevelopment Tools Overview [url: https://docs.canton.network/appdev/tooling/development-tools-overview]
  source CantonのSDKs and APIs [url: https://docs.canton.network/appdev/modules/m4-sdks-apis]
  source CantonのBackend Development [url: https://docs.canton.network/appdev/modules/m4-backend-dev]
```

一番外の階では、dpmが、プロジェクトの設定ファイルが指すDaml SDKの版を入れ、VS Codeを開きます。
PQSは、validatorの台帳の状態と同期したPostgreSQLのデータベースを保ち、Canton Consoleは、validatorのACSを照会できます。
PQSが同期し、Canton Consoleが照会する相手は、Validator Nodeです。
ACSは、active contract setの略で、Participant Nodeが今持っている有効なコントラクトの集まりです。

:::details PostgreSQL
PostgreSQLは、オープンソースで開発されているリレーショナルデータベースです。
データをテーブルに分けて持ち、SQLで読み書きします。
:::

VS Codeの中では、Daml Studioが、打つ間にDaml compilerを背後で動かし、型のエラーをエディタに示します。
ファイルの構造はサイドバーに、テストの結果は横のパネルに出て、エディタのScript Resultsのボタンを押すと、横のパネルが開きます。

Validator Nodeの中では、Participant NodeがLedger APIを出します。
Ledger APIは、validatorのParticipant Nodeが出す、gRPCかJSON APIの通信の形で使えます。
Ledger APIの中では、Canton 3.xのvalidatorに組み込まれたJSON APIが、全ての呼び出しを、gRPCのLedger APIのエンドポイントを通る形に訳します。

:::details JSON
JSONは、データを文字で表すための形式で、Webのプログラムどうしのデータのやり取りに広く使われています。
:::

:::details gRPC
gRPCは、Googleが開発した、ネットワーク越しに別のプログラムの処理を呼び出すための通信の仕組みです。
:::

## 出典

https://docs.canton.network/appdev/get-started/choose-your-path

https://docs.canton.network/appdev/modules/m1-development-stack

https://docs.canton.network/appdev/modules/m2-canton-for-ethereum-devs

https://docs.canton.network/appdev/modules/m2-concept-translation

https://docs.canton.network/sdks-tools/overview

https://docs.canton.network/sdks-tools/sdks/daml-sdk

https://docs.canton.network/appdev/tooling/development-tools-overview

https://docs.canton.network/appdev/modules/m4-sdks-apis

https://docs.canton.network/appdev/modules/m4-backend-dev

https://docs.canton.network/appdev/tooling/ide-setup

https://docs.canton.network/sdks-tools/development-tools/daml-studio
