@distrohelena/canton-typescript-sdk 0.1.31 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,75 +70,3 @@ canton.participants.extra-3 = $${_participant} {
70
70
  }
71
71
  }
72
72
 
73
- canton.participants.extra-1.ledger-api.auth-services = [
74
- {
75
- type = unsafe-jwt-hmac-256
76
- target-audience = "https://canton.network.global"
77
- secret = "unsafe"
78
- },
79
- {
80
- type = jwt-es-256-crt
81
- certificate = "/app/es256-certificate.pem"
82
- target-audience = "https://canton.network.global/es256"
83
- }
84
- ]
85
-
86
- canton.participants.extra-2.ledger-api.auth-services = [
87
- {
88
- type = unsafe-jwt-hmac-256
89
- target-audience = "https://canton.network.global"
90
- secret = "unsafe"
91
- },
92
- {
93
- type = jwt-es-256-crt
94
- certificate = "/app/es256-certificate.pem"
95
- target-audience = "https://canton.network.global/es256"
96
- }
97
- ]
98
-
99
- canton.participants.extra-3.ledger-api.auth-services = [
100
- {
101
- type = unsafe-jwt-hmac-256
102
- target-audience = "https://canton.network.global"
103
- secret = "unsafe"
104
- },
105
- {
106
- type = jwt-es-256-crt
107
- certificate = "/app/es256-certificate.pem"
108
- target-audience = "https://canton.network.global/es256"
109
- }
110
- ]
111
-
112
- canton.participants.extra-1.ledger-api.tls {
113
- cert-chain-file = "/app/localnet-tls/server.crt"
114
- private-key-file = "/app/localnet-tls/server.key"
115
- trust-collection-file = "/app/localnet-tls/ca.crt"
116
- }
117
- canton.participants.extra-1.admin-api.tls {
118
- cert-chain-file = "/app/localnet-tls/server.crt"
119
- private-key-file = "/app/localnet-tls/server.key"
120
- trust-collection-file = "/app/localnet-tls/ca.crt"
121
- }
122
-
123
- canton.participants.extra-2.ledger-api.tls {
124
- cert-chain-file = "/app/localnet-tls/server.crt"
125
- private-key-file = "/app/localnet-tls/server.key"
126
- trust-collection-file = "/app/localnet-tls/ca.crt"
127
- }
128
- canton.participants.extra-2.admin-api.tls {
129
- cert-chain-file = "/app/localnet-tls/server.crt"
130
- private-key-file = "/app/localnet-tls/server.key"
131
- trust-collection-file = "/app/localnet-tls/ca.crt"
132
- }
133
-
134
- canton.participants.extra-3.ledger-api.tls {
135
- cert-chain-file = "/app/localnet-tls/server.crt"
136
- private-key-file = "/app/localnet-tls/server.key"
137
- trust-collection-file = "/app/localnet-tls/ca.crt"
138
- }
139
- canton.participants.extra-3.admin-api.tls {
140
- cert-chain-file = "/app/localnet-tls/server.crt"
141
- private-key-file = "/app/localnet-tls/server.key"
142
- trust-collection-file = "/app/localnet-tls/ca.crt"
143
- }
144
-
@@ -103,18 +103,3 @@ canton.validator-apps.extra-3-validator_backend = $${_validator_backend} {
103
103
 
104
104
  canton.sv-apps.sv.expected-validator-onboardings += { secret = "${EXTRA_VALIDATOR_3_ONBOARDING_SECRET}" }
105
105
 
106
- canton.validator-apps.extra-1-validator_backend.participant-client {
107
- admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
108
- ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
109
- }
110
-
111
- canton.validator-apps.extra-2-validator_backend.participant-client {
112
- admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
113
- ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
114
- }
115
-
116
- canton.validator-apps.extra-3-validator_backend.participant-client {
117
- admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
118
- ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
119
- }
120
-
@@ -84,78 +84,6 @@ services:
84
84
  }
85
85
  }
86
86
 
