@distrohelena/canton-typescript-sdk 0.1.31 → 0.1.33

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.
@@ -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.33",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,7 +13,9 @@
13
13
  ],
14
14
  "bin": {
15
15
  "canton-localnet-start": "node/start-local.sh",
16
- "canton-localnet-stop": "node/stop-local.sh"
16
+ "canton-localnet-stop": "node/stop-local.sh",
17
+ "canton-localnet-participant-358-start": "node/start-local-participant-358.sh",
18
+ "canton-localnet-participant-358-stop": "node/stop-local-participant-358.sh"
17
19
  },
18
20
  "keywords": [
19
21
  "canton",
@@ -90,8 +92,12 @@
90
92
  "lint:fix": "eslint . --fix --max-warnings=0",
91
93
  "start:local-ledger": "bash node/start-local.sh",
92
94
  "stop:local-ledger": "bash node/stop-local.sh",
95
+ "start:local-participant-358": "bash node/start-local-participant-358.sh",
96
+ "stop:local-participant-358": "bash node/stop-local-participant-358.sh",
93
97
  "test:start-local-script": "bash node/test-start-local.sh",
94
98
  "test:stop-local-script": "bash node/test-stop-local.sh",
99
+ "test:participant-358-sidecar-script": "bash node/test-participant-358-sidecar.sh",
100
+ "test:participant-358-sidecar-smoke": "bash node/test-participant-358-sidecar-smoke.sh",
95
101
  "test": "vitest run --maxWorkers=1 --testTimeout=15000",
96
102
  "test:property": "vitest run tests/property --maxWorkers=1 --testTimeout=15000",
97
103
  "test:live": "vitest run tests/live --maxWorkers=1 --testTimeout=15000",
@@ -1,144 +0,0 @@
1
- canton.participants.extra-1 = $${_participant} {
2
- storage.config.properties.databaseName = "participant-extra-1"
3
- init {
4
- generate-topology-transactions-and-keys = true
5
- identity.type = auto
6
- }
7
- monitoring {
8
- http-health-server.port = ${EXTRA_PARTICIPANT_1_HTTP_HEALTHCHECK_PORT}
9
- grpc-health-server.port = ${EXTRA_PARTICIPANT_1_GRPC_HEALTHCHECK_PORT}
10
- }
11
- http-ledger-api.port = ${EXTRA_PARTICIPANT_1_JSON_API_PORT}
12
- admin-api.port = ${EXTRA_PARTICIPANT_1_ADMIN_API_PORT}
13
- ledger-api.port = ${EXTRA_PARTICIPANT_1_LEDGER_API_PORT}
14
- ledger-api {
15
- auth-services = [{
16
- type = unsafe-jwt-hmac-256
17
- target-audience = "${EXTRA_VALIDATOR_1_AUTH_AUDIENCE}"
18
- secret = "unsafe"
19
- }]
20
-
21
- user-management-service.additional-admin-user-id = "${EXTRA_VALIDATOR_1_USER_NAME}"
22
- }
23
- }
24
-
25
- canton.participants.extra-2 = $${_participant} {
26
- storage.config.properties.databaseName = "participant-extra-2"
27
- init {
28
- generate-topology-transactions-and-keys = true
29
- identity.type = auto
30
- }
31
- monitoring {
32
- http-health-server.port = ${EXTRA_PARTICIPANT_2_HTTP_HEALTHCHECK_PORT}
33
- grpc-health-server.port = ${EXTRA_PARTICIPANT_2_GRPC_HEALTHCHECK_PORT}
34
- }
35
- http-ledger-api.port = ${EXTRA_PARTICIPANT_2_JSON_API_PORT}
36
- admin-api.port = ${EXTRA_PARTICIPANT_2_ADMIN_API_PORT}
37
- ledger-api.port = ${EXTRA_PARTICIPANT_2_LEDGER_API_PORT}
38
- ledger-api {
39
- auth-services = [{
40
- type = unsafe-jwt-hmac-256
41
- target-audience = "${EXTRA_VALIDATOR_2_AUTH_AUDIENCE}"
42
- secret = "unsafe"
43
- }]
44
-
45
- user-management-service.additional-admin-user-id = "${EXTRA_VALIDATOR_2_USER_NAME}"
46
- }
47
- }
48
-
49
- canton.participants.extra-3 = $${_participant} {
50
- storage.config.properties.databaseName = "participant-extra-3"
51
- init {
52
- generate-topology-transactions-and-keys = true
53
- identity.type = auto
54
- }
55
- monitoring {
56
- http-health-server.port = ${EXTRA_PARTICIPANT_3_HTTP_HEALTHCHECK_PORT}
57
- grpc-health-server.port = ${EXTRA_PARTICIPANT_3_GRPC_HEALTHCHECK_PORT}
58
- }
59
- http-ledger-api.port = ${EXTRA_PARTICIPANT_3_JSON_API_PORT}
60
- admin-api.port = ${EXTRA_PARTICIPANT_3_ADMIN_API_PORT}
61
- ledger-api.port = ${EXTRA_PARTICIPANT_3_LEDGER_API_PORT}
62
- ledger-api {
63
- auth-services = [{
64
- type = unsafe-jwt-hmac-256
65
- target-audience = "${EXTRA_VALIDATOR_3_AUTH_AUDIENCE}"
66
- secret = "unsafe"
67
- }]
68
-
69
- user-management-service.additional-admin-user-id = "${EXTRA_VALIDATOR_3_USER_NAME}"
70
- }
71
- }
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
-
@@ -1,120 +0,0 @@
1
- canton.validator-apps.extra-1-validator_backend = $${_validator_backend} {
2
- onboarding.secret = "${EXTRA_VALIDATOR_1_ONBOARDING_SECRET}"
3
- domain-migration-dump-path = "/domain-upgrade-dump/domain_migration_dump-extra-1.json"
4
- storage.config.properties.databaseName = "${EXTRA_VALIDATOR_1_DB}"
5
- admin-api.port = ${EXTRA_VALIDATOR_1_ADMIN_API_PORT}
6
- canton-identifier-config.participant = extra-1
7
- participant-client {
8
- admin-api.port = ${EXTRA_PARTICIPANT_1_ADMIN_API_PORT}
9
- ledger-api {
10
- client-config.port = ${EXTRA_PARTICIPANT_1_LEDGER_API_PORT}
11
- auth-config = {
12
- type = "self-signed"
13
- user = "${EXTRA_VALIDATOR_1_USER_NAME}"
14
- audience = "${EXTRA_VALIDATOR_1_AUTH_AUDIENCE}"
15
- secret = "unsafe"
16
- }
17
- }
18
- }
19
- auth = {
20
- algorithm = "hs-256-unsafe"
21
- audience = "${EXTRA_VALIDATOR_1_AUTH_AUDIENCE}"
22
- secret = "unsafe"
23
- }
24
- ledger-api-user = "${EXTRA_VALIDATOR_1_USER_NAME}"
25
- validator-wallet-users.0 = "${EXTRA_VALIDATOR_1_WALLET_ADMIN_USER_NAME}"
26
- validator-party-hint = "${EXTRA_VALIDATOR_1_PARTY_HINT}"
27
-
28
- domains.global.buy-extra-traffic {
29
- min-topup-interval = ${?MIN_TRAFFIC_TOPUP_INTERVAL}
30
- target-throughput = ${?TARGET_TRAFFIC_THROUGHPUT}
31
- }
32
- }
33
-
34
- canton.sv-apps.sv.expected-validator-onboardings += { secret = "${EXTRA_VALIDATOR_1_ONBOARDING_SECRET}" }
35
-
36
- canton.validator-apps.extra-2-validator_backend = $${_validator_backend} {
37
- onboarding.secret = "${EXTRA_VALIDATOR_2_ONBOARDING_SECRET}"
38
- domain-migration-dump-path = "/domain-upgrade-dump/domain_migration_dump-extra-2.json"
39
- storage.config.properties.databaseName = "${EXTRA_VALIDATOR_2_DB}"
40
- admin-api.port = ${EXTRA_VALIDATOR_2_ADMIN_API_PORT}
41
- canton-identifier-config.participant = extra-2
42
- participant-client {
43
- admin-api.port = ${EXTRA_PARTICIPANT_2_ADMIN_API_PORT}
44
- ledger-api {
45
- client-config.port = ${EXTRA_PARTICIPANT_2_LEDGER_API_PORT}
46
- auth-config = {
47
- type = "self-signed"
48
- user = "${EXTRA_VALIDATOR_2_USER_NAME}"
49
- audience = "${EXTRA_VALIDATOR_2_AUTH_AUDIENCE}"
50
- secret = "unsafe"
51
- }
52
- }
53
- }
54
- auth = {
55
- algorithm = "hs-256-unsafe"
56
- audience = "${EXTRA_VALIDATOR_2_AUTH_AUDIENCE}"
57
- secret = "unsafe"
58
- }
59
- ledger-api-user = "${EXTRA_VALIDATOR_2_USER_NAME}"
60
- validator-wallet-users.0 = "${EXTRA_VALIDATOR_2_WALLET_ADMIN_USER_NAME}"
61
- validator-party-hint = "${EXTRA_VALIDATOR_2_PARTY_HINT}"
62
-
63
- domains.global.buy-extra-traffic {
64
- min-topup-interval = ${?MIN_TRAFFIC_TOPUP_INTERVAL}
65
- target-throughput = ${?TARGET_TRAFFIC_THROUGHPUT}
66
- }
67
- }
68
-
69
- canton.sv-apps.sv.expected-validator-onboardings += { secret = "${EXTRA_VALIDATOR_2_ONBOARDING_SECRET}" }
70
-
71
- canton.validator-apps.extra-3-validator_backend = $${_validator_backend} {
72
- onboarding.secret = "${EXTRA_VALIDATOR_3_ONBOARDING_SECRET}"
73
- domain-migration-dump-path = "/domain-upgrade-dump/domain_migration_dump-extra-3.json"
74
- storage.config.properties.databaseName = "${EXTRA_VALIDATOR_3_DB}"
75
- admin-api.port = ${EXTRA_VALIDATOR_3_ADMIN_API_PORT}
76
- canton-identifier-config.participant = extra-3
77
- participant-client {
78
- admin-api.port = ${EXTRA_PARTICIPANT_3_ADMIN_API_PORT}
79
- ledger-api {
80
- client-config.port = ${EXTRA_PARTICIPANT_3_LEDGER_API_PORT}
81
- auth-config = {
82
- type = "self-signed"
83
- user = "${EXTRA_VALIDATOR_3_USER_NAME}"
84
- audience = "${EXTRA_VALIDATOR_3_AUTH_AUDIENCE}"
85
- secret = "unsafe"
86
- }
87
- }
88
- }
89
- auth = {
90
- algorithm = "hs-256-unsafe"
91
- audience = "${EXTRA_VALIDATOR_3_AUTH_AUDIENCE}"
92
- secret = "unsafe"
93
- }
94
- ledger-api-user = "${EXTRA_VALIDATOR_3_USER_NAME}"
95
- validator-wallet-users.0 = "${EXTRA_VALIDATOR_3_WALLET_ADMIN_USER_NAME}"
96
- validator-party-hint = "${EXTRA_VALIDATOR_3_PARTY_HINT}"
97
-
98
- domains.global.buy-extra-traffic {
99
- min-topup-interval = ${?MIN_TRAFFIC_TOPUP_INTERVAL}
100
- target-throughput = ${?TARGET_TRAFFIC_THROUGHPUT}
101
- }
102
- }
103
-
104
- canton.sv-apps.sv.expected-validator-onboardings += { secret = "${EXTRA_VALIDATOR_3_ONBOARDING_SECRET}" }
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
-