# 設定ファイルと配備

> Cantonの設定ファイルの書き方と起動、Participant Nodeの負荷の抑え方、レプリカと接続プール、Wallet Gatewayの本番の配備を、章の中の図解で追います。

- URL: https://cardene.dev/diagrams/canton-ops-config-deploy
- 公開日: 2026-11-24
- 更新日: 2026-11-24
- トピック: Blockchain
- タグ: Canton
- 親の図解: [Canton Networkの全体像](https://cardene.dev/diagrams/canton-network.md): トランザクションの中身を関わるpartyにだけ見せるCanton Networkについて、部品ごとの役割と、1つのトランザクションが部品の間をどう流れるかを段ごとに追います。
- 子の図解: [設定ファイルでCantonを起動する](https://cardene.dev/diagrams/canton-config-files.md): Cantonの設定ファイルの組み合わせと、起動のコマンドとモードを2つの図で追い、データベースの共有の設定、起動の待機、宣言的な設定は本文で説明します。
- 子の図解: [Participant Nodeの負荷を抑える](https://cardene.dev/diagrams/canton-participant-node-limits.md): Participant Nodeの起動と停止、データベースのマイグレーションをコマンドで確かめ、レプリカの切り替えと送信の要求の上限を2つの図で追います。
- 子の図解: [レプリカと接続プールを組む](https://cardene.dev/diagrams/canton-ha-connections.md): Participant Nodeのレプリカをロードバランサーの後ろに置く組み方と、データベースの接続プールの割り当てを2つの図で追い、キューとPostgreSQLの調整は本文で見ます。
- 子の図解: [Wallet Gatewayを本番に配る](https://cardene.dev/diagrams/canton-wg-deploy.md): Wallet GatewayをDockerとHelmで本番に配る時に固める設定と保存先を表で見て、Kubernetesでの配備と起動や接続の失敗の調べ方を2つの図で追います。

前の章「Wallet GatewayのAPI」では、Wallet Gatewayの4つのspecと、User APIとdAppからの呼び出しを見ました。
この章からは、Cantonのノードを本番で運用する人の立場で、設定ファイルと配備を追います。

まず、Cantonの設定ファイルをどう書いて組み合わせ、どのモードでCantonを起動するかを見ます。
データベースの設定を共有する書き方と、外部の依存先をノードが待つ設定と、DARやpartyをファイルで管理する宣言的な設定も追います。

https://cardene.dev/diagrams/canton-config-files

次に、動いているParticipant NodeをCanton Consoleのコマンドで扱う所を見ます。
Participant Nodeのレプリカは、activeなレプリカと、稼働中でないpassiveなレプリカに分かれます。
起動と停止と状態の確認、データベースのマイグレーション、activeなレプリカの切り替え、送信の要求に掛ける上限を追います。

https://cardene.dev/diagrams/canton-participant-node-limits

続けて、Participant Nodeのレプリカをロードバランサーの後ろに置く組み方と、データベースの接続プールの数の決め方を見ます。
問い合わせのキューの大きさと、データベースの設定と、資源の目安も追います。

https://cardene.dev/diagrams/canton-ha-connections

最後に、前の章で見たWallet Gatewayを、DockerかHelmで本番に配る所を見ます。
配る前に決める設定と、外部からの接続を受ける構成と、保存先を追い、配った後の安全の項目と、起動や接続の失敗の調べ方も見ます。

https://cardene.dev/diagrams/canton-wg-deploy

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

下の図は、この章の4つの頁が扱う物を、運用者からCantonのプロセスとCanton ConsoleとWallet Gatewayの順に置き、Participant Nodeはその後に置きます。
虫眼鏡の印が付いた部品を押すと、その部品の中へ入ります。
外側へ戻る時は、右上の「戻る」か、上に並んだ名前を押します。
部品の中へ入ると、名前の並びの下にその部品を説明する頁の題が出て、押すとその頁を開きます。

中へ入らない部品は、箱の下に頁の題が出る場合があり、押すとその頁を開きます。

```dragon
architecture 運用者から設定ファイルと配備へ
group Top as 設定ファイルと配備 [icon: net]
  box Op as 運用者 [note: 設定を書いて配る, color: blue, icon: user]
  box Proc as Cantonのプロセス [note: 設定ファイルと起動のモードで動かす, color: slate, icon: app, link: /diagrams/canton-config-files]
  box Con as Canton Console [note: コマンドを打つ, color: blue, icon: app, link: /diagrams/canton-participant-node-limits]
  box WG as Wallet Gateway [note: DockerかHelmで本番に配る, color: rose, icon: server, link: /diagrams/canton-wg-deploy]
  box Node as Participant Node [note: レプリカと接続プールを持つ, color: slate, icon: server, link: /diagrams/canton-participant-node-limits]
end
group NodeIn as Participant Nodeの中 [color: slate, icon: server]
  box Pool as 接続プール [note: データベースへの接続を再利用する, icon: db, link: /diagrams/canton-ha-connections]
  box Rep as レプリカ [note: 共有のデータベースで高可用性を得る, icon: refresh, link: /diagrams/canton-ha-connections]
end
group RepIn as レプリカの中 [color: slate, icon: refresh]
  box St as activeとpassiveの状態 [note: 稼働中かどうか, icon: refresh, link: /diagrams/canton-participant-node-limits]
  box Hc as ヘルスチェック [note: 監視の設定で動かすHTTPサーバー, icon: net, link: /diagrams/canton-ha-connections]
end

step 運用者から設定と配備へ
  say 運用者は、設定ファイルをCantonのプロセスへ渡して動かし、Canton Consoleでコマンドを打ち、Wallet GatewayはDockerかHelmで本番に配ります。Cantonのプロセスは、1つでParticipant Nodeを任意の数だけ動かせます。
  Op -> Proc: 設定ファイルを渡す
  Proc -> Node: 動かす
  Op -> Con: コマンドを打つ
  Con -> Node: コマンドを送る
  Op -> WG: 本番に配る
  source CantonのCanton Configuration Guide [url: https://docs.canton.network/global-synchronizer/reference/canton-configuration-guide]
  source CantonのCanton Console Commands [url: https://docs.canton.network/global-synchronizer/reference/canton-console-commands]
  source CantonのPerformance Optimization [url: https://docs.canton.network/global-synchronizer/production-operations/performance-optimization]
  source CantonのDeploy [url: https://docs.canton.network/integrations/wallet-gateway/operate/deploy]
  source CantonのSecurity checklist [url: https://docs.canton.network/integrations/wallet-gateway/operate/security]
  source CantonのTroubleshooting [url: https://docs.canton.network/integrations/wallet-gateway/operate/troubleshooting]
  source CantonのNetworks and identity providers [url: https://docs.canton.network/integrations/wallet-gateway/operate/networks-and-identity]

step Participant Nodeの中
  say Participant Nodeは、データベースへの接続を再利用する接続プールを持ちます。接続の最大の数は設定で決めます。共有のデータベースを使う複数のレプリカで、高可用性を得ます。
  source CantonのCanton Console Commands [url: https://docs.canton.network/global-synchronizer/reference/canton-console-commands]
  source CantonのPerformance Optimization [url: https://docs.canton.network/global-synchronizer/production-operations/performance-optimization]

step レプリカの中
  say Canton Consoleのコマンドは、activeなレプリカをpassiveにして、別のpassiveなレプリカへの切り替えを促します。コマンドが終わっても切り替えが済んだ確認ではないので、健全さの状態で確認します。ヘルスチェックのHTTPサーバーは、監視の設定で動かし、ヘルスチェックのGETの要求に、activeなレプリカの時だけHTTP 200を返します。
  source CantonのCanton Console Commands [url: https://docs.canton.network/global-synchronizer/reference/canton-console-commands]
  source CantonのPerformance Optimization [url: https://docs.canton.network/global-synchronizer/production-operations/performance-optimization]
```

一番外の階では、運用者が設定ファイルをCantonのプロセスへ渡して動かし、Canton Consoleでコマンドを打ち、Wallet GatewayをDockerかHelmで本番に配ります。
Cantonのプロセスは、Participant Nodeを動かし、Canton Consoleのコマンドは、Participant Nodeへ届きます。

Participant Nodeの中では、接続プールがデータベースへの接続を再利用し、接続の最大の数は設定で決めます。
レプリカは、共有のデータベースを使って高可用性を得ます。

レプリカの中では、activeとpassiveの状態と、監視の設定で動かすHTTPサーバーのヘルスチェックを見ます。
Canton Consoleのコマンドは、activeなレプリカをpassiveにして切り替えを促します。
ロードバランサーは、ヘルスチェックのHTTPサーバーへGETの要求を出して、activeなレプリカを見つけます。

## 出典

https://docs.canton.network/global-synchronizer/reference/canton-configuration-guide

https://docs.canton.network/global-synchronizer/reference/canton-console-commands

https://docs.canton.network/global-synchronizer/production-operations/performance-optimization

https://docs.canton.network/integrations/wallet-gateway/operate/deploy

https://docs.canton.network/integrations/wallet-gateway/operate/security

https://docs.canton.network/integrations/wallet-gateway/operate/troubleshooting

https://docs.canton.network/integrations/wallet-gateway/operate/networks-and-identity