87
- canton.participants.extra-1.ledger-api.auth-services = [
88
- {
89
- type = unsafe-jwt-hmac-256
90
- target-audience = "https://canton.network.global"
91
- secret = "unsafe"
92
- },
93
- {
94
- type = jwt-es-256-crt
95
- certificate = "/app/es256-certificate.pem"
96
- target-audience = "https://canton.network.global/es256"
97
- }
98
- ]
99
-
100
- canton.participants.extra-2.ledger-api.auth-services = [
101
- {
102
- type = unsafe-jwt-hmac-256
103
- target-audience = "https://canton.network.global"
104
- secret = "unsafe"
105
- },
106
- {
107
- type = jwt-es-256-crt
108
- certificate = "/app/es256-certificate.pem"
109
- target-audience = "https://canton.network.global/es256"
110
- }
111
- ]
112
-
113
- canton.participants.extra-3.ledger-api.auth-services = [
114
- {
115
- type = unsafe-jwt-hmac-256
116
- target-audience = "https://canton.network.global"
117
- secret = "unsafe"
118
- },
119
- {
120
- type = jwt-es-256-crt
121
- certificate = "/app/es256-certificate.pem"
122
- target-audience = "https://canton.network.global/es256"
123
- }
124
- ]
125
-
126
- canton.participants.extra-1.ledger-api.tls {
127
- cert-chain-file = "/app/localnet-tls/server.crt"
128
- private-key-file = "/app/localnet-tls/server.key"
129
- trust-collection-file = "/app/localnet-tls/ca.crt"
130
- }
131
- canton.participants.extra-1.admin-api.tls {
132
- cert-chain-file = "/app/localnet-tls/server.crt"
133
- private-key-file = "/app/localnet-tls/server.key"
134
- trust-collection-file = "/app/localnet-tls/ca.crt"
135
- }
136
-
137
- canton.participants.extra-2.ledger-api.tls {
138
- cert-chain-file = "/app/localnet-tls/server.crt"
139
- private-key-file = "/app/localnet-tls/server.key"
140
- trust-collection-file = "/app/localnet-tls/ca.crt"
141
- }
142
- canton.participants.extra-2.admin-api.tls {
143
- cert-chain-file = "/app/localnet-tls/server.crt"
144
- private-key-file = "/app/localnet-tls/server.key"
145
- trust-collection-file = "/app/localnet-tls/ca.crt"
146
- }
147
-
148
- canton.participants.extra-3.ledger-api.tls {
149
- cert-chain-file = "/app/localnet-tls/server.crt"
150
- private-key-file = "/app/localnet-tls/server.key"
151
- trust-collection-file = "/app/localnet-tls/ca.crt"
152
- }
153
- canton.participants.extra-3.admin-api.tls {
154
- cert-chain-file = "/app/localnet-tls/server.crt"
155
- private-key-file = "/app/localnet-tls/server.key"
156
- trust-collection-file = "/app/localnet-tls/ca.crt"
157
- }
158
-
159
87
  ports:
160
88
  - "${EXTRA_PARTICIPANT_1_LEDGER_API_PUBLISHED_PORT}:${EXTRA_PARTICIPANT_1_LEDGER_API_PORT}"
161
89
  - "${EXTRA_PARTICIPANT_1_ADMIN_API_PUBLISHED_PORT}:${EXTRA_PARTICIPANT_1_ADMIN_API_PORT}"
@@ -276,21 +204,6 @@ services:
276
204
 
277
205
  canton.sv-apps.sv.expected-validator-onboardings += { secret = "${EXTRA_VALIDATOR_3_ONBOARDING_SECRET}" }
278
206
 
279
- canton.validator-apps.extra-1-validator_backend.participant-client {
280
- admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
281
- ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
282
- }
283
-
284
- canton.validator-apps.extra-2-validator_backend.participant-client {
285
- admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
286
- ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
287
- }
288
-
289
- canton.validator-apps.extra-3-validator_backend.participant-client {
290
- admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
291
- ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
292
- }
293
-
294
207
  ports:
295
208
  - "${EXTRA_VALIDATOR_1_ADMIN_API_PUBLISHED_PORT}:${EXTRA_VALIDATOR_1_ADMIN_API_PORT}"
