@distrohelena/canton-typescript-sdk 0.1.21 → 0.1.22
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.
- package/node/start-local.sh +7 -2
- package/node/test-start-local.sh +60 -2
- package/package.json +1 -1
package/node/start-local.sh
CHANGED
|
@@ -190,6 +190,11 @@ prepare_tls_runtime_files() {
|
|
|
190
190
|
openssl req -x509 -new -sha256 -days 3650 -key "$ca_key_path" \
|
|
191
191
|
-subj "/CN=localnet-tls-ca" -out "$ca_certificate_path" >/dev/null 2>&1
|
|
192
192
|
fi
|
|
193
|
+
if [[ -e "$server_certificate_path" ]] \
|
|
194
|
+
&& ! openssl x509 -in "$server_certificate_path" -noout -ext subjectAltName 2>/dev/null \
|
|
195
|
+
| grep -Fq 'IP Address:127.0.0.1, IP Address:0.0.0.0'; then
|
|
196
|
+
rm -f "$server_key_path" "$server_certificate_path"
|
|
197
|
+
fi
|
|
193
198
|
if [[ ! -e "$server_key_path" || ! -e "$server_certificate_path" ]]; then
|
|
194
199
|
rm -f "$server_key_path" "$server_certificate_path"
|
|
195
200
|
local csr_path="$runtime_dir/server.csr"
|
|
@@ -202,7 +207,7 @@ prepare_tls_runtime_files() {
|
|
|
202
207
|
basicConstraints = CA:FALSE
|
|
203
208
|
keyUsage = digitalSignature, keyEncipherment
|
|
204
209
|
extendedKeyUsage = serverAuth
|
|
205
|
-
subjectAltName = DNS:localhost, DNS:canton, IP:127.0.0.1
|
|
210
|
+
subjectAltName = DNS:localhost, DNS:canton, IP:127.0.0.1, IP:0.0.0.0
|
|
206
211
|
EOF
|
|
207
212
|
openssl x509 -req -sha256 -days 3650 -in "$csr_path" \
|
|
208
213
|
-CA "$ca_certificate_path" -CAkey "$ca_key_path" -CAcreateserial \
|
|
@@ -839,7 +844,7 @@ EOF
|
|
|
839
844
|
if [[ "$(resolve_tls_enabled)" == "1" ]]; then
|
|
840
845
|
printf ' - "%s:/app/localnet-tls/ca.crt:ro"\n' "${LOCALNET_TLS_CA_CERT_PATH}"
|
|
841
846
|
fi
|
|
842
|
-
cat <<
|
|
847
|
+
cat <<EOF
|
|
843
848
|
command:
|
|
844
849
|
- pipeline
|
|
845
850
|
- ledger
|
package/node/test-start-local.sh
CHANGED
|
@@ -6,6 +6,7 @@ SCRIPT_DIR="$REPO_ROOT/node"
|
|
|
6
6
|
REPO_ENV_FILE="$REPO_ROOT/.env"
|
|
7
7
|
|
|
8
8
|
tmpdir="$(mktemp -d)"
|
|
9
|
+
real_docker="$(command -v docker || true)"
|
|
9
10
|
root_env_backup="$tmpdir/root-env.backup"
|
|
10
11
|
root_env_exists=0
|
|
11
12
|
if [[ -f "$REPO_ENV_FILE" ]]; then
|
|
@@ -53,9 +54,36 @@ run_case() {
|
|
|
53
54
|
"$generated_dir"
|
|
54
55
|
ln -s "$quickstart_dir" "$quickstart_root_dir/quickstart"
|
|
55
56
|
printf '%s\n' "$makefile_targets" > "$quickstart_dir/Makefile"
|
|
56
|
-
printf '
|
|
57
|
+
printf '%s\n' \
|
|
58
|
+
'DOCKER_NETWORK=quickstart' \
|
|
59
|
+
'SPLICE_VERSION=0.6.5' \
|
|
60
|
+
'SCRIBE_IMAGE=scribe' \
|
|
61
|
+
'SCRIBE_VERSION=test' \
|
|
62
|
+
'POSTGRES_VERSION=16' \
|
|
63
|
+
'DB_USER=test' \
|
|
64
|
+
'DB_PASSWORD=test' \
|
|
65
|
+
> "$quickstart_dir/.env"
|
|
66
|
+
cat > "$quickstart_dir/compose.yaml" <<'EOF'
|
|
67
|
+
volumes:
|
|
68
|
+
onboarding:
|
|
69
|
+
|
|
70
|
+
services:
|
|
71
|
+
postgres:
|
|
72
|
+
image: postgres:16
|
|
73
|
+
canton:
|
|
74
|
+
image: canton:test
|
|
75
|
+
splice:
|
|
76
|
+
image: splice:test
|
|
77
|
+
splice-onboarding:
|
|
78
|
+
image: onboarding:test
|
|
79
|
+
pqs-app-provider:
|
|
80
|
+
image: pqs:test
|
|
81
|
+
pqs-app-user:
|
|
82
|
+
image: pqs:test
|
|
83
|
+
pqs-sv:
|
|
84
|
+
image: pqs:test
|
|
85
|
+
EOF
|
|
57
86
|
printf 'AUTH_MODE=%s\n' "$auth_mode" > "$quickstart_dir/.env.local"
|
|
58
|
-
: > "$quickstart_dir/compose.yaml"
|
|
59
87
|
: > "$quickstart_dir/docker/modules/localnet/compose.yaml"
|
|
60
88
|
: > "$quickstart_dir/docker/modules/localnet/compose.env"
|
|
61
89
|
: > "$quickstart_dir/docker/modules/localnet/env/common.env"
|
|
@@ -408,6 +436,30 @@ assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf"
|
|
|
408
436
|
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' validator-party-hint = "${EXTRA_VALIDATOR_1_PARTY_HINT}"'
|
|
409
437
|
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' domains.global.buy-extra-traffic {'
|
|
410
438
|
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" 'canton.sv-apps.sv.expected-validator-onboardings += { secret = "${EXTRA_VALIDATOR_3_ONBOARDING_SECRET}" }'
|
|
439
|
+
run_case $'.PHONY: start\nstart:\n' 'stub env AUTH_MODE=shared-secret' shared-secret default 2 '' '' 0 1
|
|
440
|
+
assert_file_contains_text "$tmpdir/generated/additional-config.extra-participants.conf" 'canton.participants.extra-1.ledger-api.tls {'
|
|
441
|
+
assert_file_contains_text "$tmpdir/generated/additional-config.extra-validators.conf" 'canton.validator-apps.extra-1-validator_backend.participant-client {'
|
|
442
|
+
compose_config="$tmpdir/extra-tls-compose.config"
|
|
443
|
+
if [[ -n "$real_docker" ]] && "$real_docker" compose version >/dev/null 2>&1; then
|
|
444
|
+
if ! "$real_docker" compose \
|
|
445
|
+
-f "$tmpdir/quickstart/compose.yaml" \
|
|
446
|
+
-f "$tmpdir/quickstart/docker/modules/localnet/compose.yaml" \
|
|
447
|
+
-f "$tmpdir/quickstart/docker/modules/splice-onboarding/compose.yaml" \
|
|
448
|
+
-f "$tmpdir/quickstart/docker/modules/pqs/compose.yaml" \
|
|
449
|
+
-f "$tmpdir/generated/compose-extra-participants.yaml" \
|
|
450
|
+
-f "$tmpdir/tls/compose-localnet.yaml" \
|
|
451
|
+
--env-file "$tmpdir/quickstart/.env" \
|
|
452
|
+
--env-file "$tmpdir/quickstart/.env.local" \
|
|
453
|
+
--env-file "$tmpdir/generated/extra-participants.env" \
|
|
454
|
+
config > "$compose_config" 2>&1; then
|
|
455
|
+
echo 'extra participants plus TLS did not produce valid merged Compose configuration' >&2
|
|
456
|
+
cat "$compose_config" >&2
|
|
457
|
+
exit 1
|
|
458
|
+
fi
|
|
459
|
+
else
|
|
460
|
+
assert_file_contains_text "$tmpdir/generated/compose-extra-participants.yaml" ' postgres-pqs-extra-1:'
|
|
461
|
+
assert_file_contains_text "$tmpdir/generated/compose-extra-participants.yaml" ' postgres-pqs-extra-1:'
|
|
462
|
+
fi
|
|
411
463
|
run_case $'.PHONY: start-local-ledger\nstart-local-ledger:\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"'/tls/compose-localnet.yaml down -v --remove-orphans' shared-secret default 0 '' '' 0 1
|
|
412
464
|
assert_file_contains_text "$tmpdir/tls/canton-tls.conf" 'canton.participants.app-provider.ledger-api.tls {'
|
|
413
465
|
assert_file_contains_text "$tmpdir/tls/canton-tls.conf" 'canton.participants.app-provider.admin-api.tls {'
|
|
@@ -434,6 +486,12 @@ if grep -Fq 'canton.validator-apps.app-user-validator_backend.participant-client
|
|
|
434
486
|
fi
|
|
435
487
|
assert_file_mode "$tmpdir/tls/server.key" 600
|
|
436
488
|
assert_file_mode "$tmpdir/tls/ca.key" 600
|
|
489
|
+
if ! openssl x509 -in "$tmpdir/tls/server.crt" -text -noout \
|
|
490
|
+
| grep -Fq 'IP Address:127.0.0.1, IP Address:0.0.0.0'; then
|
|
491
|
+
echo 'generated TLS certificate is missing the 0.0.0.0 subject alternative name' >&2
|
|
492
|
+
openssl x509 -in "$tmpdir/tls/server.crt" -text -noout >&2
|
|
493
|
+
exit 1
|
|
494
|
+
fi
|
|
437
495
|
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 -f '"$tmpdir"'/tls/compose-localnet.yaml down -v --remove-orphans' shared-secret default 2 '' '' 0 1
|
|
438
496
|
assert_file_contains_text "$tmpdir/generated/additional-config.extra-participants.conf" 'canton.participants.extra-1.ledger-api.tls {'
|
|
439
497
|
assert_file_contains_text "$tmpdir/generated/additional-config.extra-participants.conf" 'canton.participants.extra-2.admin-api.tls {'
|