@distrohelena/canton-typescript-sdk 0.1.19 → 0.1.20
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 +81 -0
- package/node/test-start-local.sh +11 -0
- package/package.json +1 -1
package/node/start-local.sh
CHANGED
|
@@ -244,6 +244,62 @@ services:
|
|
|
244
244
|
- "$server_certificate_path:/app/localnet-tls/server.crt:ro"
|
|
245
245
|
- "$server_key_path:/app/localnet-tls/server.key:ro"
|
|
246
246
|
- "$ca_certificate_path:/app/localnet-tls/ca.crt:ro"
|
|
247
|
+
splice:
|
|
248
|
+
volumes:
|
|
249
|
+
- "$ca_certificate_path:/app/localnet-tls/ca.crt:ro"
|
|
250
|
+
environment:
|
|
251
|
+
- |
|
|
252
|
+
ADDITIONAL_CONFIG_LOCALNET_TLS=
|
|
253
|
+
EOF
|
|
254
|
+
for participant in app-provider app-user sv; do
|
|
255
|
+
case "$participant" in
|
|
256
|
+
app-provider) profile="$APP_PROVIDER_PROFILE" ;;
|
|
257
|
+
app-user) profile="$APP_USER_PROFILE" ;;
|
|
258
|
+
sv) profile="$SV_PROFILE" ;;
|
|
259
|
+
esac
|
|
260
|
+
if [[ "$profile" == "off" ]]; then
|
|
261
|
+
continue
|
|
262
|
+
fi
|
|
263
|
+
if [[ "$participant" == "sv" ]]; then
|
|
264
|
+
cat >> "$compose_file" <<'EOF'
|
|
265
|
+
canton.validator-apps.sv-validator_backend.participant-client {
|
|
266
|
+
admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
267
|
+
ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
268
|
+
}
|
|
269
|
+
canton.scan-apps.scan-app.participant-client {
|
|
270
|
+
admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
271
|
+
ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
272
|
+
}
|
|
273
|
+
canton.sv-apps.sv.participant-client {
|
|
274
|
+
admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
275
|
+
ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
276
|
+
}
|
|
277
|
+
EOF
|
|
278
|
+
else
|
|
279
|
+
cat >> "$compose_file" <<EOF
|
|
280
|
+
canton.validator-apps.${participant}-validator_backend.participant-client {
|
|
281
|
+
admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
282
|
+
ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
283
|
+
}
|
|
284
|
+
EOF
|
|
285
|
+
fi
|
|
286
|
+
done
|
|
287
|
+
cat >> "$compose_file" <<EOF
|
|
288
|
+
pqs-app-provider:
|
|
289
|
+
environment:
|
|
290
|
+
SCRIBE_SOURCE_LEDGER_TLS_CAFILE: /app/localnet-tls/ca.crt
|
|
291
|
+
volumes:
|
|
292
|
+
- "$ca_certificate_path:/app/localnet-tls/ca.crt:ro"
|
|
293
|
+
pqs-app-user:
|
|
294
|
+
environment:
|
|
295
|
+
SCRIBE_SOURCE_LEDGER_TLS_CAFILE: /app/localnet-tls/ca.crt
|
|
296
|
+
volumes:
|
|
297
|
+
- "$ca_certificate_path:/app/localnet-tls/ca.crt:ro"
|
|
298
|
+
pqs-sv:
|
|
299
|
+
environment:
|
|
300
|
+
SCRIBE_SOURCE_LEDGER_TLS_CAFILE: /app/localnet-tls/ca.crt
|
|
301
|
+
volumes:
|
|
302
|
+
- "$ca_certificate_path:/app/localnet-tls/ca.crt:ro"
|
|
247
303
|
EOF
|
|
248
304
|
export LOCALNET_TLS_COMPOSE_FILE="$compose_file"
|
|
249
305
|
export LOCALNET_TLS_FRAGMENT_FILE="$tls_fragment_file"
|
|
@@ -642,6 +698,19 @@ EOF
|
|
|
642
698
|
done
|
|
643
699
|
} > "$splice_config_file"
|
|
644
700
|
|
|
701
|
+
if [[ "$(resolve_tls_enabled)" == "1" ]]; then
|
|
702
|
+
local index
|
|
703
|
+
for ((index = 1; index <= count; index++)); do
|
|
704
|
+
cat >> "$splice_config_file" <<EOF
|
|
705
|
+
canton.validator-apps.extra-${index}-validator_backend.participant-client {
|
|
706
|
+
admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
707
|
+
ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
EOF
|
|
711
|
+
done
|
|
712
|
+
fi
|
|
713
|
+
|
|
645
714
|
{
|
|
646
715
|
cat <<'EOF'
|
|
647
716
|
volumes:
|
|
@@ -731,8 +800,20 @@ EOF
|
|
|
731
800
|
SCRIBE_TARGET_POSTGRES_USERNAME: \${DB_USER}
|
|
732
801
|
SCRIBE_TARGET_POSTGRES_PASSWORD: \${DB_PASSWORD}
|
|
733
802
|
SCRIBE_CONFIG: /onboarding/extra-${index}-pqs.conf
|
|
803
|
+
EOF
|
|
804
|
+
if [[ "$(resolve_tls_enabled)" == "1" ]]; then
|
|
805
|
+
cat <<'EOF'
|
|
806
|
+
SCRIBE_SOURCE_LEDGER_TLS_CAFILE: /app/localnet-tls/ca.crt
|
|
807
|
+
EOF
|
|
808
|
+
fi
|
|
809
|
+
cat <<EOF
|
|
734
810
|
volumes:
|
|
735
811
|
- onboarding:/onboarding
|
|
812
|
+
EOF
|
|
813
|
+
if [[ "$(resolve_tls_enabled)" == "1" ]]; then
|
|
814
|
+
printf ' - "%s:/app/localnet-tls/ca.crt:ro"\n' "${LOCALNET_TLS_CA_CERT_PATH}"
|
|
815
|
+
fi
|
|
816
|
+
cat <<'EOF'
|
|
736
817
|
command:
|
|
737
818
|
- pipeline
|
|
738
819
|
- ledger
|
package/node/test-start-local.sh
CHANGED
|
@@ -412,11 +412,22 @@ if grep -Fq 'canton.participants.app-user.ledger-api.tls {' "$tmpdir/tls/canton-
|
|
|
412
412
|
fi
|
|
413
413
|
assert_file_contains_text "$tmpdir/tls/compose-localnet.yaml" '/app/localnet-tls/server.key:ro'
|
|
414
414
|
assert_file_contains_text "$tmpdir/tls/compose-localnet.yaml" '/app/localnet-tls/ca.crt:ro'
|
|
415
|
+
assert_file_contains_text "$tmpdir/tls/compose-localnet.yaml" 'ADDITIONAL_CONFIG_LOCALNET_TLS='
|
|
416
|
+
assert_file_contains_text "$tmpdir/tls/compose-localnet.yaml" 'admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"'
|
|
417
|
+
assert_file_contains_text "$tmpdir/tls/compose-localnet.yaml" 'ledger-api.client-config.tls.trust-collection-file = "/app/localnet-tls/ca.crt"'
|
|
418
|
+
assert_file_contains_text "$tmpdir/tls/compose-localnet.yaml" 'SCRIBE_SOURCE_LEDGER_TLS_CAFILE: /app/localnet-tls/ca.crt'
|
|
419
|
+
if grep -Fq 'canton.validator-apps.app-user-validator_backend.participant-client' "$tmpdir/tls/compose-localnet.yaml"; then
|
|
420
|
+
echo "unexpected client TLS configuration for inactive app-user participant" >&2
|
|
421
|
+
exit 1
|
|
422
|
+
fi
|
|
415
423
|
assert_file_mode "$tmpdir/tls/server.key" 600
|
|
416
424
|
assert_file_mode "$tmpdir/tls/ca.key" 600
|
|
417
425
|
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
|
|
418
426
|
assert_file_contains_text "$tmpdir/generated/additional-config.extra-participants.conf" 'canton.participants.extra-1.ledger-api.tls {'
|
|
419
427
|
assert_file_contains_text "$tmpdir/generated/additional-config.extra-participants.conf" 'canton.participants.extra-2.admin-api.tls {'
|
|
428
|
+
assert_file_contains_text "$tmpdir/generated/additional-config.extra-validators.conf" 'canton.validator-apps.extra-1-validator_backend.participant-client {'
|
|
429
|
+
assert_file_contains_text "$tmpdir/generated/additional-config.extra-validators.conf" 'admin-api.tls.trust-collection-file = "/app/localnet-tls/ca.crt"'
|
|
430
|
+
assert_file_contains_text "$tmpdir/generated/compose-extra-participants.yaml" 'SCRIBE_SOURCE_LEDGER_TLS_CAFILE: /app/localnet-tls/ca.crt'
|
|
420
431
|
|
|
421
432
|
mkdir -p "$tmpdir/supplied"
|
|
422
433
|
openssl genrsa -out "$tmpdir/supplied/ca.key" 2048 >/dev/null 2>&1
|