@distrohelena/canton-typescript-sdk 0.1.5 → 0.1.7
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/README.md +333 -1
- package/dist/client/canton-client-options.d.ts +3 -0
- package/dist/client/canton-client-options.js +2 -0
- package/dist/client/service-registry.js +3 -2
- package/dist/core/errors/grpc-transport-error.d.ts +14 -0
- package/dist/core/errors/grpc-transport-error.js +76 -0
- package/dist/core/signing/command-signer.interface.d.ts +2 -0
- package/dist/core/transports/transport.interface.d.ts +2 -2
- package/dist/core/types/canton-hash-purpose.d.ts +2 -1
- package/dist/core/types/canton-hash-purpose.js +1 -0
- package/dist/core/types/daml-numeric.d.ts +6 -0
- package/dist/core/types/daml-numeric.js +14 -0
- package/dist/core/types/daml-party.d.ts +6 -0
- package/dist/core/types/daml-party.js +14 -0
- package/dist/core/types/disclosed-contract.d.ts +13 -0
- package/dist/core/types/disclosed-contract.js +15 -0
- package/dist/core/types/requests/create-decentralized-party-request.d.ts +41 -0
- package/dist/core/types/requests/create-decentralized-party-request.js +82 -0
- package/dist/core/types/requests/create-external-party-request.d.ts +42 -0
- package/dist/core/types/requests/create-external-party-request.js +47 -0
- package/dist/core/types/requests/finalize-decentralized-party-request.d.ts +39 -0
- package/dist/core/types/requests/finalize-decentralized-party-request.js +42 -0
- package/dist/core/types/requests/get-active-contracts-page-request.d.ts +15 -2
- package/dist/core/types/requests/get-active-contracts-page-request.js +4 -0
- package/dist/core/types/requests/submit-command-request.d.ts +5 -0
- package/dist/core/types/requests/submit-command-request.js +4 -0
- package/dist/core/types/topology/topology-signature-format.d.ts +2 -1
- package/dist/core/types/topology/topology-signature-format.js +1 -0
- package/dist/daml-lf/container/dar-archive-entry.d.ts +8 -0
- package/dist/daml-lf/container/dar-archive-entry.js +8 -0
- package/dist/daml-lf/container/dar-archive-loader.js +14 -0
- package/dist/daml-lf/container/dar-archive.d.ts +6 -0
- package/dist/daml-lf/container/dar-archive.js +4 -0
- package/dist/daml-lf/container/dar-source-bundle-loader.d.ts +5 -0
- package/dist/daml-lf/container/dar-source-bundle-loader.js +33 -0
- package/dist/daml-lf/container/dar-source-bundle.d.ts +45 -0
- package/dist/daml-lf/container/dar-source-bundle.js +11 -0
- package/dist/daml-lf/container/dar-source-file-entry.d.ts +8 -0
- package/dist/daml-lf/container/dar-source-file-entry.js +8 -0
- package/dist/daml-lf/daml-lf-compilation.d.ts +12 -0
- package/dist/daml-lf/daml-lf-compilation.js +35 -0
- package/dist/daml-lf/index.d.ts +11 -0
- package/dist/daml-lf/index.js +10 -0
- package/dist/daml-lf/interpreter/daml-lf-builtin-dispatch.d.ts +43 -0
- package/dist/daml-lf/interpreter/daml-lf-builtin-dispatch.js +933 -0
- package/dist/daml-lf/interpreter/daml-lf-evaluator.d.ts +95 -0
- package/dist/daml-lf/interpreter/daml-lf-evaluator.js +1131 -0
- package/dist/daml-lf/interpreter/daml-lf-interpreter-scaffold.d.ts +3 -0
- package/dist/daml-lf/interpreter/daml-lf-interpreter-scaffold.js +6 -1
- package/dist/daml-lf/interpreter/daml-lf-lexical-scope.d.ts +13 -0
- package/dist/daml-lf/interpreter/daml-lf-lexical-scope.js +46 -0
- package/dist/daml-lf/interpreter/daml-lf-runtime-frame.d.ts +16 -0
- package/dist/daml-lf/interpreter/daml-lf-runtime-frame.js +15 -0
- package/dist/daml-lf/interpreter/daml-lf-runtime-value.d.ts +21 -0
- package/dist/daml-lf/interpreter/daml-lf-runtime-value.js +4 -1
- package/dist/daml-lf/interpreter/daml-lf-step-kind.d.ts +7 -0
- package/dist/daml-lf/interpreter/daml-lf-step-kind.js +8 -0
- package/dist/daml-lf/interpreter/daml-lf-trace-sink.interface.d.ts +30 -0
- package/dist/daml-lf/interpreter/daml-lf-trace-sink.interface.js +1 -0
- package/dist/daml-lf/model/daml-lf-builtin-type.d.ts +3 -0
- package/dist/daml-lf/model/daml-lf-builtin-type.js +3 -0
- package/dist/daml-lf/model/daml-lf-choice.d.ts +5 -0
- package/dist/daml-lf/model/daml-lf-choice.js +4 -0
- package/dist/daml-lf/model/daml-lf-expression-path.d.ts +2 -0
- package/dist/daml-lf/model/daml-lf-expression-path.js +81 -0
- package/dist/daml-lf/model/daml-lf-expression.d.ts +146 -0
- package/dist/daml-lf/model/daml-lf-expression.js +71 -0
- package/dist/daml-lf/model/daml-lf-template.d.ts +2 -0
- package/dist/daml-lf/model/daml-lf-template.js +2 -0
- package/dist/daml-lf/model/daml-lf-type.d.ts +2 -0
- package/dist/daml-lf/model/daml-lf-type.js +4 -0
- package/dist/daml-lf/model/lf-2-model-mapper.d.ts +5 -0
- package/dist/daml-lf/model/lf-2-model-mapper.js +445 -12
- package/dist/debugger/errors/replay-determinism.exception.d.ts +3 -0
- package/dist/debugger/errors/replay-determinism.exception.js +3 -0
- package/dist/debugger/errors/replay-missing-package.exception.d.ts +3 -0
- package/dist/debugger/errors/replay-missing-package.exception.js +3 -0
- package/dist/debugger/errors/replay-missing-source.exception.d.ts +3 -0
- package/dist/debugger/errors/replay-missing-source.exception.js +3 -0
- package/dist/debugger/errors/replay-source-map.exception.d.ts +3 -0
- package/dist/debugger/errors/replay-source-map.exception.js +3 -0
- package/dist/debugger/errors/replay-state-hydration.exception.d.ts +3 -0
- package/dist/debugger/errors/replay-state-hydration.exception.js +3 -0
- package/dist/debugger/errors/replay-unsupported-lf-construct.exception.d.ts +3 -0
- package/dist/debugger/errors/replay-unsupported-lf-construct.exception.js +3 -0
- package/dist/debugger/errors/replay-unsupported-update.exception.d.ts +3 -0
- package/dist/debugger/errors/replay-unsupported-update.exception.js +3 -0
- package/dist/debugger/index.d.ts +31 -0
- package/dist/debugger/index.js +31 -0
- package/dist/debugger/ledger-replay-debugger-client.d.ts +31 -0
- package/dist/debugger/ledger-replay-debugger-client.js +53 -0
- package/dist/debugger/replay/ledger-replay-environment-builder.d.ts +95 -0
- package/dist/debugger/replay/ledger-replay-environment-builder.js +249 -0
- package/dist/debugger/replay/ledger-replay-session-loader.d.ts +78 -0
- package/dist/debugger/replay/ledger-replay-session-loader.js +565 -0
- package/dist/debugger/replay/replay-artifact-resolver.d.ts +30 -0
- package/dist/debugger/replay/replay-artifact-resolver.js +210 -0
- package/dist/debugger/replay/replay-determinism-validator.d.ts +12 -0
- package/dist/debugger/replay/replay-determinism-validator.js +161 -0
- package/dist/debugger/replay/replay-entrypoint-definition-resolver.d.ts +40 -0
- package/dist/debugger/replay/replay-entrypoint-definition-resolver.js +337 -0
- package/dist/debugger/replay/replay-entrypoint.d.ts +22 -0
- package/dist/debugger/replay/replay-entrypoint.js +14 -0
- package/dist/debugger/replay/replay-ledger-value-normalizer.d.ts +7 -0
- package/dist/debugger/replay/replay-ledger-value-normalizer.js +194 -0
- package/dist/debugger/replay/replay-update-loader.d.ts +24 -0
- package/dist/debugger/replay/replay-update-loader.js +94 -0
- package/dist/debugger/replay/replay-update-visibility-validator.d.ts +19 -0
- package/dist/debugger/replay/replay-update-visibility-validator.js +19 -0
- package/dist/debugger/session/in-memory-replay-session-store.d.ts +27 -0
- package/dist/debugger/session/in-memory-replay-session-store.js +109 -0
- package/dist/debugger/session/replay-phase.d.ts +7 -0
- package/dist/debugger/session/replay-phase.js +8 -0
- package/dist/debugger/session/replay-scope.d.ts +10 -0
- package/dist/debugger/session/replay-scope.js +10 -0
- package/dist/debugger/session/replay-session-metadata.d.ts +10 -0
- package/dist/debugger/session/replay-session-metadata.js +10 -0
- package/dist/debugger/session/replay-session-request.d.ts +6 -0
- package/dist/debugger/session/replay-session-request.js +10 -0
- package/dist/debugger/session/replay-session.d.ts +12 -0
- package/dist/debugger/session/replay-session.js +10 -0
- package/dist/debugger/session/replay-source-location.d.ts +17 -0
- package/dist/debugger/session/replay-source-location.js +16 -0
- package/dist/debugger/session/replay-stack-frame.d.ts +8 -0
- package/dist/debugger/session/replay-stack-frame.js +8 -0
- package/dist/debugger/session/replay-state-delta.d.ts +29 -0
- package/dist/debugger/session/replay-state-delta.js +24 -0
- package/dist/debugger/session/replay-step-advance-result.d.ts +24 -0
- package/dist/debugger/session/replay-step-advance-result.js +16 -0
- package/dist/debugger/session/replay-step.d.ts +30 -0
- package/dist/debugger/session/replay-step.js +24 -0
- package/dist/debugger/session/replay-value-preview.d.ts +8 -0
- package/dist/debugger/session/replay-value-preview.js +15 -0
- package/dist/debugger/source/daml-source-mapper.d.ts +12 -0
- package/dist/debugger/source/daml-source-mapper.js +21 -0
- package/dist/debugger/source/dar-source-map-metadata.d.ts +26 -0
- package/dist/debugger/source/dar-source-map-metadata.js +10 -0
- package/dist/debugger/source/source-coverage-validator.d.ts +8 -0
- package/dist/debugger/source/source-coverage-validator.js +16 -0
- package/dist/debugger/source/source-indexed-compilation.d.ts +45 -0
- package/dist/debugger/source/source-indexed-compilation.js +110 -0
- package/dist/debugger/source/source-mapping-precision.d.ts +5 -0
- package/dist/debugger/source/source-mapping-precision.js +4 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +13 -0
- package/dist/query/cache/memory-query-cache.d.ts +9 -0
- package/dist/query/cache/memory-query-cache.js +24 -0
- package/dist/query/cache/query-cache-store.d.ts +5 -0
- package/dist/query/cache/query-cache-store.js +1 -0
- package/dist/query/canton-manager-options.d.ts +17 -0
- package/dist/query/canton-manager-options.js +1 -0
- package/dist/query/canton-manager.d.ts +11 -0
- package/dist/query/canton-manager.js +42 -0
- package/dist/query/errors/pqs-query-error.d.ts +10 -0
- package/dist/query/errors/pqs-query-error.js +11 -0
- package/dist/query/errors/pqs-schema-profile-error.d.ts +3 -0
- package/dist/query/errors/pqs-schema-profile-error.js +3 -0
- package/dist/query/errors/query-capability-error.d.ts +7 -0
- package/dist/query/errors/query-capability-error.js +10 -0
- package/dist/query/grpc/grpc-contract-query-client.d.ts +32 -0
- package/dist/query/grpc/grpc-contract-query-client.js +126 -0
- package/dist/query/model-types.d.ts +258 -0
- package/dist/query/model-types.js +14 -0
- package/dist/query/pqs/pqs-pool.d.ts +13 -0
- package/dist/query/pqs/pqs-pool.js +18 -0
- package/dist/query/pqs/pqs-query-client.d.ts +49 -0
- package/dist/query/pqs/pqs-query-client.js +324 -0
- package/dist/query/pqs/pqs-schema-profile.d.ts +25 -0
- package/dist/query/pqs/pqs-schema-profile.js +120 -0
- package/dist/query/pqs/pqs-sql-compiler.d.ts +7 -0
- package/dist/query/pqs/pqs-sql-compiler.js +132 -0
- package/dist/query/pqs/read-only-sql.d.ts +1 -0
- package/dist/query/pqs/read-only-sql.js +35 -0
- package/dist/query/query-client.d.ts +61 -0
- package/dist/query/query-client.js +1 -0
- package/dist/query/query-source.d.ts +4 -0
- package/dist/query/query-source.js +5 -0
- package/dist/services/command/command-service-client.d.ts +2 -2
- package/dist/services/commands/command-submission-pipeline.d.ts +2 -2
- package/dist/services/party-management/decentralized-party-lifecycle.d.ts +6 -0
- package/dist/services/party-management/decentralized-party-lifecycle.js +82 -0
- package/dist/services/party-management/party-management-service-client.d.ts +16 -1
- package/dist/services/party-management/party-management-service-client.js +142 -1
- package/dist/services/topology-manager-write/topology-signed-transaction-assembler.js +4 -0
- package/dist/testing/campaign/campaign-artifact.d.ts +20 -0
- package/dist/testing/campaign/campaign-artifact.js +147 -0
- package/dist/testing/campaign/campaign-definition.d.ts +9 -0
- package/dist/testing/campaign/campaign-definition.js +78 -0
- package/dist/testing/campaign/campaign-metrics.d.ts +32 -0
- package/dist/testing/campaign/campaign-metrics.js +26 -0
- package/dist/testing/campaign/campaign-model.d.ts +11 -0
- package/dist/testing/campaign/campaign-model.js +21 -0
- package/dist/testing/campaign/campaign-runner.d.ts +99 -0
- package/dist/testing/campaign/campaign-runner.js +194 -0
- package/dist/testing/campaign/campaign-scheduler.d.ts +40 -0
- package/dist/testing/campaign/campaign-scheduler.js +75 -0
- package/dist/testing/campaign/campaign-types.d.ts +52 -0
- package/dist/testing/campaign/campaign-types.js +11 -0
- package/dist/testing/daml/daml-action-arbitrary.d.ts +13 -0
- package/dist/testing/daml/daml-action-arbitrary.js +24 -0
- package/dist/testing/daml/daml-choice-action-arbitrary.d.ts +18 -0
- package/dist/testing/daml/daml-choice-action-arbitrary.js +27 -0
- package/dist/testing/daml/daml-create-action-arbitrary.d.ts +19 -0
- package/dist/testing/daml/daml-create-action-arbitrary.js +34 -0
- package/dist/testing/daml/daml-testing-catalog.d.ts +38 -0
- package/dist/testing/daml/daml-testing-catalog.js +40 -0
- package/dist/testing/daml/daml-value-arbitrary.d.ts +8 -0
- package/dist/testing/daml/daml-value-arbitrary.js +43 -0
- package/dist/testing/daml/declarative-campaign-arbitrary.d.ts +15 -0
- package/dist/testing/daml/declarative-campaign-arbitrary.js +30 -0
- package/dist/testing/errors/invariant-campaign-failure.d.ts +24 -0
- package/dist/testing/errors/invariant-campaign-failure.js +37 -0
- package/dist/testing/errors/testing-configuration-error.d.ts +3 -0
- package/dist/testing/errors/testing-configuration-error.js +6 -0
- package/dist/testing/handlers/handler.d.ts +19 -0
- package/dist/testing/handlers/handler.js +31 -0
- package/dist/testing/index.d.ts +22 -0
- package/dist/testing/index.js +22 -0
- package/dist/testing/runtime/campaign-isolation.d.ts +14 -0
- package/dist/testing/runtime/campaign-isolation.js +23 -0
- package/dist/testing/runtime/canton-test-runtime.d.ts +58 -0
- package/dist/testing/runtime/canton-test-runtime.js +138 -0
- package/dist/testing/runtime/declarative-action-executor.d.ts +16 -0
- package/dist/testing/runtime/declarative-action-executor.js +41 -0
- package/dist/testing/targets/target.d.ts +49 -0
- package/dist/testing/targets/target.js +121 -0
- package/dist/transports/grpc/grpc-channel-factory.js +31 -1
- package/dist/transports/grpc/grpc-transport.d.ts +2 -2
- package/dist/transports/grpc/grpc-transport.js +11 -8
- package/dist/transports/grpc/mappers/commands-mapper.js +23 -2
- package/dist/transports/grpc/mappers/contracts-mapper.d.ts +3 -1
- package/dist/transports/grpc/mappers/contracts-mapper.js +16 -3
- package/dist/transports/grpc/mappers/interactive-command-mapper.d.ts +4 -1
- package/dist/transports/grpc/mappers/interactive-command-mapper.js +3 -8
- package/dist/transports/grpc/mappers/topology-manager-write-mapper.js +59 -1
- package/dist/transports/json/mappers/commands-mapper.js +20 -6
- package/node/.generated/start-local/additional-config.extra-participants.conf +37 -0
- package/node/.generated/start-local/additional-config.extra-validators.conf +35 -0
- package/node/.generated/start-local/compose-extra-participants.yaml +147 -0
- package/node/.generated/start-local/extra-participants.env +30 -0
- package/node/es256-jwt.mjs +177 -0
- package/node/start-local.sh +886 -0
- package/node/stop-local.sh +200 -0
- package/node/test-start-local.sh +354 -0
- package/node/test-stop-local.sh +112 -0
- package/package.json +21 -2
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
|
+
REPO_ROOT="$(cd -- "$SCRIPT_DIR/.." && pwd)"
|
|
6
|
+
DOCKER_COMPOSE_CMD=()
|
|
7
|
+
|
|
8
|
+
load_repo_root_env() {
|
|
9
|
+
local env_file="$REPO_ROOT/.env"
|
|
10
|
+
if [[ -f "$env_file" ]]; then
|
|
11
|
+
local existing_cn_quickstart_dir="${CN_QUICKSTART_DIR:-}"
|
|
12
|
+
set -a
|
|
13
|
+
# shellcheck disable=SC1090
|
|
14
|
+
source "$env_file"
|
|
15
|
+
set +a
|
|
16
|
+
if [[ -n "$existing_cn_quickstart_dir" ]]; then
|
|
17
|
+
CN_QUICKSTART_DIR="$existing_cn_quickstart_dir"
|
|
18
|
+
fi
|
|
19
|
+
fi
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
normalize_quickstart_dir_candidate() {
|
|
23
|
+
local candidate="$1"
|
|
24
|
+
|
|
25
|
+
if [[ -z "$candidate" ]]; then
|
|
26
|
+
return 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
if [[ -d "$candidate/quickstart" ]]; then
|
|
30
|
+
candidate="$candidate/quickstart"
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
if [[ -f "$candidate/compose.yaml" && -d "$candidate/docker/modules" ]]; then
|
|
34
|
+
cd -- "$candidate" && pwd
|
|
35
|
+
return 0
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
return 1
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
resolve_quickstart_dir() {
|
|
42
|
+
local candidate
|
|
43
|
+
for candidate in \
|
|
44
|
+
"${CN_QUICKSTART_DIR:-}" \
|
|
45
|
+
"$SCRIPT_DIR/../cn-quickstart/quickstart" \
|
|
46
|
+
"$SCRIPT_DIR/../../cn-quickstart/quickstart"
|
|
47
|
+
do
|
|
48
|
+
if normalize_quickstart_dir_candidate "$candidate"; then
|
|
49
|
+
return 0
|
|
50
|
+
fi
|
|
51
|
+
done
|
|
52
|
+
|
|
53
|
+
echo "Unable to locate CN Quickstart. Set CN_QUICKSTART_DIR in $REPO_ROOT/.env or place the checkout in a supported location." >&2
|
|
54
|
+
return 1
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
make_target_exists() {
|
|
58
|
+
local target="$1"
|
|
59
|
+
make -qp 2>/dev/null | grep -Eq "^${target}:"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
read_env_value() {
|
|
63
|
+
local key="$1"
|
|
64
|
+
local file
|
|
65
|
+
for file in .env.local .env; do
|
|
66
|
+
if [[ -f "$file" ]]; then
|
|
67
|
+
local line
|
|
68
|
+
line="$(grep -E "^${key}=" "$file" | tail -n 1 || true)"
|
|
69
|
+
if [[ -n "$line" ]]; then
|
|
70
|
+
printf '%s\n' "${line#*=}"
|
|
71
|
+
return 0
|
|
72
|
+
fi
|
|
73
|
+
fi
|
|
74
|
+
done
|
|
75
|
+
return 1
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
generated_dir() {
|
|
79
|
+
printf '%s\n' "${START_LOCAL_GENERATED_DIR:-$SCRIPT_DIR/.generated/start-local}"
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
resolve_es256_enabled() {
|
|
83
|
+
local value="${LOCALNET_ES256_JWT:-0}"
|
|
84
|
+
if [[ "$value" != "0" && "$value" != "1" ]]; then
|
|
85
|
+
echo "LOCALNET_ES256_JWT must be 0 or 1." >&2
|
|
86
|
+
return 1
|
|
87
|
+
fi
|
|
88
|
+
printf '%s\n' "$value"
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
es256_runtime_dir() {
|
|
92
|
+
printf '%s\n' "${START_LOCAL_ES256_RUNTIME_DIR:-$REPO_ROOT/.generated/localnet-es256}"
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
append_es256_args() {
|
|
96
|
+
local -n compose_args_ref="$1"
|
|
97
|
+
if [[ "$(resolve_es256_enabled)" == "1" ]]; then
|
|
98
|
+
local compose_file="$(es256_runtime_dir)/compose-es256-jwks.yaml"
|
|
99
|
+
if [[ -f "$compose_file" ]]; then
|
|
100
|
+
compose_args_ref+=( -f "$compose_file" )
|
|
101
|
+
fi
|
|
102
|
+
fi
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
resolve_docker_compose_cmd() {
|
|
106
|
+
if (( ${#DOCKER_COMPOSE_CMD[@]} > 0 )); then
|
|
107
|
+
return 0
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
if docker compose version >/dev/null 2>&1; then
|
|
111
|
+
DOCKER_COMPOSE_CMD=(docker compose)
|
|
112
|
+
return 0
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
if docker-compose version >/dev/null 2>&1; then
|
|
116
|
+
DOCKER_COMPOSE_CMD=(docker-compose)
|
|
117
|
+
return 0
|
|
118
|
+
fi
|
|
119
|
+
|
|
120
|
+
echo "Unable to find a working Docker Compose command. Install 'docker compose' or 'docker-compose'." >&2
|
|
121
|
+
return 1
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
docker_compose() {
|
|
125
|
+
resolve_docker_compose_cmd
|
|
126
|
+
"${DOCKER_COMPOSE_CMD[@]}" "$@"
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
append_existing_extra_participant_args() {
|
|
130
|
+
local -n compose_args_ref="$1"
|
|
131
|
+
local output_dir
|
|
132
|
+
output_dir="$(generated_dir)"
|
|
133
|
+
|
|
134
|
+
if [[ -f "$output_dir/compose-extra-participants.yaml" && -f "$output_dir/extra-participants.env" ]]; then
|
|
135
|
+
compose_args_ref+=(
|
|
136
|
+
-f "$output_dir/compose-extra-participants.yaml"
|
|
137
|
+
--env-file "$output_dir/extra-participants.env"
|
|
138
|
+
)
|
|
139
|
+
fi
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
stop_ledger_stack() {
|
|
143
|
+
local auth_mode="${1:-shared-secret}"
|
|
144
|
+
local modules_dir="$QUICKSTART_DIR/docker/modules"
|
|
145
|
+
local localnet_dir="$modules_dir/localnet"
|
|
146
|
+
local splice_version
|
|
147
|
+
splice_version="$(read_env_value SPLICE_VERSION || true)"
|
|
148
|
+
export MODULES_DIR="$modules_dir"
|
|
149
|
+
export LOCALNET_DIR="$localnet_dir"
|
|
150
|
+
export LOCALNET_ENV_DIR="$localnet_dir/env"
|
|
151
|
+
export IMAGE_TAG="${IMAGE_TAG:-$splice_version}"
|
|
152
|
+
export APP_PROVIDER_PROFILE=on
|
|
153
|
+
export APP_USER_PROFILE=off
|
|
154
|
+
export SV_PROFILE=on
|
|
155
|
+
export PQS_SV_PROFILE=on
|
|
156
|
+
local compose_args=(
|
|
157
|
+
-f compose.yaml
|
|
158
|
+
-f "$localnet_dir/compose.yaml"
|
|
159
|
+
-f "$modules_dir/splice-onboarding/compose.yaml"
|
|
160
|
+
-f "$modules_dir/pqs/compose.yaml"
|
|
161
|
+
--env-file .env
|
|
162
|
+
--env-file .env.local
|
|
163
|
+
--env-file "$localnet_dir/compose.env"
|
|
164
|
+
--env-file "$localnet_dir/env/common.env"
|
|
165
|
+
--env-file "$modules_dir/pqs/compose.env"
|
|
166
|
+
--profile app-provider
|
|
167
|
+
--profile pqs-app-provider
|
|
168
|
+
--profile pqs-sv
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
if [[ "$auth_mode" == "oauth2" ]]; then
|
|
172
|
+
compose_args+=(
|
|
173
|
+
-f "$modules_dir/keycloak/compose.yaml"
|
|
174
|
+
--env-file "$modules_dir/keycloak/compose.env"
|
|
175
|
+
--profile keycloak
|
|
176
|
+
)
|
|
177
|
+
fi
|
|
178
|
+
|
|
179
|
+
append_existing_extra_participant_args compose_args
|
|
180
|
+
append_es256_args compose_args
|
|
181
|
+
docker_compose "${compose_args[@]}" down -v --remove-orphans
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
load_repo_root_env
|
|
185
|
+
QUICKSTART_DIR="$(resolve_quickstart_dir)"
|
|
186
|
+
cd "$QUICKSTART_DIR"
|
|
187
|
+
|
|
188
|
+
if [[ ! -f .env.local ]]; then
|
|
189
|
+
echo ".env.local not found. Nothing to stop."
|
|
190
|
+
exit 0
|
|
191
|
+
fi
|
|
192
|
+
|
|
193
|
+
if [[ "$(resolve_es256_enabled)" != "1" ]] && make_target_exists stop-local-ledger; then
|
|
194
|
+
make stop-local-ledger
|
|
195
|
+
else
|
|
196
|
+
auth_mode="$(read_env_value AUTH_MODE || true)"
|
|
197
|
+
auth_mode="${auth_mode:-shared-secret}"
|
|
198
|
+
echo "stop-local-ledger target not found. Stopping ledger-only compose stack directly."
|
|
199
|
+
stop_ledger_stack "$auth_mode"
|
|
200
|
+
fi
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
SCRIPT_DIR="$REPO_ROOT/node"
|
|
6
|
+
REPO_ENV_FILE="$REPO_ROOT/.env"
|
|
7
|
+
|
|
8
|
+
tmpdir="$(mktemp -d)"
|
|
9
|
+
root_env_backup="$tmpdir/root-env.backup"
|
|
10
|
+
root_env_exists=0
|
|
11
|
+
if [[ -f "$REPO_ENV_FILE" ]]; then
|
|
12
|
+
cp "$REPO_ENV_FILE" "$root_env_backup"
|
|
13
|
+
root_env_exists=1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
cleanup() {
|
|
17
|
+
if (( root_env_exists )); then
|
|
18
|
+
cp "$root_env_backup" "$REPO_ENV_FILE"
|
|
19
|
+
else
|
|
20
|
+
rm -f "$REPO_ENV_FILE"
|
|
21
|
+
fi
|
|
22
|
+
rm -rf "$tmpdir"
|
|
23
|
+
}
|
|
24
|
+
trap cleanup EXIT
|
|
25
|
+
|
|
26
|
+
run_case() {
|
|
27
|
+
local makefile_targets="$1"
|
|
28
|
+
local expected_output="$2"
|
|
29
|
+
local auth_mode="${3:-shared-secret}"
|
|
30
|
+
local docker_mode="${4:-default}"
|
|
31
|
+
local extra_participants="${5:-}"
|
|
32
|
+
local cn_quickstart_dir_override="${6:-}"
|
|
33
|
+
local repo_root_env_contents="${7:-}"
|
|
34
|
+
local es256_enabled="${8:-0}"
|
|
35
|
+
local quickstart_dir="$tmpdir/quickstart"
|
|
36
|
+
local quickstart_root_dir="$tmpdir/cn-quickstart"
|
|
37
|
+
local stubbin="$tmpdir/bin"
|
|
38
|
+
local generated_dir="$tmpdir/generated"
|
|
39
|
+
|
|
40
|
+
rm -rf "$quickstart_dir" "$quickstart_root_dir" "$stubbin" "$generated_dir"
|
|
41
|
+
mkdir -p \
|
|
42
|
+
"$quickstart_root_dir" \
|
|
43
|
+
"$quickstart_dir/docker/modules/localnet/env" \
|
|
44
|
+
"$quickstart_dir/docker/modules/pqs" \
|
|
45
|
+
"$quickstart_dir/docker/modules/splice-onboarding" \
|
|
46
|
+
"$quickstart_dir/docker/modules/keycloak" \
|
|
47
|
+
"$stubbin" \
|
|
48
|
+
"$generated_dir"
|
|
49
|
+
ln -s "$quickstart_dir" "$quickstart_root_dir/quickstart"
|
|
50
|
+
printf '%s\n' "$makefile_targets" > "$quickstart_dir/Makefile"
|
|
51
|
+
printf 'DOCKER_NETWORK=quickstart\nSPLICE_VERSION=0.6.5\n' > "$quickstart_dir/.env"
|
|
52
|
+
printf 'AUTH_MODE=%s\n' "$auth_mode" > "$quickstart_dir/.env.local"
|
|
53
|
+
: > "$quickstart_dir/compose.yaml"
|
|
54
|
+
: > "$quickstart_dir/docker/modules/localnet/compose.yaml"
|
|
55
|
+
: > "$quickstart_dir/docker/modules/localnet/compose.env"
|
|
56
|
+
: > "$quickstart_dir/docker/modules/localnet/env/common.env"
|
|
57
|
+
: > "$quickstart_dir/docker/modules/pqs/compose.yaml"
|
|
58
|
+
: > "$quickstart_dir/docker/modules/pqs/compose.env"
|
|
59
|
+
: > "$quickstart_dir/docker/modules/splice-onboarding/compose.yaml"
|
|
60
|
+
: > "$quickstart_dir/docker/modules/keycloak/compose.yaml"
|
|
61
|
+
: > "$quickstart_dir/docker/modules/keycloak/compose.env"
|
|
62
|
+
|
|
63
|
+
cat > "$stubbin/make" <<'EOF'
|
|
64
|
+
#!/usr/bin/env bash
|
|
65
|
+
set -euo pipefail
|
|
66
|
+
|
|
67
|
+
if [[ "${1:-}" == "-qp" ]]; then
|
|
68
|
+
cat Makefile
|
|
69
|
+
exit 0
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
printf 'stub make %s\n' "$*"
|
|
73
|
+
EOF
|
|
74
|
+
chmod +x "$stubbin/make"
|
|
75
|
+
|
|
76
|
+
cat > "$stubbin/docker" <<'EOF'
|
|
77
|
+
#!/usr/bin/env bash
|
|
78
|
+
set -euo pipefail
|
|
79
|
+
docker_mode="__DOCKER_MODE__"
|
|
80
|
+
printf 'stub env MODULES_DIR=%s\n' "${MODULES_DIR:-}"
|
|
81
|
+
printf 'stub env LOCALNET_DIR=%s\n' "${LOCALNET_DIR:-}"
|
|
82
|
+
printf 'stub env IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
83
|
+
printf 'stub env APP_PROVIDER_PROFILE=%s\n' "${APP_PROVIDER_PROFILE:-}"
|
|
84
|
+
printf 'stub env APP_USER_PROFILE=%s\n' "${APP_USER_PROFILE:-}"
|
|
85
|
+
printf 'stub env SV_PROFILE=%s\n' "${SV_PROFILE:-}"
|
|
86
|
+
printf 'stub env PQS_SV_PROFILE=%s\n' "${PQS_SV_PROFILE:-}"
|
|
87
|
+
if [[ "${1:-}" == "inspect" ]]; then
|
|
88
|
+
printf 'healthy\n'
|
|
89
|
+
exit 0
|
|
90
|
+
fi
|
|
91
|
+
if [[ "${1:-}" == "exec" ]]; then
|
|
92
|
+
extra_pqs_config_file=""
|
|
93
|
+
while (( "$#" )); do
|
|
94
|
+
if [[ "${1:-}" == "-e" && "${2:-}" == EXTRA_PQS_CONFIG_FILE=* ]]; then
|
|
95
|
+
extra_pqs_config_file="${2#EXTRA_PQS_CONFIG_FILE=}"
|
|
96
|
+
break
|
|
97
|
+
fi
|
|
98
|
+
shift
|
|
99
|
+
done
|
|
100
|
+
if [[ -n "$extra_pqs_config_file" && -n "${START_LOCAL_GENERATED_DIR:-}" ]]; then
|
|
101
|
+
cat > "${START_LOCAL_GENERATED_DIR}/${extra_pqs_config_file}" <<'CONFIG'
|
|
102
|
+
pipeline.datasource=TransactionTreeStream
|
|
103
|
+
pipeline.ledger.start=Oldest
|
|
104
|
+
pipeline.oauth.accessToken="stub-token"
|
|
105
|
+
CONFIG
|
|
106
|
+
fi
|
|
107
|
+
exit 0
|
|
108
|
+
fi
|
|
109
|
+
if [[ "${1:-}" == "compose" && "${2:-}" == "version" ]]; then
|
|
110
|
+
if [[ "$docker_mode" == "compose-v1" ]]; then
|
|
111
|
+
exit 1
|
|
112
|
+
fi
|
|
113
|
+
exit 0
|
|
114
|
+
fi
|
|
115
|
+
printf 'stub docker %s\n' "$*"
|
|
116
|
+
if [[ "$docker_mode" == "staged-start" ]]; then
|
|
117
|
+
if [[ "${1:-}" == "compose" && "$*" == *" down -v --remove-orphans"* ]]; then
|
|
118
|
+
exit 0
|
|
119
|
+
fi
|
|
120
|
+
if [[ "${1:-}" == "compose" && "$*" == *" up -d --no-recreate postgres canton"* ]]; then
|
|
121
|
+
exit 0
|
|
122
|
+
fi
|
|
123
|
+
if [[ "$*" == *" up -d --no-recreate splice splice-onboarding pqs-app-provider pqs-sv"* ]]; then
|
|
124
|
+
exit 0
|
|
125
|
+
fi
|
|
126
|
+
exit 1
|
|
127
|
+
fi
|
|
128
|
+
EOF
|
|
129
|
+
sed -i "s|__DOCKER_MODE__|$docker_mode|" "$stubbin/docker"
|
|
130
|
+
chmod +x "$stubbin/docker"
|
|
131
|
+
|
|
132
|
+
cat > "$stubbin/docker-compose" <<'EOF'
|
|
133
|
+
#!/usr/bin/env bash
|
|
134
|
+
set -euo pipefail
|
|
135
|
+
docker_mode="__DOCKER_MODE__"
|
|
136
|
+
if [[ "${1:-}" == "version" ]]; then
|
|
137
|
+
if [[ "$docker_mode" == "compose-v1" ]]; then
|
|
138
|
+
exit 0
|
|
139
|
+
fi
|
|
140
|
+
exit 1
|
|
141
|
+
fi
|
|
142
|
+
printf 'stub docker-compose %s\n' "$*"
|
|
143
|
+
EOF
|
|
144
|
+
sed -i "s|__DOCKER_MODE__|$docker_mode|" "$stubbin/docker-compose"
|
|
145
|
+
chmod +x "$stubbin/docker-compose"
|
|
146
|
+
|
|
147
|
+
local output
|
|
148
|
+
output="$(
|
|
149
|
+
if [[ -n "$repo_root_env_contents" ]]; then
|
|
150
|
+
printf '%s\n' "$repo_root_env_contents" > "$REPO_ENV_FILE"
|
|
151
|
+
else
|
|
152
|
+
rm -f "$REPO_ENV_FILE"
|
|
153
|
+
fi
|
|
154
|
+
cd "$SCRIPT_DIR"
|
|
155
|
+
if [[ "$cn_quickstart_dir_override" == "__unset__" ]]; then
|
|
156
|
+
env -i \
|
|
157
|
+
HOME="$HOME" \
|
|
158
|
+
TERM="${TERM:-dumb}" \
|
|
159
|
+
START_LOCAL_GENERATED_DIR="$generated_dir" \
|
|
160
|
+
START_LOCAL_ES256_RUNTIME_DIR="$tmpdir/es256" \
|
|
161
|
+
LOCALNET_ES256_JWT="$es256_enabled" \
|
|
162
|
+
EXTRA_PARTICIPANTS="$extra_participants" \
|
|
163
|
+
PATH="$stubbin:$PATH" \
|
|
164
|
+
bash ./start-local.sh
|
|
165
|
+
else
|
|
166
|
+
CN_QUICKSTART_DIR="${cn_quickstart_dir_override:-$quickstart_dir}" \
|
|
167
|
+
START_LOCAL_GENERATED_DIR="$generated_dir" \
|
|
168
|
+
START_LOCAL_ES256_RUNTIME_DIR="$tmpdir/es256" \
|
|
169
|
+
LOCALNET_ES256_JWT="$es256_enabled" \
|
|
170
|
+
EXTRA_PARTICIPANTS="$extra_participants" \
|
|
171
|
+
PATH="$stubbin:$PATH" \
|
|
172
|
+
bash ./start-local.sh
|
|
173
|
+
fi
|
|
174
|
+
)"
|
|
175
|
+
|
|
176
|
+
if ! grep -Fxq "$expected_output" <<<"$output"; then
|
|
177
|
+
printf 'expected output line %q, got:\n%s\n' "$expected_output" "$output" >&2
|
|
178
|
+
exit 1
|
|
179
|
+
fi
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
assert_file_contains() {
|
|
183
|
+
local path="$1"
|
|
184
|
+
local expected="$2"
|
|
185
|
+
|
|
186
|
+
if ! grep -Fqx "$expected" "$path"; then
|
|
187
|
+
printf 'expected file %s to contain line %q, got:\n' "$path" "$expected" >&2
|
|
188
|
+
cat "$path" >&2
|
|
189
|
+
exit 1
|
|
190
|
+
fi
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
run_repo_root_env_case() {
|
|
194
|
+
local quickstart_dir="$tmpdir/quickstart"
|
|
195
|
+
local quickstart_root_dir="$tmpdir/custom-quickstart-root"
|
|
196
|
+
local stubbin="$tmpdir/bin"
|
|
197
|
+
local generated_dir="$tmpdir/generated"
|
|
198
|
+
local isolated_repo_root="$tmpdir/isolated-repo"
|
|
199
|
+
local isolated_script_dir="$isolated_repo_root/node"
|
|
200
|
+
local output
|
|
201
|
+
|
|
202
|
+
rm -rf "$quickstart_dir" "$quickstart_root_dir" "$tmpdir/cn-quickstart" "$stubbin" "$generated_dir" "$isolated_repo_root"
|
|
203
|
+
mkdir -p \
|
|
204
|
+
"$quickstart_root_dir" \
|
|
205
|
+
"$quickstart_dir/docker/modules/localnet/env" \
|
|
206
|
+
"$quickstart_dir/docker/modules/pqs" \
|
|
207
|
+
"$quickstart_dir/docker/modules/splice-onboarding" \
|
|
208
|
+
"$quickstart_dir/docker/modules/keycloak" \
|
|
209
|
+
"$stubbin" \
|
|
210
|
+
"$generated_dir" \
|
|
211
|
+
"$isolated_script_dir"
|
|
212
|
+
ln -s "$quickstart_dir" "$quickstart_root_dir/quickstart"
|
|
213
|
+
|
|
214
|
+
printf '.PHONY: start\nstart:\n' > "$quickstart_dir/Makefile"
|
|
215
|
+
printf 'DOCKER_NETWORK=quickstart\nSPLICE_VERSION=0.6.5\n' > "$quickstart_dir/.env"
|
|
216
|
+
printf 'AUTH_MODE=shared-secret\n' > "$quickstart_dir/.env.local"
|
|
217
|
+
: > "$quickstart_dir/compose.yaml"
|
|
218
|
+
: > "$quickstart_dir/docker/modules/localnet/compose.yaml"
|
|
219
|
+
: > "$quickstart_dir/docker/modules/localnet/compose.env"
|
|
220
|
+
: > "$quickstart_dir/docker/modules/localnet/env/common.env"
|
|
221
|
+
: > "$quickstart_dir/docker/modules/pqs/compose.yaml"
|
|
222
|
+
: > "$quickstart_dir/docker/modules/pqs/compose.env"
|
|
223
|
+
: > "$quickstart_dir/docker/modules/splice-onboarding/compose.yaml"
|
|
224
|
+
: > "$quickstart_dir/docker/modules/keycloak/compose.yaml"
|
|
225
|
+
: > "$quickstart_dir/docker/modules/keycloak/compose.env"
|
|
226
|
+
|
|
227
|
+
cat > "$stubbin/make" <<'EOF'
|
|
228
|
+
#!/usr/bin/env bash
|
|
229
|
+
set -euo pipefail
|
|
230
|
+
|
|
231
|
+
if [[ "${1:-}" == "-qp" ]]; then
|
|
232
|
+
cat Makefile
|
|
233
|
+
exit 0
|
|
234
|
+
fi
|
|
235
|
+
|
|
236
|
+
printf 'stub make %s\n' "$*"
|
|
237
|
+
EOF
|
|
238
|
+
chmod +x "$stubbin/make"
|
|
239
|
+
|
|
240
|
+
cat > "$stubbin/docker" <<'EOF'
|
|
241
|
+
#!/usr/bin/env bash
|
|
242
|
+
set -euo pipefail
|
|
243
|
+
printf 'stub env MODULES_DIR=%s\n' "${MODULES_DIR:-}"
|
|
244
|
+
printf 'stub env LOCALNET_DIR=%s\n' "${LOCALNET_DIR:-}"
|
|
245
|
+
printf 'stub env IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
246
|
+
printf 'stub env APP_PROVIDER_PROFILE=%s\n' "${APP_PROVIDER_PROFILE:-}"
|
|
247
|
+
printf 'stub env APP_USER_PROFILE=%s\n' "${APP_USER_PROFILE:-}"
|
|
248
|
+
printf 'stub env SV_PROFILE=%s\n' "${SV_PROFILE:-}"
|
|
249
|
+
printf 'stub env PQS_SV_PROFILE=%s\n' "${PQS_SV_PROFILE:-}"
|
|
250
|
+
if [[ "${1:-}" == "inspect" ]]; then
|
|
251
|
+
printf 'healthy\n'
|
|
252
|
+
exit 0
|
|
253
|
+
fi
|
|
254
|
+
if [[ "${1:-}" == "exec" ]]; then
|
|
255
|
+
exit 0
|
|
256
|
+
fi
|
|
257
|
+
printf 'stub docker %s\n' "$*"
|
|
258
|
+
EOF
|
|
259
|
+
chmod +x "$stubbin/docker"
|
|
260
|
+
|
|
261
|
+
cp "$SCRIPT_DIR/start-local.sh" "$isolated_script_dir/start-local.sh"
|
|
262
|
+
chmod +x "$isolated_script_dir/start-local.sh"
|
|
263
|
+
printf 'CN_QUICKSTART_DIR=%s\n' "$quickstart_root_dir" > "$isolated_repo_root/.env"
|
|
264
|
+
|
|
265
|
+
output="$(
|
|
266
|
+
cd "$isolated_script_dir"
|
|
267
|
+
env -i \
|
|
268
|
+
HOME="$HOME" \
|
|
269
|
+
TERM="${TERM:-dumb}" \
|
|
270
|
+
START_LOCAL_GENERATED_DIR="$generated_dir" \
|
|
271
|
+
PATH="$stubbin:$PATH" \
|
|
272
|
+
bash ./start-local.sh
|
|
273
|
+
)"
|
|
274
|
+
|
|
275
|
+
if ! grep -Fxq "stub env MODULES_DIR=$quickstart_root_dir/quickstart/docker/modules" <<<"$output"; then
|
|
276
|
+
printf 'expected repo root .env quickstart path to resolve, got:\n%s\n' "$output" >&2
|
|
277
|
+
exit 1
|
|
278
|
+
fi
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
run_case $'.PHONY: start-local-ledger\nstart-local-ledger:\n' 'stub make start-local-ledger'
|
|
282
|
+
run_case $'.PHONY: start\nstart:\n' 'stub env MODULES_DIR='"$tmpdir"'/quickstart/docker/modules'
|
|
283
|
+
run_case $'.PHONY: start\nstart:\n' 'stub env IMAGE_TAG=0.6.5'
|
|
284
|
+
run_case $'.PHONY: start\nstart:\n' 'stub env APP_USER_PROFILE=off'
|
|
285
|
+
run_case $'.PHONY: start\nstart:\n' 'stub env SV_PROFILE=on'
|
|
286
|
+
run_case $'.PHONY: start\nstart:\n' 'stub env PQS_SV_PROFILE=on'
|
|
287
|
+
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 down -v --remove-orphans'
|
|
288
|
+
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 up -d --no-recreate postgres canton'
|
|
289
|
+
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"'/quickstart/docker/modules/keycloak/compose.yaml --env-file '"$tmpdir"'/quickstart/docker/modules/keycloak/compose.env --profile keycloak down -v --remove-orphans' oauth2
|
|
290
|
+
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"'/quickstart/docker/modules/keycloak/compose.yaml --env-file '"$tmpdir"'/quickstart/docker/modules/keycloak/compose.env --profile keycloak up -d --no-recreate keycloak nginx-keycloak postgres canton' oauth2
|
|
291
|
+
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 up -d --no-recreate splice splice-onboarding pqs-app-provider pqs-sv' shared-secret staged-start
|
|
292
|
+
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 down -v --remove-orphans' shared-secret compose-v1
|
|
293
|
+
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
|
|
294
|
+
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
|
|
295
|
+
run_case $'.PHONY: start\nstart:\n' 'ES256 bearer token written to '"$tmpdir"'/es256/ledger-api-user.token' shared-secret default 3 '' '' 1
|
|
296
|
+
assert_file_contains "$tmpdir/es256/canton-es256.conf" 'canton.participants.app-provider.ledger-api.auth-services = ['
|
|
297
|
+
assert_file_contains "$tmpdir/es256/canton-es256.conf" ' type = jwt-es-256-crt'
|
|
298
|
+
assert_file_contains "$tmpdir/es256/canton-es256.conf" ' certificate = "/app/es256-certificate.pem"'
|
|
299
|
+
if grep -Fq 'canton.participants.app-user.ledger-api.auth-services' "$tmpdir/es256/canton-es256.conf"; then
|
|
300
|
+
echo "unexpected ES256 configuration for inactive app-user participant" >&2
|
|
301
|
+
exit 1
|
|
302
|
+
fi
|
|
303
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-participants.conf" 'canton.participants.extra-3.ledger-api.auth-services = ['
|
|
304
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'CREATE_DATABASE_EXTRA_1=participant-extra-1'
|
|
305
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'CREATE_DATABASE_EXTRA_VALIDATOR_1=validator-extra-1'
|
|
306
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_PARTICIPANT_1_ADMIN_API_PORT=5902'
|
|
307
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_PARTICIPANT_3_JSON_API_PORT=7975'
|
|
308
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR_1_PARTY_HINT=validator_1_quickstart-localparty-1'
|
|
309
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR_1_ONBOARDING_SECRET=extra-1-validator-onboarding-secret'
|
|
310
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR_1_ADMIN_API_PORT=5903'
|
|
311
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR_3_ADMIN_API_PUBLISHED_PORT=7903'
|
|
312
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR_1_USER_NAME=ledger-api-user'
|
|
313
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR_1_WALLET_ADMIN_USER_NAME=extra-1'
|
|
314
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_VALIDATOR_1_AUTH_AUDIENCE=https://canton.network.global'
|
|
315
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'CREATE_DATABASE_EXTRA_PQS_1=pqs-extra-1'
|
|
316
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_PQS_1_POSTGRES_PUBLISHED_PORT=5541'
|
|
317
|
+
assert_file_contains "$tmpdir/generated/extra-participants.env" 'EXTRA_PQS_3_POSTGRES_PUBLISHED_PORT=5543'
|
|
318
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' ADDITIONAL_CONFIG_EXTRA_PARTICIPANTS: |'
|
|
319
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' canton.participants.extra-1 = $${_participant} {'
|
|
320
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' splice:'
|
|
321
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' ADDITIONAL_CONFIG_EXTRA_VALIDATORS: |'
|
|
322
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' canton.validator-apps.extra-1-validator_backend = $${_validator_backend} {'
|
|
323
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' - "${EXTRA_VALIDATOR_1_ADMIN_API_PUBLISHED_PORT}:${EXTRA_VALIDATOR_1_ADMIN_API_PORT}"'
|
|
324
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' init {'
|
|
325
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' generate-topology-transactions-and-keys = true'
|
|
326
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' identity.type = auto'
|
|
327
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' postgres-pqs-extra-1:'
|
|
328
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' container_name: postgres-pqs-extra-1'
|
|
329
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' - "${EXTRA_PQS_1_POSTGRES_PUBLISHED_PORT}:5432"'
|
|
330
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' pqs-extra-1:'
|
|
331
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' container_name: pqs-extra-1'
|
|
332
|
+
assert_file_contains "$tmpdir/generated/compose-extra-participants.yaml" ' SCRIBE_CONFIG: /onboarding/extra-1-pqs.conf'
|
|
333
|
+
assert_file_contains "$tmpdir/generated/extra-1-pqs.conf" 'pipeline.datasource=TransactionTreeStream'
|
|
334
|
+
assert_file_contains "$tmpdir/generated/extra-1-pqs.conf" 'pipeline.ledger.start=Oldest'
|
|
335
|
+
assert_file_contains "$tmpdir/generated/extra-1-pqs.conf" 'pipeline.oauth.accessToken="stub-token"'
|
|
336
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-participants.conf" 'canton.participants.extra-1 = $${_participant} {'
|
|
337
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-participants.conf" ' storage.config.properties.databaseName = "participant-extra-3"'
|
|
338
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-participants.conf" ' init {'
|
|
339
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-participants.conf" ' generate-topology-transactions-and-keys = true'
|
|
340
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-participants.conf" ' identity.type = auto'
|
|
341
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-participants.conf" ' type = unsafe-jwt-hmac-256'
|
|
342
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-participants.conf" ' user-management-service.additional-admin-user-id = "${EXTRA_VALIDATOR_1_USER_NAME}"'
|
|
343
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" 'canton.validator-apps.extra-1-validator_backend = $${_validator_backend} {'
|
|
344
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' onboarding.secret = "${EXTRA_VALIDATOR_1_ONBOARDING_SECRET}"'
|
|
345
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' domain-migration-dump-path = "/domain-upgrade-dump/domain_migration_dump-extra-1.json"'
|
|
346
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' storage.config.properties.databaseName = "${EXTRA_VALIDATOR_1_DB}"'
|
|
347
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' canton-identifier-config.participant = extra-1'
|
|
348
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' type = "self-signed"'
|
|
349
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' ledger-api-user = "${EXTRA_VALIDATOR_1_USER_NAME}"'
|
|
350
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' validator-wallet-users.0 = "${EXTRA_VALIDATOR_1_WALLET_ADMIN_USER_NAME}"'
|
|
351
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' validator-party-hint = "${EXTRA_VALIDATOR_1_PARTY_HINT}"'
|
|
352
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" ' domains.global.buy-extra-traffic {'
|
|
353
|
+
assert_file_contains "$tmpdir/generated/additional-config.extra-validators.conf" 'canton.sv-apps.sv.expected-validator-onboardings += { secret = "${EXTRA_VALIDATOR_3_ONBOARDING_SECRET}" }'
|
|
354
|
+
run_repo_root_env_case
|