296
209
  - "${EXTRA_VALIDATOR_2_ADMIN_API_PUBLISHED_PORT}:${EXTRA_VALIDATOR_2_ADMIN_API_PORT}"
@@ -333,10 +246,8 @@ services:
333
246
  SCRIBE_TARGET_POSTGRES_USERNAME: ${DB_USER}
334
247
  SCRIBE_TARGET_POSTGRES_PASSWORD: ${DB_PASSWORD}
335
248
  SCRIBE_CONFIG: /onboarding/extra-1-pqs.conf
336
- SCRIBE_SOURCE_LEDGER_TLS_CAFILE: /app/localnet-tls/ca.crt
337
249
  volumes:
338
250
  - onboarding:/onboarding
339
- - "/home/helena/env/daml/typescript-sdk/.generated/localnet-tls/ca.crt:/app/localnet-tls/ca.crt:ro"
340
251
  command:
341
252
  - pipeline
342
253
  - ledger
@@ -387,10 +298,8 @@ services:
387
298
  SCRIBE_TARGET_POSTGRES_USERNAME: ${DB_USER}
388
299
  SCRIBE_TARGET_POSTGRES_PASSWORD: ${DB_PASSWORD}
389
300
  SCRIBE_CONFIG: /onboarding/extra-2-pqs.conf
390
- SCRIBE_SOURCE_LEDGER_TLS_CAFILE: /app/localnet-tls/ca.crt
391
301
  volumes:
392
302
  - onboarding:/onboarding
393
- - "/home/helena/env/daml/typescript-sdk/.generated/localnet-tls/ca.crt:/app/localnet-tls/ca.crt:ro"
394
303
  command:
395
304
  - pipeline
396
305
  - ledger
@@ -441,10 +350,8 @@ services:
441
350
  SCRIBE_TARGET_POSTGRES_USERNAME: ${DB_USER}
442
351
  SCRIBE_TARGET_POSTGRES_PASSWORD: ${DB_PASSWORD}
443
352
  SCRIBE_CONFIG: /onboarding/extra-3-pqs.conf
444
- SCRIBE_SOURCE_LEDGER_TLS_CAFILE: /app/localnet-tls/ca.crt
445
353
  volumes:
446
354
  - onboarding:/onboarding
447
- - "/home/helena/env/daml/typescript-sdk/.generated/localnet-tls/ca.crt:/app/localnet-tls/ca.crt:ro"
448
355
  command:
449
356
  - pipeline
450
357
  - ledger
@@ -911,7 +911,7 @@ extra_participants_healthy() {
911
911
  local prefix=$((index + 4))
912
912
  local health_port
913
913
  health_port="$(participant_port "$prefix" "$CANTON_HTTP_HEALTHCHECK_PORT_SUFFIX")"
914
- checks+=("curl -sf --max-time 2 http://localhost:${health_port}/health > /dev/null")
914
+ checks+=("wget -q --timeout=2 --tries=1 -O /dev/null http://localhost:${health_port}/health")
915
915
  done
916
916
 
917
917
  local joined_checks
@@ -968,7 +968,7 @@ container_health_is_ready() {
968
968
  local _container="$1"
969
969
  local _lifecycle_state="$2"
970
970
  local health_status="$3"
971
- [[ "$health_status" == "healthy" ]]
971
+ [[ "$lifecycle_state" == "running" && "$health_status" == "healthy" ]]
972
972
  }
973
973
 
974
974
  canton_and_extras_are_ready() {
@@ -976,7 +976,8 @@ canton_and_extras_are_ready() {
976
976
  local _lifecycle_state="$2"
977
977
  local health_status="$3"
978
978
  local extra_participants="$4"
979
- [[ "$health_status" == "healthy" ]] && extra_participants_healthy "$extra_participants"
979
+ [[ "$lifecycle_state" == "running" && "$health_status" == "healthy" ]] \
980
+ && extra_participants_healthy "$extra_participants"
980
981
  }
981
982
 
982
983
  print_container_logs() {
@@ -1008,7 +1009,7 @@ wait_for_container_readiness() {
1008
1009
  lifecycle_state="${lifecycle_state:-missing}"
1009
1010
  health_status="${health_status:-unknown}"
1010
1011
 
1011
- if [[ "$lifecycle_state" != "running" ]]; then
1012
+ if [[ "$lifecycle_state" != "running" && "$lifecycle_state" != "restarting" ]]; then
1012
1013
  echo "$container is not running (state: $lifecycle_state)." >&2
1013
1014
  print_container_logs "$container"
1014
1015
  return 1
@@ -153,6 +153,18 @@ if [[ "${1:-}" == "inspect" ]]; then
153
153
  slow-splice:splice)
154
154
  if (( count <= 61 )); then health=starting; fi
155
155
  ;;
156
+ restarting-canton:canton)
157
+ if (( count == 1 )); then
158
+ lifecycle=restarting
159
+ health=unhealthy
160
+ fi
161
+ ;;
162
+ restarting-healthy-canton:canton)
163
+ if (( count == 1 )); then
164
+ lifecycle=restarting
165
+ health=healthy
166
+ fi
167
+ ;;
156
168
  exited-canton:canton)
