@distrohelena/canton-typescript-sdk 0.1.37 → 0.1.39
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 +39 -0
- package/dist/cjs/query/canonical/query-normalizer.js +4 -2
- package/dist/cjs/query/grpc/grpc-query-client.js +25 -3
- package/dist/query/canonical/query-normalizer.js +4 -2
- package/dist/query/grpc/grpc-query-client.js +25 -3
- package/dist/query/model-types.d.ts +2 -0
- package/dist/query/query-client.d.ts +1 -0
- package/node/start-local-splice-0.6.12.sh +6 -0
- package/node/start-local-splice-0.6.13.sh +6 -0
- package/node/start-local-splice-0.6.14.sh +6 -0
- package/node/start-local-splice-0.7.0.sh +6 -0
- package/node/stop-local-splice-0.6.12.sh +6 -0
- package/node/stop-local-splice-0.6.13.sh +6 -0
- package/node/stop-local-splice-0.6.14.sh +6 -0
- package/node/stop-local-splice-0.7.0.sh +6 -0
- package/node/test-start-local-splice-0.6.12.sh +28 -0
- package/node/test-start-local-splice-0.6.13.sh +28 -0
- package/node/test-start-local-splice-0.6.14.sh +28 -0
- package/node/test-start-local-splice-0.7.0.sh +28 -0
- package/node/test-stop-local-splice-0.6.12.sh +28 -0
- package/node/test-stop-local-splice-0.6.13.sh +28 -0
- package/node/test-stop-local-splice-0.6.14.sh +28 -0
- package/node/test-stop-local-splice-0.7.0.sh +28 -0
- package/package.json +26 -2
package/README.md
CHANGED
|
@@ -369,6 +369,45 @@ localnet and is never part of the normal test suite:
|
|
|
369
369
|
PARTICIPANT_358_SMOKE_TEST=1 npm run test:participant-358-sidecar-smoke
|
|
370
370
|
```
|
|
371
371
|
|
|
372
|
+
### Optional Splice image overrides
|
|
373
|
+
|
|
374
|
+
`canton-localnet-start` normally launches the Canton and Splice images pinned
|
|
375
|
+
by the CN Quickstart checkout's own `.env` (`SPLICE_VERSION`). To exercise the
|
|
376
|
+
SDK against a different Splice release instead, without editing that
|
|
377
|
+
checkout, use one of:
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
canton-localnet-splice-0.7.0-start
|
|
381
|
+
canton-localnet-splice-0.7.0-stop
|
|
382
|
+
|
|
383
|
+
canton-localnet-splice-0.6.14-start
|
|
384
|
+
canton-localnet-splice-0.6.14-stop
|
|
385
|
+
|
|
386
|
+
canton-localnet-splice-0.6.13-start
|
|
387
|
+
canton-localnet-splice-0.6.13-stop
|
|
388
|
+
|
|
389
|
+
canton-localnet-splice-0.6.12-start
|
|
390
|
+
canton-localnet-splice-0.6.12-stop
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
These are thin wrappers around the normal launchers that default `IMAGE_TAG`
|
|
394
|
+
to `0.7.0`, `0.6.14`, `0.6.13`, or `0.6.12` respectively before delegating to
|
|
395
|
+
them; every other launcher option (extra participants, ES256, TLS,
|
|
396
|
+
`AUTH_MODE`) still applies. Set `IMAGE_TAG` yourself beforehand to target a
|
|
397
|
+
different version through the same wrappers.
|
|
398
|
+
|
|
399
|
+
`npm run test:live` (with `EXTRA_PARTICIPANTS=4`) has been run against each of
|
|
400
|
+
`0.7.0`, `0.6.14`, `0.6.13`, and `0.6.12` and passes on all four. Two
|
|
401
|
+
intermittent failures were observed and are environment-timing issues
|
|
402
|
+
unrelated to the Splice version under test: a PQS/scribe first-boot ingestion
|
|
403
|
+
race (`live-query-parity`, self-resolves on retry) and a dedicated
|
|
404
|
+
participant needing the domain's ACS reconciliation interval to elapse before
|
|
405
|
+
a safe pruning point exists (`live-query-pruning`). Separately, Splice 0.7.0
|
|
406
|
+
ships a Canton participant reporting Ledger API version `3.5.11`, which the
|
|
407
|
+
workflow examples' compatibility guard (`examples/shared/workflow-compatibility.ts`)
|
|
408
|
+
does not yet accept (it allows only `3.5.7`/`3.5.8`); those examples fail
|
|
409
|
+
against the `0.7.0` launcher until that guard is updated.
|
|
410
|
+
|
|
372
411
|
### Optional ES256 bearer tokens
|
|
373
412
|
|
|
374
413
|
Set `LOCALNET_ES256_JWT=1` when starting the localnet to add ES256 JWT
|
|
@@ -28,6 +28,8 @@ function normalizeFindMany(relation, args = {}) {
|
|
|
28
28
|
const source = object(args, "findMany args");
|
|
29
29
|
assertKnown(source, ["parties", "where", "select", "include", "orderBy", "skip", "take"], relation);
|
|
30
30
|
const page = normalizePage(source);
|
|
31
|
+
// A top-level take of 0 means "no limit", matching skip: 0's existing "no offset" meaning.
|
|
32
|
+
const take = page.take === 0 ? undefined : page.take;
|
|
31
33
|
const predicate = source.where === undefined ? undefined : normalizePredicate(relation, source.where);
|
|
32
34
|
return {
|
|
33
35
|
kind: "findMany",
|
|
@@ -36,9 +38,9 @@ function normalizeFindMany(relation, args = {}) {
|
|
|
36
38
|
predicate,
|
|
37
39
|
select: source.select === undefined ? undefined : normalizeSelection(relation, source.select),
|
|
38
40
|
includes: source.include === undefined ? [] : normalizeIncludes(relation, source.include),
|
|
39
|
-
orderBy: normalizeOrderBy(relation, source.orderBy, relation === "contracts" || source.orderBy !== undefined || page.skip > 0 ||
|
|
41
|
+
orderBy: normalizeOrderBy(relation, source.orderBy, relation === "contracts" || source.orderBy !== undefined || page.skip > 0 || take !== undefined),
|
|
40
42
|
skip: page.skip,
|
|
41
|
-
take
|
|
43
|
+
take,
|
|
42
44
|
activeOnly: relation === "contracts" && provesActive(predicate),
|
|
43
45
|
};
|
|
44
46
|
});
|
|
@@ -80,6 +80,10 @@ class DefaultGrpcQueryDataProvider {
|
|
|
80
80
|
return cachedContractsDataset(cached.contracts, cached.activeAtOffset, this.options.endpointScope ?? "ledger");
|
|
81
81
|
}
|
|
82
82
|
else if (needsHistory) {
|
|
83
|
+
console.warn(`[GrpcQueryClient] Falling back to a full ledger replay from offset 0 for a "${query.relation}" query. `
|
|
84
|
+
+ "This is expensive and should be an extreme edge case. It is usually triggered by a \"contracts\" query "
|
|
85
|
+
+ "that does not explicitly prove `active: true` (so archived contracts may be in scope), or by querying "
|
|
86
|
+
+ "\"transactions\"/\"events\"/\"exercises\" directly. Add an explicit active:true filter if only current state is needed.");
|
|
83
87
|
const endInclusive = cached?.activeAtOffset ?? (await this.options.stateService.getLedgerEndAsync({})).offset;
|
|
84
88
|
const history = await this.snapshots.readHistoryAsync(endInclusive);
|
|
85
89
|
const transactions = history.updates.flatMap((response) => response.update.oneofKind === "transaction" ? [response.update.transaction] : []);
|
|
@@ -95,7 +99,13 @@ class DefaultGrpcQueryDataProvider {
|
|
|
95
99
|
}
|
|
96
100
|
const endInclusive = cached?.activeAtOffset ?? (await this.options.stateService.getLedgerEndAsync({})).offset;
|
|
97
101
|
if (query.relation === "packages" || query.relation === "contractTypes" || query.relation === "exerciseTypes") {
|
|
98
|
-
|
|
102
|
+
// A proven-active where/include on "contracts" (see predicateRequiresHistory/includesRequireHistory)
|
|
103
|
+
// can put "contracts" in the closure here without needsHistory being true, so the ACS still has to
|
|
104
|
+
// be read — otherwise that where/include would silently resolve against an empty row set.
|
|
105
|
+
const contractsFragment = closure.has("contracts")
|
|
106
|
+
? (0, grpc_relation_mapper_js_1.mapGrpcQueryRelationFragment)([], (await this.snapshots.readActiveContractsAsync(endInclusive, partiesFor(query))).activeContracts)
|
|
107
|
+
: (0, grpc_relation_mapper_js_1.mapGrpcQueryRelationFragment)([]);
|
|
108
|
+
return (0, grpc_relation_mapper_js_1.createGrpcQueryDataset)(contractsFragment, await this.packages.readAllAsync(), endInclusive, this.options.endpointScope ?? "ledger");
|
|
99
109
|
}
|
|
100
110
|
else if (query.relation === "watermark") {
|
|
101
111
|
return (0, grpc_relation_mapper_js_1.createGrpcQueryDataset)((0, grpc_relation_mapper_js_1.mapGrpcQueryRelationFragment)([]), [], endInclusive, this.options.endpointScope ?? "ledger");
|
|
@@ -160,10 +170,22 @@ function predicateRequiresHistory(relation, predicate) {
|
|
|
160
170
|
return false;
|
|
161
171
|
}
|
|
162
172
|
const target = query_schema_js_1.queryRelationEdges[relation]?.[predicate.edge]?.target;
|
|
163
|
-
|
|
173
|
+
if (target === "contracts") {
|
|
174
|
+
// "every"/"none" must see archived rows too (an archived row can silently violate "every",
|
|
175
|
+
// or an unseen one could exist for "none"); only "some"/"one" ask "does an active row match?",
|
|
176
|
+
// which the active contract set alone already answers completely.
|
|
177
|
+
const provenActiveOnly = (predicate.quantifier === "some" || predicate.quantifier === "one") && predicateProvesActive(predicate.predicate);
|
|
178
|
+
return !provenActiveOnly;
|
|
179
|
+
}
|
|
180
|
+
return target === "transactions" || target === "events" || target === "exercises" || target !== undefined && predicateRequiresHistory(target, predicate.predicate);
|
|
164
181
|
}
|
|
165
182
|
function includesRequireHistory(relation, includes) {
|
|
166
|
-
return includes.some((include) =>
|
|
183
|
+
return includes.some((include) => {
|
|
184
|
+
if (include.relation === "contracts") {
|
|
185
|
+
return !predicateProvesActive(include.predicate);
|
|
186
|
+
}
|
|
187
|
+
return include.relation === "transactions" || include.relation === "events" || include.relation === "exercises" || predicateRequiresHistory(include.relation, include.predicate) || includesRequireHistory(include.relation, include.includes);
|
|
188
|
+
});
|
|
167
189
|
}
|
|
168
190
|
function relationClosure(query) {
|
|
169
191
|
const relations = new Set([query.relation]);
|
|
@@ -19,6 +19,8 @@ export function normalizeFindMany(relation, args = {}) {
|
|
|
19
19
|
const source = object(args, "findMany args");
|
|
20
20
|
assertKnown(source, ["parties", "where", "select", "include", "orderBy", "skip", "take"], relation);
|
|
21
21
|
const page = normalizePage(source);
|
|
22
|
+
// A top-level take of 0 means "no limit", matching skip: 0's existing "no offset" meaning.
|
|
23
|
+
const take = page.take === 0 ? undefined : page.take;
|
|
22
24
|
const predicate = source.where === undefined ? undefined : normalizePredicate(relation, source.where);
|
|
23
25
|
return {
|
|
24
26
|
kind: "findMany",
|
|
@@ -27,9 +29,9 @@ export function normalizeFindMany(relation, args = {}) {
|
|
|
27
29
|
predicate,
|
|
28
30
|
select: source.select === undefined ? undefined : normalizeSelection(relation, source.select),
|
|
29
31
|
includes: source.include === undefined ? [] : normalizeIncludes(relation, source.include),
|
|
30
|
-
orderBy: normalizeOrderBy(relation, source.orderBy, relation === "contracts" || source.orderBy !== undefined || page.skip > 0 ||
|
|
32
|
+
orderBy: normalizeOrderBy(relation, source.orderBy, relation === "contracts" || source.orderBy !== undefined || page.skip > 0 || take !== undefined),
|
|
31
33
|
skip: page.skip,
|
|
32
|
-
take
|
|
34
|
+
take,
|
|
33
35
|
activeOnly: relation === "contracts" && provesActive(predicate),
|
|
34
36
|
};
|
|
35
37
|
});
|
|
@@ -76,6 +76,10 @@ class DefaultGrpcQueryDataProvider {
|
|
|
76
76
|
return cachedContractsDataset(cached.contracts, cached.activeAtOffset, this.options.endpointScope ?? "ledger");
|
|
77
77
|
}
|
|
78
78
|
else if (needsHistory) {
|
|
79
|
+
console.warn(`[GrpcQueryClient] Falling back to a full ledger replay from offset 0 for a "${query.relation}" query. `
|
|
80
|
+
+ "This is expensive and should be an extreme edge case. It is usually triggered by a \"contracts\" query "
|
|
81
|
+
+ "that does not explicitly prove `active: true` (so archived contracts may be in scope), or by querying "
|
|
82
|
+
+ "\"transactions\"/\"events\"/\"exercises\" directly. Add an explicit active:true filter if only current state is needed.");
|
|
79
83
|
const endInclusive = cached?.activeAtOffset ?? (await this.options.stateService.getLedgerEndAsync({})).offset;
|
|
80
84
|
const history = await this.snapshots.readHistoryAsync(endInclusive);
|
|
81
85
|
const transactions = history.updates.flatMap((response) => response.update.oneofKind === "transaction" ? [response.update.transaction] : []);
|
|
@@ -91,7 +95,13 @@ class DefaultGrpcQueryDataProvider {
|
|
|
91
95
|
}
|
|
92
96
|
const endInclusive = cached?.activeAtOffset ?? (await this.options.stateService.getLedgerEndAsync({})).offset;
|
|
93
97
|
if (query.relation === "packages" || query.relation === "contractTypes" || query.relation === "exerciseTypes") {
|
|
94
|
-
|
|
98
|
+
// A proven-active where/include on "contracts" (see predicateRequiresHistory/includesRequireHistory)
|
|
99
|
+
// can put "contracts" in the closure here without needsHistory being true, so the ACS still has to
|
|
100
|
+
// be read — otherwise that where/include would silently resolve against an empty row set.
|
|
101
|
+
const contractsFragment = closure.has("contracts")
|
|
102
|
+
? mapGrpcQueryRelationFragment([], (await this.snapshots.readActiveContractsAsync(endInclusive, partiesFor(query))).activeContracts)
|
|
103
|
+
: mapGrpcQueryRelationFragment([]);
|
|
104
|
+
return createGrpcQueryDataset(contractsFragment, await this.packages.readAllAsync(), endInclusive, this.options.endpointScope ?? "ledger");
|
|
95
105
|
}
|
|
96
106
|
else if (query.relation === "watermark") {
|
|
97
107
|
return createGrpcQueryDataset(mapGrpcQueryRelationFragment([]), [], endInclusive, this.options.endpointScope ?? "ledger");
|
|
@@ -156,10 +166,22 @@ function predicateRequiresHistory(relation, predicate) {
|
|
|
156
166
|
return false;
|
|
157
167
|
}
|
|
158
168
|
const target = queryRelationEdges[relation]?.[predicate.edge]?.target;
|
|
159
|
-
|
|
169
|
+
if (target === "contracts") {
|
|
170
|
+
// "every"/"none" must see archived rows too (an archived row can silently violate "every",
|
|
171
|
+
// or an unseen one could exist for "none"); only "some"/"one" ask "does an active row match?",
|
|
172
|
+
// which the active contract set alone already answers completely.
|
|
173
|
+
const provenActiveOnly = (predicate.quantifier === "some" || predicate.quantifier === "one") && predicateProvesActive(predicate.predicate);
|
|
174
|
+
return !provenActiveOnly;
|
|
175
|
+
}
|
|
176
|
+
return target === "transactions" || target === "events" || target === "exercises" || target !== undefined && predicateRequiresHistory(target, predicate.predicate);
|
|
160
177
|
}
|
|
161
178
|
function includesRequireHistory(relation, includes) {
|
|
162
|
-
return includes.some((include) =>
|
|
179
|
+
return includes.some((include) => {
|
|
180
|
+
if (include.relation === "contracts") {
|
|
181
|
+
return !predicateProvesActive(include.predicate);
|
|
182
|
+
}
|
|
183
|
+
return include.relation === "transactions" || include.relation === "events" || include.relation === "exercises" || predicateRequiresHistory(include.relation, include.predicate) || includesRequireHistory(include.relation, include.includes);
|
|
184
|
+
});
|
|
163
185
|
}
|
|
164
186
|
function relationClosure(query) {
|
|
165
187
|
const relations = new Set([query.relation]);
|
|
@@ -91,6 +91,7 @@ export type ToOneRelationArgs<TWhere, TSelect, TOrderBy, TInclude> = true | {
|
|
|
91
91
|
readonly include?: TInclude;
|
|
92
92
|
};
|
|
93
93
|
export interface ToManyRelationArgs<TWhere, TSelect, TOrderBy, TInclude> extends QueryPageArgs {
|
|
94
|
+
/** Required to bound to-many includes; unlike top-level `findMany`, `take: 0` here still means zero rows. */
|
|
94
95
|
readonly take: number;
|
|
95
96
|
readonly where?: TWhere;
|
|
96
97
|
readonly select?: TSelect;
|
|
@@ -228,6 +229,7 @@ export type ContractOrderBy = readonly [
|
|
|
228
229
|
...readonly OneFieldOrderBy<Pick<ContractRow, ContractOrderField>>[]
|
|
229
230
|
];
|
|
230
231
|
export type ContractSelect = RowSelect<ContractRow>;
|
|
232
|
+
/** `take: 0` returns all matching rows (no limit), matching `skip: 0`'s "no offset" meaning. */
|
|
231
233
|
export interface ContractFindManyArgs extends QueryPageArgs {
|
|
232
234
|
readonly parties?: readonly string[];
|
|
233
235
|
readonly where?: ContractWhere;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QuerySource } from "./query-source.js";
|
|
2
2
|
import { ContractTypeOrderBy, ContractTypeResult, ContractTypeSelect, ContractTypeUnique, ContractTypeWhere, ContractTypeGroupByArgs, ContractTypeGroupRow, ContractCountArgs, ContractFindManyArgs, ContractFindUniqueArgs, ContractGroupByArgs, ContractGroupRow, ContractResult, EventOrderBy, EventResult, EventGroupByArgs, EventGroupRow, EventSelect, EventUnique, EventWhere, ExerciseOrderBy, ExerciseResult, ExerciseSelect, ExerciseTypeOrderBy, ExerciseTypeResult, ExerciseTypeSelect, ExerciseTypeUnique, ExerciseTypeWhere, ExerciseTypeGroupByArgs, ExerciseTypeGroupRow, ExerciseWhere, ExerciseGroupByArgs, ExerciseGroupRow, PackageOrderBy, PackageResult, PackageSelect, PackageUnique, PackageWhere, PackageGroupByArgs, PackageGroupRow, TransactionOrderBy, TransactionResult, TransactionSelect, TransactionUnique, TransactionWhere, TransactionGroupByArgs, TransactionGroupRow, WatermarkOrderBy, WatermarkRow, WatermarkSelect, WatermarkUnique, WatermarkWhere, WatermarkGroupByArgs, WatermarkGroupRow, ContractTypeInclude, EventInclude, ExerciseInclude, ExerciseTypeInclude, PackageInclude, TransactionInclude, JsonProjectionResult } from "./model-types.js";
|
|
3
|
+
/** `take: 0` returns all matching rows (no limit), matching `skip: 0`'s "no offset" meaning. */
|
|
3
4
|
export interface FindManyArgs<TWhere, TSelect, TOrderBy, TInclude = never> {
|
|
4
5
|
readonly where?: TWhere;
|
|
5
6
|
readonly select?: TSelect;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
START_SCRIPT="$REPO_ROOT/node/start-local-splice-0.6.12.sh"
|
|
6
|
+
|
|
7
|
+
[[ -x "$START_SCRIPT" ]]
|
|
8
|
+
|
|
9
|
+
tmpdir="$(mktemp -d)"
|
|
10
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
11
|
+
|
|
12
|
+
stub="$tmpdir/stub-start-local.sh"
|
|
13
|
+
cat > "$stub" <<'EOF'
|
|
14
|
+
#!/usr/bin/env bash
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
printf 'IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
17
|
+
printf 'args=%s\n' "$*"
|
|
18
|
+
EOF
|
|
19
|
+
chmod +x "$stub"
|
|
20
|
+
|
|
21
|
+
default_output="$(START_LOCAL_SCRIPT="$stub" "$START_SCRIPT" one two)"
|
|
22
|
+
grep -Fqx 'IMAGE_TAG=0.6.12' <<<"$default_output"
|
|
23
|
+
grep -Fqx 'args=one two' <<<"$default_output"
|
|
24
|
+
|
|
25
|
+
override_output="$(IMAGE_TAG=custom-tag START_LOCAL_SCRIPT="$stub" "$START_SCRIPT")"
|
|
26
|
+
grep -Fqx 'IMAGE_TAG=custom-tag' <<<"$override_output"
|
|
27
|
+
|
|
28
|
+
echo "test-start-local-splice-0.6.12.sh: all cases passed"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
START_SCRIPT="$REPO_ROOT/node/start-local-splice-0.6.13.sh"
|
|
6
|
+
|
|
7
|
+
[[ -x "$START_SCRIPT" ]]
|
|
8
|
+
|
|
9
|
+
tmpdir="$(mktemp -d)"
|
|
10
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
11
|
+
|
|
12
|
+
stub="$tmpdir/stub-start-local.sh"
|
|
13
|
+
cat > "$stub" <<'EOF'
|
|
14
|
+
#!/usr/bin/env bash
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
printf 'IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
17
|
+
printf 'args=%s\n' "$*"
|
|
18
|
+
EOF
|
|
19
|
+
chmod +x "$stub"
|
|
20
|
+
|
|
21
|
+
default_output="$(START_LOCAL_SCRIPT="$stub" "$START_SCRIPT" one two)"
|
|
22
|
+
grep -Fqx 'IMAGE_TAG=0.6.13' <<<"$default_output"
|
|
23
|
+
grep -Fqx 'args=one two' <<<"$default_output"
|
|
24
|
+
|
|
25
|
+
override_output="$(IMAGE_TAG=custom-tag START_LOCAL_SCRIPT="$stub" "$START_SCRIPT")"
|
|
26
|
+
grep -Fqx 'IMAGE_TAG=custom-tag' <<<"$override_output"
|
|
27
|
+
|
|
28
|
+
echo "test-start-local-splice-0.6.13.sh: all cases passed"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
START_SCRIPT="$REPO_ROOT/node/start-local-splice-0.6.14.sh"
|
|
6
|
+
|
|
7
|
+
[[ -x "$START_SCRIPT" ]]
|
|
8
|
+
|
|
9
|
+
tmpdir="$(mktemp -d)"
|
|
10
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
11
|
+
|
|
12
|
+
stub="$tmpdir/stub-start-local.sh"
|
|
13
|
+
cat > "$stub" <<'EOF'
|
|
14
|
+
#!/usr/bin/env bash
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
printf 'IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
17
|
+
printf 'args=%s\n' "$*"
|
|
18
|
+
EOF
|
|
19
|
+
chmod +x "$stub"
|
|
20
|
+
|
|
21
|
+
default_output="$(START_LOCAL_SCRIPT="$stub" "$START_SCRIPT" one two)"
|
|
22
|
+
grep -Fqx 'IMAGE_TAG=0.6.14' <<<"$default_output"
|
|
23
|
+
grep -Fqx 'args=one two' <<<"$default_output"
|
|
24
|
+
|
|
25
|
+
override_output="$(IMAGE_TAG=custom-tag START_LOCAL_SCRIPT="$stub" "$START_SCRIPT")"
|
|
26
|
+
grep -Fqx 'IMAGE_TAG=custom-tag' <<<"$override_output"
|
|
27
|
+
|
|
28
|
+
echo "test-start-local-splice-0.6.14.sh: all cases passed"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
START_SCRIPT="$REPO_ROOT/node/start-local-splice-0.7.0.sh"
|
|
6
|
+
|
|
7
|
+
[[ -x "$START_SCRIPT" ]]
|
|
8
|
+
|
|
9
|
+
tmpdir="$(mktemp -d)"
|
|
10
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
11
|
+
|
|
12
|
+
stub="$tmpdir/stub-start-local.sh"
|
|
13
|
+
cat > "$stub" <<'EOF'
|
|
14
|
+
#!/usr/bin/env bash
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
printf 'IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
17
|
+
printf 'args=%s\n' "$*"
|
|
18
|
+
EOF
|
|
19
|
+
chmod +x "$stub"
|
|
20
|
+
|
|
21
|
+
default_output="$(START_LOCAL_SCRIPT="$stub" "$START_SCRIPT" one two)"
|
|
22
|
+
grep -Fqx 'IMAGE_TAG=0.7.0' <<<"$default_output"
|
|
23
|
+
grep -Fqx 'args=one two' <<<"$default_output"
|
|
24
|
+
|
|
25
|
+
override_output="$(IMAGE_TAG=custom-tag START_LOCAL_SCRIPT="$stub" "$START_SCRIPT")"
|
|
26
|
+
grep -Fqx 'IMAGE_TAG=custom-tag' <<<"$override_output"
|
|
27
|
+
|
|
28
|
+
echo "test-start-local-splice-0.7.0.sh: all cases passed"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
STOP_SCRIPT="$REPO_ROOT/node/stop-local-splice-0.6.12.sh"
|
|
6
|
+
|
|
7
|
+
[[ -x "$STOP_SCRIPT" ]]
|
|
8
|
+
|
|
9
|
+
tmpdir="$(mktemp -d)"
|
|
10
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
11
|
+
|
|
12
|
+
stub="$tmpdir/stub-stop-local.sh"
|
|
13
|
+
cat > "$stub" <<'EOF'
|
|
14
|
+
#!/usr/bin/env bash
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
printf 'IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
17
|
+
printf 'args=%s\n' "$*"
|
|
18
|
+
EOF
|
|
19
|
+
chmod +x "$stub"
|
|
20
|
+
|
|
21
|
+
default_output="$(STOP_LOCAL_SCRIPT="$stub" "$STOP_SCRIPT" one two)"
|
|
22
|
+
grep -Fqx 'IMAGE_TAG=0.6.12' <<<"$default_output"
|
|
23
|
+
grep -Fqx 'args=one two' <<<"$default_output"
|
|
24
|
+
|
|
25
|
+
override_output="$(IMAGE_TAG=custom-tag STOP_LOCAL_SCRIPT="$stub" "$STOP_SCRIPT")"
|
|
26
|
+
grep -Fqx 'IMAGE_TAG=custom-tag' <<<"$override_output"
|
|
27
|
+
|
|
28
|
+
echo "test-stop-local-splice-0.6.12.sh: all cases passed"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
STOP_SCRIPT="$REPO_ROOT/node/stop-local-splice-0.6.13.sh"
|
|
6
|
+
|
|
7
|
+
[[ -x "$STOP_SCRIPT" ]]
|
|
8
|
+
|
|
9
|
+
tmpdir="$(mktemp -d)"
|
|
10
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
11
|
+
|
|
12
|
+
stub="$tmpdir/stub-stop-local.sh"
|
|
13
|
+
cat > "$stub" <<'EOF'
|
|
14
|
+
#!/usr/bin/env bash
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
printf 'IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
17
|
+
printf 'args=%s\n' "$*"
|
|
18
|
+
EOF
|
|
19
|
+
chmod +x "$stub"
|
|
20
|
+
|
|
21
|
+
default_output="$(STOP_LOCAL_SCRIPT="$stub" "$STOP_SCRIPT" one two)"
|
|
22
|
+
grep -Fqx 'IMAGE_TAG=0.6.13' <<<"$default_output"
|
|
23
|
+
grep -Fqx 'args=one two' <<<"$default_output"
|
|
24
|
+
|
|
25
|
+
override_output="$(IMAGE_TAG=custom-tag STOP_LOCAL_SCRIPT="$stub" "$STOP_SCRIPT")"
|
|
26
|
+
grep -Fqx 'IMAGE_TAG=custom-tag' <<<"$override_output"
|
|
27
|
+
|
|
28
|
+
echo "test-stop-local-splice-0.6.13.sh: all cases passed"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
STOP_SCRIPT="$REPO_ROOT/node/stop-local-splice-0.6.14.sh"
|
|
6
|
+
|
|
7
|
+
[[ -x "$STOP_SCRIPT" ]]
|
|
8
|
+
|
|
9
|
+
tmpdir="$(mktemp -d)"
|
|
10
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
11
|
+
|
|
12
|
+
stub="$tmpdir/stub-stop-local.sh"
|
|
13
|
+
cat > "$stub" <<'EOF'
|
|
14
|
+
#!/usr/bin/env bash
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
printf 'IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
17
|
+
printf 'args=%s\n' "$*"
|
|
18
|
+
EOF
|
|
19
|
+
chmod +x "$stub"
|
|
20
|
+
|
|
21
|
+
default_output="$(STOP_LOCAL_SCRIPT="$stub" "$STOP_SCRIPT" one two)"
|
|
22
|
+
grep -Fqx 'IMAGE_TAG=0.6.14' <<<"$default_output"
|
|
23
|
+
grep -Fqx 'args=one two' <<<"$default_output"
|
|
24
|
+
|
|
25
|
+
override_output="$(IMAGE_TAG=custom-tag STOP_LOCAL_SCRIPT="$stub" "$STOP_SCRIPT")"
|
|
26
|
+
grep -Fqx 'IMAGE_TAG=custom-tag' <<<"$override_output"
|
|
27
|
+
|
|
28
|
+
echo "test-stop-local-splice-0.6.14.sh: all cases passed"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
STOP_SCRIPT="$REPO_ROOT/node/stop-local-splice-0.7.0.sh"
|
|
6
|
+
|
|
7
|
+
[[ -x "$STOP_SCRIPT" ]]
|
|
8
|
+
|
|
9
|
+
tmpdir="$(mktemp -d)"
|
|
10
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
11
|
+
|
|
12
|
+
stub="$tmpdir/stub-stop-local.sh"
|
|
13
|
+
cat > "$stub" <<'EOF'
|
|
14
|
+
#!/usr/bin/env bash
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
printf 'IMAGE_TAG=%s\n' "${IMAGE_TAG:-}"
|
|
17
|
+
printf 'args=%s\n' "$*"
|
|
18
|
+
EOF
|
|
19
|
+
chmod +x "$stub"
|
|
20
|
+
|
|
21
|
+
default_output="$(STOP_LOCAL_SCRIPT="$stub" "$STOP_SCRIPT" one two)"
|
|
22
|
+
grep -Fqx 'IMAGE_TAG=0.7.0' <<<"$default_output"
|
|
23
|
+
grep -Fqx 'args=one two' <<<"$default_output"
|
|
24
|
+
|
|
25
|
+
override_output="$(IMAGE_TAG=custom-tag STOP_LOCAL_SCRIPT="$stub" "$STOP_SCRIPT")"
|
|
26
|
+
grep -Fqx 'IMAGE_TAG=custom-tag' <<<"$override_output"
|
|
27
|
+
|
|
28
|
+
echo "test-stop-local-splice-0.7.0.sh: all cases passed"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distrohelena/canton-typescript-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,15 @@
|
|
|
15
15
|
"canton-localnet-start": "node/start-local.sh",
|
|
16
16
|
"canton-localnet-stop": "node/stop-local.sh",
|
|
17
17
|
"canton-localnet-participant-358-start": "node/start-local-participant-358.sh",
|
|
18
|
-
"canton-localnet-participant-358-stop": "node/stop-local-participant-358.sh"
|
|
18
|
+
"canton-localnet-participant-358-stop": "node/stop-local-participant-358.sh",
|
|
19
|
+
"canton-localnet-splice-0.7.0-start": "node/start-local-splice-0.7.0.sh",
|
|
20
|
+
"canton-localnet-splice-0.7.0-stop": "node/stop-local-splice-0.7.0.sh",
|
|
21
|
+
"canton-localnet-splice-0.6.14-start": "node/start-local-splice-0.6.14.sh",
|
|
22
|
+
"canton-localnet-splice-0.6.14-stop": "node/stop-local-splice-0.6.14.sh",
|
|
23
|
+
"canton-localnet-splice-0.6.13-start": "node/start-local-splice-0.6.13.sh",
|
|
24
|
+
"canton-localnet-splice-0.6.13-stop": "node/stop-local-splice-0.6.13.sh",
|
|
25
|
+
"canton-localnet-splice-0.6.12-start": "node/start-local-splice-0.6.12.sh",
|
|
26
|
+
"canton-localnet-splice-0.6.12-stop": "node/stop-local-splice-0.6.12.sh"
|
|
19
27
|
},
|
|
20
28
|
"keywords": [
|
|
21
29
|
"canton",
|
|
@@ -109,10 +117,26 @@
|
|
|
109
117
|
"stop:local-ledger": "bash node/stop-local.sh",
|
|
110
118
|
"start:local-participant-358": "bash node/start-local-participant-358.sh",
|
|
111
119
|
"stop:local-participant-358": "bash node/stop-local-participant-358.sh",
|
|
120
|
+
"start:local-ledger-splice-0.7.0": "bash node/start-local-splice-0.7.0.sh",
|
|
121
|
+
"stop:local-ledger-splice-0.7.0": "bash node/stop-local-splice-0.7.0.sh",
|
|
122
|
+
"start:local-ledger-splice-0.6.14": "bash node/start-local-splice-0.6.14.sh",
|
|
123
|
+
"stop:local-ledger-splice-0.6.14": "bash node/stop-local-splice-0.6.14.sh",
|
|
124
|
+
"start:local-ledger-splice-0.6.13": "bash node/start-local-splice-0.6.13.sh",
|
|
125
|
+
"stop:local-ledger-splice-0.6.13": "bash node/stop-local-splice-0.6.13.sh",
|
|
126
|
+
"start:local-ledger-splice-0.6.12": "bash node/start-local-splice-0.6.12.sh",
|
|
127
|
+
"stop:local-ledger-splice-0.6.12": "bash node/stop-local-splice-0.6.12.sh",
|
|
112
128
|
"test:start-local-script": "bash node/test-start-local.sh",
|
|
113
129
|
"test:stop-local-script": "bash node/test-stop-local.sh",
|
|
114
130
|
"test:participant-358-sidecar-script": "bash node/test-participant-358-sidecar.sh",
|
|
115
131
|
"test:participant-358-sidecar-smoke": "bash node/test-participant-358-sidecar-smoke.sh",
|
|
132
|
+
"test:start-local-splice-0.7.0-script": "bash node/test-start-local-splice-0.7.0.sh",
|
|
133
|
+
"test:stop-local-splice-0.7.0-script": "bash node/test-stop-local-splice-0.7.0.sh",
|
|
134
|
+
"test:start-local-splice-0.6.14-script": "bash node/test-start-local-splice-0.6.14.sh",
|
|
135
|
+
"test:stop-local-splice-0.6.14-script": "bash node/test-stop-local-splice-0.6.14.sh",
|
|
136
|
+
"test:start-local-splice-0.6.13-script": "bash node/test-start-local-splice-0.6.13.sh",
|
|
137
|
+
"test:stop-local-splice-0.6.13-script": "bash node/test-stop-local-splice-0.6.13.sh",
|
|
138
|
+
"test:start-local-splice-0.6.12-script": "bash node/test-start-local-splice-0.6.12.sh",
|
|
139
|
+
"test:stop-local-splice-0.6.12-script": "bash node/test-stop-local-splice-0.6.12.sh",
|
|
116
140
|
"test": "vitest run --exclude 'tests/live/**' --maxWorkers=1 --testTimeout=15000",
|
|
117
141
|
"test:property": "vitest run tests/property --maxWorkers=1 --testTimeout=15000",
|
|
118
142
|
"test:live": "vitest run --dir tests/live --maxWorkers=1 --testTimeout=15000",
|