157
169
  lifecycle=exited
158
170
  health=unhealthy
@@ -170,8 +182,21 @@ if [[ "${1:-}" == "logs" ]]; then
170
182
  printf 'stub log tail for %s\n' "${!#}"
171
183
  exit 0
172
184
  fi
173
- if [[ "${1:-}" == "exec" ]]; then
174
- extra_pqs_config_file=""
185
+ if [[ "${1:-}" == "exec" ]]; then
186
+ if [[ "$*" == *"http://localhost:"* ]]; then
187
+ printf '%s\n' "$*" > "${START_LOCAL_TEST_DOCKER_STATE_DIR}/extra-healthcheck-command"
188
+ healthcheck_state_file="${START_LOCAL_TEST_DOCKER_STATE_DIR}/${docker_mode}-extra-healthcheck.count"
189
+ healthcheck_count=0
190
+ if [[ -f "$healthcheck_state_file" ]]; then
191
+ healthcheck_count="$(<"$healthcheck_state_file")"
192
+ fi
193
+ healthcheck_count=$((healthcheck_count + 1))
194
+ printf '%s\n' "$healthcheck_count" > "$healthcheck_state_file"
195
+ if [[ "$docker_mode" == "slow-extra-health" && "$healthcheck_count" == "1" ]]; then
196
+ exit 1
197
+ fi
198
+ fi
199
+ extra_pqs_config_file=""
175
200
  while (( "$#" )); do
176
201
  if [[ "${1:-}" == "-e" && "${2:-}" == EXTRA_PQS_CONFIG_FILE=* ]]; then
177
202
  extra_pqs_config_file="${2#EXTRA_PQS_CONFIG_FILE=}"
@@ -449,6 +474,8 @@ run_case $'.PHONY: start\nstart:\n' 'stub env AUTH_MODE=oauth2' oauth2
449
474
  run_case $'.PHONY: start\nstart:\n' 'canton readiness: running/starting' shared-secret slow-canton
450
475
  run_case $'.PHONY: start\nstart:\n' 'canton is still not ready (state: running, health: starting).' shared-secret slow-canton
451
476
  run_case $'.PHONY: start\nstart:\n' 'stub log tail for canton' shared-secret slow-canton
477
+ run_case $'.PHONY: start\nstart:\n' 'canton readiness: restarting/unhealthy' shared-secret restarting-canton
478
+ run_case $'.PHONY: start\nstart:\n' 'canton readiness: running/healthy' shared-secret restarting-healthy-canton
452
479
  run_case $'.PHONY: start\nstart:\n' 'canton is not running (state: exited).' shared-secret exited-canton '' '' '' 0 0 '' '' '' 1
453
480
  run_case $'.PHONY: start\nstart:\n' 'stub log tail for canton' shared-secret exited-canton '' '' '' 0 0 '' '' '' 1
454
481
  run_case $'.PHONY: start\nstart:\n' 'splice readiness: running/starting' shared-secret slow-splice 1
@@ -461,6 +488,9 @@ run_case $'.PHONY: start\nstart:\n' 'stub docker-compose -f compose.yaml -f '"$t
461
488
  run_case $'.PHONY: start\nstart:\n' 'stub docker compose -f compose.yaml -f '"$tmpdir"'/quickstart/docker/modules/localnet/compose.yaml -f '"$tmpdir"'/quickstart/docker/modules/splice-onboarding/compose.yaml -f '"$tmpdir"'/quickstart/docker/modules/pqs/compose.yaml --env-file .env --env-file .env.local --env-file '"$tmpdir"'/quickstart/docker/modules/localnet/compose.env --env-file '"$tmpdir"'/quickstart/docker/modules/localnet/env/common.env --env-file '"$tmpdir"'/quickstart/docker/modules/pqs/compose.env --profile app-provider --profile pqs-app-provider --profile pqs-sv -f '"$tmpdir"'/generated/compose-extra-participants.yaml --env-file '"$tmpdir"'/generated/extra-participants.env down -v --remove-orphans' shared-secret default 3
462
489
  run_case $'.PHONY: start\nstart:\n' 'stub docker compose -f compose.yaml -f '"$tmpdir"'/quickstart/docker/modules/localnet/compose.yaml -f '"$tmpdir"'/quickstart/docker/modules/splice-onboarding/compose.yaml -f '"$tmpdir"'/quickstart/docker/modules/pqs/compose.yaml --env-file .env --env-file .env.local --env-file '"$tmpdir"'/quickstart/docker/modules/localnet/compose.env --env-file '"$tmpdir"'/quickstart/docker/modules/localnet/env/common.env --env-file '"$tmpdir"'/quickstart/docker/modules/pqs/compose.env --profile app-provider --profile pqs-app-provider --profile pqs-sv -f '"$tmpdir"'/generated/compose-extra-participants.yaml --env-file '"$tmpdir"'/generated/extra-participants.env up -d --no-recreate pqs-extra-1 pqs-extra-2 pqs-extra-3' shared-secret default 3
463
490
  run_case $'.PHONY: start\nstart:\n' 'ES256 bearer token written to '"$tmpdir"'/es256/ledger-api-user.token' shared-secret default 3 '' '' 1
491
+ assert_file_contains_text "$tmpdir/docker-state/extra-healthcheck-command" 'wget -q --timeout=2 --tries=1 -O /dev/null http://localhost:5900/health'
492
+ assert_file_contains_text "$tmpdir/docker-state/extra-healthcheck-command" 'wget -q --timeout=2 --tries=1 -O /dev/null http://localhost:6900/health'
493
+ assert_file_contains_text "$tmpdir/docker-state/extra-healthcheck-command" 'wget -q --timeout=2 --tries=1 -O /dev/null http://localhost:7900/health'
464
494
  assert_file_contains "$tmpdir/es256/canton-es256.conf" 'canton.participants.app-provider.ledger-api.auth-services = ['
465
495
  assert_file_contains "$tmpdir/es256/canton-es256.conf" ' type = jwt-es-256-crt'
466
496
  assert_file_contains "$tmpdir/es256/canton-es256.conf" ' certificate = "/app/es256-certificate.pem"'
@@ -481,6 +511,8 @@ assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR
481
511
  assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR_1_WALLET_ADMIN_USER_NAME=extra-1'
482
512
  assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR_1_AUTH_AUDIENCE=https://canton.network.global'
483
513
  assert_file_contains "$tmpdir/generated/extra-participants.env" 'CREATE_DATABASE_EXTRA_PQS_1=pqs-extra-1'
514
+ run_case $'.PHONY: start\nstart:\n' 'stub extra pqs startup' shared-secret slow-extra-health 3
515
+ assert_file_contains "$tmpdir/docker-state/slow-extra-health-extra-healthcheck.count" '2'
484
516
  assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_PQS_1_POSTGRES_PUBLISHED_PORT=5541'
485
517
  assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_PQS_3_POSTGRES_PUBLISHED_PORT=5543'
486
518
  assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' ADDITIONAL_CONFIG_EXTRA_PARTICIPANTS: |'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distrohelena/canton-typescript-sdk",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",