@twin.org/node-core 0.9.2-next.1 → 0.9.2-next.10
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/dist/es/builders/engineEnvBuilder.js +190 -104
- package/dist/es/builders/engineEnvBuilder.js.map +1 -1
- package/dist/es/builders/engineServerEnvBuilder.js +2 -12
- package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
- package/dist/es/builders/helper/envHelpers.js +173 -0
- package/dist/es/builders/helper/envHelpers.js.map +1 -0
- package/dist/es/cli.js +2 -2
- package/dist/es/cli.js.map +1 -1
- package/dist/es/commands/{bootstrapLegacy.js → bootstrapDev.js} +25 -24
- package/dist/es/commands/bootstrapDev.js.map +1 -0
- package/dist/es/commands/identityCreate.js +4 -26
- package/dist/es/commands/identityCreate.js.map +1 -1
- package/dist/es/commands/identityImports.js +2 -1
- package/dist/es/commands/identityImports.js.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/{IBootstrapLegacyEnvironmentVariables.js → IBootstrapDevEnvironmentVariables.js} +1 -1
- package/dist/es/models/IBootstrapDevEnvironmentVariables.js.map +1 -0
- package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
- package/dist/es/models/IEnvironmentVariables.js.map +1 -1
- package/dist/es/models/{bootstrapLegacyEnvironmentVariableKeys.js → bootstrapDevEnvironmentVariableKeys.js} +6 -6
- package/dist/es/models/bootstrapDevEnvironmentVariableKeys.js.map +1 -0
- package/dist/es/models/engineEnvironmentVariableKeys.js +48 -4
- package/dist/es/models/engineEnvironmentVariableKeys.js.map +1 -1
- package/dist/es/models/engineServerEnvironmentVariableKeys.js +3 -3
- package/dist/es/models/engineServerEnvironmentVariableKeys.js.map +1 -1
- package/dist/es/models/nodeEnvironmentVariableKeys.js +1 -1
- package/dist/es/models/nodeEnvironmentVariableKeys.js.map +1 -1
- package/dist/es/node.js +4 -4
- package/dist/es/node.js.map +1 -1
- package/dist/types/builders/helper/envHelpers.d.ts +81 -0
- package/dist/types/commands/{bootstrapLegacy.d.ts → bootstrapDev.d.ts} +3 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types/models/{IBootstrapLegacyEnvironmentVariables.d.ts → IBootstrapDevEnvironmentVariables.d.ts} +2 -2
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +194 -13
- package/dist/types/models/IEnvironmentVariables.d.ts +2 -2
- package/dist/types/models/bootstrapDevEnvironmentVariableKeys.d.ts +4 -0
- package/dist/types/node.d.ts +1 -1
- package/docs/changelog.md +65 -0
- package/docs/reference/functions/buildConfiguration.md +2 -2
- package/docs/reference/functions/buildEngineServerConfiguration.md +1 -1
- package/docs/reference/functions/run.md +1 -1
- package/docs/reference/functions/start.md +1 -1
- package/docs/reference/index.md +1 -1
- package/docs/reference/interfaces/{IBootstrapLegacyEnvironmentVariables.md → IBootstrapDevEnvironmentVariables.md} +2 -2
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +413 -20
- package/docs/reference/type-aliases/IEnvironmentVariables.md +1 -1
- package/locales/en.json +6 -5
- package/package.json +11 -4
- package/dist/es/commands/bootstrapLegacy.js.map +0 -1
- package/dist/es/models/IBootstrapLegacyEnvironmentVariables.js.map +0 -1
- package/dist/es/models/bootstrapLegacyEnvironmentVariableKeys.js.map +0 -1
- package/dist/types/models/bootstrapLegacyEnvironmentVariableKeys.d.ts +0 -4
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import {
|
|
5
|
-
import { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, AutomationComponentType, BackgroundTaskComponentType, BlobStorageComponentType, BlobStorageConnectorType, ContextIdHandlerComponentType, DataProcessingComponentType, DataspaceControlPlaneComponentType, DataspaceDataPlaneComponentType, DltConfigType, DocumentManagementComponentType, EngineTypeHelper, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, HealthComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingAdminComponentType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, MetricsCollectorComponentType, MetricsProducerComponentType, NftComponentType, NftConnectorType, NotarizationComponentType, NotarizationConnectorType, PlatformComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPnapComponentType, RightsManagementPnpComponentType, RightsManagementPxpComponentType, SchemaVersionMigrationComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, TenantAdminComponentType, TrustComponentType, TrustVerifierComponentType, VaultConnectorType, WalletConnectorType } from "@twin.org/engine-types";
|
|
4
|
+
import { Is, Mutex } from "@twin.org/core";
|
|
5
|
+
import { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, AutomationComponentType, BackgroundTaskComponentType, BlobStorageComponentType, BlobStorageConnectorType, ContextIdHandlerComponentType, DataProcessingComponentType, DataspaceControlPlaneComponentType, DataspaceDataPlaneComponentType, DltConfigType, DocumentManagementComponentType, EngineTypeHelper, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, HealthComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingAdminComponentType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, MetricsCollectorComponentType, MetricsProducerComponentType, NftComponentType, NftConnectorType, NotarizationComponentType, NotarizationConnectorType, PlatformComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPnapComponentType, RightsManagementPnpComponentType, RightsManagementPxpComponentType, SchemaVersionMigrationComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, TenantAdminComponentType, TracingComponentType, TracingConnectorType, TrustComponentType, TrustVerifierComponentType, VaultConnectorType, WalletConnectorType } from "@twin.org/engine-types";
|
|
6
6
|
import { OpenTelemetryExporterTypes } from "@twin.org/logging-connector-opentelemetry";
|
|
7
7
|
import { OpenTelemetryReaderTypes } from "@twin.org/telemetry-connector-opentelemetry";
|
|
8
|
+
import { OpenTelemetryProcessorTypes } from "@twin.org/tracing-connector-opentelemetry";
|
|
8
9
|
import { CONTEXT_ID_HANDLER_FEATURE_DID, CONTEXT_ID_HANDLER_FEATURE_TENANT } from "../defaults.js";
|
|
9
10
|
import { isAuthEntityStorageRequired } from "./engineServerEnvBuilder.js";
|
|
11
|
+
import { commaSeparatedListToArray, envBoolean, envCount, envDateTime, envInteger, envMinToMs, envMinutes, envMs, envSecToMs, envSeconds } from "./helper/envHelpers.js";
|
|
10
12
|
/**
|
|
11
13
|
* Build the engine core configuration from environment variables.
|
|
12
14
|
* @param envVars The environment variables.
|
|
@@ -19,12 +21,12 @@ export async function buildEngineConfiguration(envVars) {
|
|
|
19
21
|
envVars.stateFilename = path.join(envVars.storageFileRoot, envVars.stateFilename);
|
|
20
22
|
}
|
|
21
23
|
const coreConfig = {
|
|
22
|
-
debug:
|
|
23
|
-
silent:
|
|
24
|
+
debug: envBoolean(envVars, "debug", false),
|
|
25
|
+
silent: envBoolean(envVars, "silent", false),
|
|
24
26
|
silentLoggers: commaSeparatedListToArray(envVars.loggingSilentComponents),
|
|
25
27
|
types: {}
|
|
26
28
|
};
|
|
27
|
-
const mutexTimeoutMs =
|
|
29
|
+
const mutexTimeoutMs = envMs(envVars, "mutexTimeoutDefault");
|
|
28
30
|
if (!Is.empty(mutexTimeoutMs)) {
|
|
29
31
|
Mutex.setDefaultTimeoutMs(mutexTimeoutMs);
|
|
30
32
|
}
|
|
@@ -42,6 +44,7 @@ export async function buildEngineConfiguration(envVars) {
|
|
|
42
44
|
await configureEventBus(coreConfig, envVars);
|
|
43
45
|
await configureTelemetry(coreConfig, envVars);
|
|
44
46
|
await configureMetricsCollector(coreConfig, envVars);
|
|
47
|
+
await configureTracing(coreConfig, envVars);
|
|
45
48
|
await configureMessaging(coreConfig, envVars);
|
|
46
49
|
await configureAutomation(coreConfig, envVars);
|
|
47
50
|
await configureHealth(coreConfig, envVars);
|
|
@@ -79,7 +82,7 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
79
82
|
type: EntityStorageConnectorType.Memory,
|
|
80
83
|
options: {
|
|
81
84
|
config: {
|
|
82
|
-
mutexTimeoutMs:
|
|
85
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
});
|
|
@@ -90,7 +93,7 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
90
93
|
options: {
|
|
91
94
|
config: {
|
|
92
95
|
directory: envVars.storageFileRoot ?? "",
|
|
93
|
-
mutexTimeoutMs:
|
|
96
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
94
97
|
},
|
|
95
98
|
folderPrefix: envVars.entityStorageTablePrefix
|
|
96
99
|
}
|
|
@@ -106,7 +109,8 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
106
109
|
accessKeyId: envVars.awsDynamodbAccessKeyId,
|
|
107
110
|
secretAccessKey: envVars.awsDynamodbSecretAccessKey,
|
|
108
111
|
endpoint: envVars.awsDynamodbEndpoint,
|
|
109
|
-
connectionTimeoutMs:
|
|
112
|
+
connectionTimeoutMs: envMs(envVars, "awsDynamodbConnectionTimeout"),
|
|
113
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
110
114
|
},
|
|
111
115
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
112
116
|
}
|
|
@@ -120,7 +124,8 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
120
124
|
endpoint: envVars.azureCosmosdbEndpoint ?? "",
|
|
121
125
|
key: envVars.azureCosmosdbKey ?? "",
|
|
122
126
|
databaseId: envVars.azureCosmosdbDatabaseId ?? "",
|
|
123
|
-
containerId: envVars.azureCosmosdbContainerId ?? ""
|
|
127
|
+
containerId: envVars.azureCosmosdbContainerId ?? "",
|
|
128
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
124
129
|
},
|
|
125
130
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
126
131
|
}
|
|
@@ -135,7 +140,8 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
135
140
|
credentials: envVars.gcpFirestoreCredentials ?? "",
|
|
136
141
|
databaseId: envVars.gcpFirestoreDatabaseId ?? "",
|
|
137
142
|
collectionName: envVars.gcpFirestoreCollectionName ?? "",
|
|
138
|
-
endpoint: envVars.gcpFirestoreEndpoint ?? ""
|
|
143
|
+
endpoint: envVars.gcpFirestoreEndpoint ?? "",
|
|
144
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
139
145
|
},
|
|
140
146
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
141
147
|
}
|
|
@@ -149,7 +155,12 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
149
155
|
hosts: commaSeparatedListToArray(envVars.scylladbHosts),
|
|
150
156
|
localDataCenter: envVars.scylladbLocalDataCenter ?? "",
|
|
151
157
|
keyspace: envVars.scylladbKeyspace ?? "",
|
|
152
|
-
port:
|
|
158
|
+
port: envInteger(envVars, "scylladbPort"),
|
|
159
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
160
|
+
pool: {
|
|
161
|
+
coreConnectionsPerHost: envCount(envVars, "scylladbPoolCoreConnectionsPerHost"),
|
|
162
|
+
maxRequestsPerConnection: envCount(envVars, "scylladbPoolMaxRequestsPerConnection")
|
|
163
|
+
}
|
|
153
164
|
},
|
|
154
165
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
155
166
|
}
|
|
@@ -161,10 +172,19 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
161
172
|
options: {
|
|
162
173
|
config: {
|
|
163
174
|
host: envVars.mySqlHost ?? "",
|
|
164
|
-
port:
|
|
175
|
+
port: envInteger(envVars, "mySqlPort"),
|
|
165
176
|
user: envVars.mySqlUser ?? "",
|
|
166
177
|
password: envVars.mySqlPassword ?? "",
|
|
167
|
-
database: envVars.mySqlDatabase ?? ""
|
|
178
|
+
database: envVars.mySqlDatabase ?? "",
|
|
179
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
180
|
+
pool: {
|
|
181
|
+
connectionLimit: envCount(envVars, "mySqlPoolConnectionLimit"),
|
|
182
|
+
maxIdle: envCount(envVars, "mySqlPoolMaxIdle"),
|
|
183
|
+
idleTimeout: envMs(envVars, "mySqlPoolIdleTimeout"),
|
|
184
|
+
enableKeepAlive: envBoolean(envVars, "mySqlPoolEnableKeepAlive"),
|
|
185
|
+
waitForConnections: envBoolean(envVars, "mySqlPoolWaitForConnections"),
|
|
186
|
+
queueLimit: envCount(envVars, "mySqlPoolQueueLimit")
|
|
187
|
+
}
|
|
168
188
|
},
|
|
169
189
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
170
190
|
}
|
|
@@ -176,10 +196,17 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
176
196
|
options: {
|
|
177
197
|
config: {
|
|
178
198
|
host: envVars.mongoDbHost ?? "",
|
|
179
|
-
port:
|
|
199
|
+
port: envInteger(envVars, "mongoDbPort"),
|
|
180
200
|
user: envVars.mongoDbUser ?? "",
|
|
181
201
|
password: envVars.mongoDbPassword ?? "",
|
|
182
|
-
database: envVars.mongoDbDatabase ?? ""
|
|
202
|
+
database: envVars.mongoDbDatabase ?? "",
|
|
203
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
204
|
+
pool: {
|
|
205
|
+
maxPoolSize: envCount(envVars, "mongoDbPoolMaxPoolSize"),
|
|
206
|
+
minPoolSize: envCount(envVars, "mongoDbPoolMinPoolSize"),
|
|
207
|
+
maxIdleTimeMs: envMs(envVars, "mongoDbPoolMaxIdleTime"),
|
|
208
|
+
waitQueueTimeoutMs: envMs(envVars, "mongoDbPoolWaitQueueTimeout")
|
|
209
|
+
}
|
|
183
210
|
},
|
|
184
211
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
185
212
|
}
|
|
@@ -191,10 +218,17 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
191
218
|
options: {
|
|
192
219
|
config: {
|
|
193
220
|
host: envVars.postgreSqlHost ?? "",
|
|
194
|
-
port:
|
|
221
|
+
port: envInteger(envVars, "postgreSqlPort"),
|
|
195
222
|
user: envVars.postgreSqlUser ?? "",
|
|
196
223
|
password: envVars.postgreSqlPassword ?? "",
|
|
197
|
-
database: envVars.postgreSqlDatabase ?? ""
|
|
224
|
+
database: envVars.postgreSqlDatabase ?? "",
|
|
225
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
226
|
+
pool: {
|
|
227
|
+
max: envCount(envVars, "postgreSqlPoolMax"),
|
|
228
|
+
idleTimeout: envSeconds(envVars, "postgreSqlPoolIdleTimeout"),
|
|
229
|
+
connectTimeout: envSeconds(envVars, "postgreSqlPoolConnectTimeout"),
|
|
230
|
+
maxLifetime: envSeconds(envVars, "postgreSqlPoolMaxLifetime")
|
|
231
|
+
}
|
|
198
232
|
},
|
|
199
233
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
200
234
|
}
|
|
@@ -342,19 +376,19 @@ async function configureLogging(coreConfig, envVars) {
|
|
|
342
376
|
type: LoggingConnectorType.EntityStorage,
|
|
343
377
|
options: {
|
|
344
378
|
config: {
|
|
345
|
-
batchSize:
|
|
346
|
-
batchIntervalMs: (
|
|
347
|
-
retainForMs: (
|
|
348
|
-
maxEntries:
|
|
349
|
-
retentionIntervalMs: (
|
|
350
|
-
retentionBatchSize:
|
|
351
|
-
mutexTimeoutMs:
|
|
379
|
+
batchSize: envCount(envVars, "loggingBatchSize"),
|
|
380
|
+
batchIntervalMs: envSecToMs(envVars, "loggingBatchFlushInterval"),
|
|
381
|
+
retainForMs: envMinToMs(envVars, "loggingRetainFor"),
|
|
382
|
+
maxEntries: envCount(envVars, "loggingMaxEntries"),
|
|
383
|
+
retentionIntervalMs: envMinToMs(envVars, "loggingRetentionInterval"),
|
|
384
|
+
retentionBatchSize: envCount(envVars, "loggingRetentionBatchSize"),
|
|
385
|
+
mutexTimeoutMs: envMs(envVars, "loggingMutexTimeout")
|
|
352
386
|
}
|
|
353
387
|
}
|
|
354
388
|
});
|
|
355
389
|
additionalConnectorCount++;
|
|
356
390
|
}
|
|
357
|
-
else if (loggingConnector === LoggingConnectorType.
|
|
391
|
+
else if (loggingConnector === LoggingConnectorType.OpenTelemetry) {
|
|
358
392
|
const otelLoggingConfig = {
|
|
359
393
|
loggerName: envVars.openTelemetryLoggingLoggerName,
|
|
360
394
|
loggerVersion: envVars.openTelemetryLoggingLoggerVersion
|
|
@@ -370,7 +404,7 @@ async function configureLogging(coreConfig, envVars) {
|
|
|
370
404
|
};
|
|
371
405
|
}
|
|
372
406
|
coreConfig.types.loggingConnector.push({
|
|
373
|
-
type: LoggingConnectorType.
|
|
407
|
+
type: LoggingConnectorType.OpenTelemetry,
|
|
374
408
|
options: {
|
|
375
409
|
config: otelLoggingConfig
|
|
376
410
|
}
|
|
@@ -384,9 +418,9 @@ async function configureLogging(coreConfig, envVars) {
|
|
|
384
418
|
config: {
|
|
385
419
|
directory: envVars.loggingFileDirectory ?? envVars.storageFileRoot ?? "",
|
|
386
420
|
filename: envVars.loggingFileFilename,
|
|
387
|
-
maxFileSizeBytes:
|
|
388
|
-
maxRetainedFiles:
|
|
389
|
-
mutexTimeoutMs:
|
|
421
|
+
maxFileSizeBytes: envCount(envVars, "loggingFileMaxFileSizeBytes"),
|
|
422
|
+
maxRetainedFiles: envCount(envVars, "loggingFileMaxRetainedFiles"),
|
|
423
|
+
mutexTimeoutMs: envMs(envVars, "loggingMutexTimeout")
|
|
390
424
|
}
|
|
391
425
|
}
|
|
392
426
|
});
|
|
@@ -489,16 +523,21 @@ async function configureTelemetry(coreConfig, envVars) {
|
|
|
489
523
|
coreConfig.types.telemetryConnector ??= [];
|
|
490
524
|
if (envVars.telemetryConnector === TelemetryConnectorType.EntityStorage) {
|
|
491
525
|
coreConfig.types.telemetryConnector.push({
|
|
492
|
-
type: TelemetryConnectorType.EntityStorage
|
|
526
|
+
type: TelemetryConnectorType.EntityStorage,
|
|
527
|
+
options: {
|
|
528
|
+
config: {
|
|
529
|
+
mutexTimeoutMs: envMs(envVars, "telemetryMutexTimeout")
|
|
530
|
+
}
|
|
531
|
+
}
|
|
493
532
|
});
|
|
494
533
|
}
|
|
495
534
|
else if (envVars.telemetryConnector === TelemetryConnectorType.OpenTelemetry) {
|
|
496
535
|
let readers;
|
|
497
|
-
if (envVars.openTelemetryReader ===
|
|
536
|
+
if (envVars.openTelemetryReader === OpenTelemetryReaderTypes.Prometheus) {
|
|
498
537
|
readers = {
|
|
499
538
|
prometheus: {
|
|
500
539
|
type: OpenTelemetryReaderTypes.Prometheus,
|
|
501
|
-
port:
|
|
540
|
+
port: envCount(envVars, "openTelemetryPrometheusPort")
|
|
502
541
|
}
|
|
503
542
|
};
|
|
504
543
|
}
|
|
@@ -506,6 +545,7 @@ async function configureTelemetry(coreConfig, envVars) {
|
|
|
506
545
|
type: TelemetryConnectorType.OpenTelemetry,
|
|
507
546
|
options: {
|
|
508
547
|
config: {
|
|
548
|
+
mutexTimeoutMs: envMs(envVars, "telemetryMutexTimeout"),
|
|
509
549
|
meterName: envVars.openTelemetryMeterName,
|
|
510
550
|
meterVersion: envVars.openTelemetryMeterVersion,
|
|
511
551
|
readers
|
|
@@ -526,26 +566,72 @@ async function configureTelemetry(coreConfig, envVars) {
|
|
|
526
566
|
*/
|
|
527
567
|
async function configureMetricsCollector(coreConfig, envVars) {
|
|
528
568
|
if (isTelemetryRequired(envVars)) {
|
|
529
|
-
const intervalSec = Coerce.integer(envVars.telemetryMetricsCollectorInterval) ?? 60;
|
|
530
569
|
coreConfig.types.metricsCollectorComponent ??= [];
|
|
531
570
|
coreConfig.types.metricsCollectorComponent.push({
|
|
532
571
|
type: MetricsCollectorComponentType.Service,
|
|
533
|
-
options: {
|
|
572
|
+
options: {
|
|
573
|
+
config: {
|
|
574
|
+
intervalMs: envSecToMs(envVars, "telemetryMetricsCollectorInterval")
|
|
575
|
+
}
|
|
576
|
+
},
|
|
534
577
|
isCloneable: false
|
|
535
578
|
});
|
|
536
|
-
const maxHistory = Coerce.integer(envVars.telemetryMetricsProducerMaxHistory) ?? 1440;
|
|
537
579
|
coreConfig.types.metricsProducerComponent ??= [];
|
|
538
580
|
const metricsProducers = commaSeparatedListToArray(envVars.telemetryMetricsProducers ??
|
|
539
581
|
[MetricsProducerComponentType.System, MetricsProducerComponentType.Process].join(","));
|
|
540
582
|
for (const producerType of metricsProducers) {
|
|
541
583
|
coreConfig.types.metricsProducerComponent.push({
|
|
542
584
|
type: producerType,
|
|
543
|
-
options: { maxHistory },
|
|
585
|
+
options: { maxHistory: envCount(envVars, "telemetryMetricsProducerMaxHistory") },
|
|
544
586
|
isCloneable: false
|
|
545
587
|
});
|
|
546
588
|
}
|
|
547
589
|
}
|
|
548
590
|
}
|
|
591
|
+
/**
|
|
592
|
+
* Configures the tracing.
|
|
593
|
+
* @param coreConfig The core config.
|
|
594
|
+
* @param envVars The environment variables.
|
|
595
|
+
* @returns A promise that resolves when the tracing configuration has been applied.
|
|
596
|
+
*/
|
|
597
|
+
async function configureTracing(coreConfig, envVars) {
|
|
598
|
+
coreConfig.types.tracingConnector ??= [];
|
|
599
|
+
if (envVars.tracingConnector === TracingConnectorType.EntityStorage) {
|
|
600
|
+
coreConfig.types.tracingConnector.push({
|
|
601
|
+
type: TracingConnectorType.EntityStorage,
|
|
602
|
+
options: {
|
|
603
|
+
config: {
|
|
604
|
+
mutexTimeoutMs: envMs(envVars, "tracingMutexTimeout")
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
else if (envVars.tracingConnector === TracingConnectorType.OpenTelemetry) {
|
|
610
|
+
const otelTracingConfig = {
|
|
611
|
+
tracerName: envVars.openTelemetryTracingTracerName,
|
|
612
|
+
tracerVersion: envVars.openTelemetryTracingTracerVersion
|
|
613
|
+
};
|
|
614
|
+
if (Is.stringValue(envVars.openTelemetryTracingEndpoint)) {
|
|
615
|
+
otelTracingConfig.exporters = {
|
|
616
|
+
otlp: {
|
|
617
|
+
endpoint: envVars.openTelemetryTracingEndpoint,
|
|
618
|
+
processor: envVars.openTelemetryTracingProcessor ??
|
|
619
|
+
OpenTelemetryProcessorTypes.Batch
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
coreConfig.types.tracingConnector.push({
|
|
624
|
+
type: TracingConnectorType.OpenTelemetry,
|
|
625
|
+
options: {
|
|
626
|
+
config: otelTracingConfig
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
if (coreConfig.types.tracingConnector.length > 0) {
|
|
631
|
+
coreConfig.types.tracingComponent ??= [];
|
|
632
|
+
coreConfig.types.tracingComponent.push({ type: TracingComponentType.Service });
|
|
633
|
+
}
|
|
634
|
+
}
|
|
549
635
|
/**
|
|
550
636
|
* Configures the automation.
|
|
551
637
|
* @param coreConfig The core config.
|
|
@@ -578,13 +664,14 @@ async function configureAutomation(coreConfig, envVars) {
|
|
|
578
664
|
*/
|
|
579
665
|
async function configureHealth(coreConfig, envVars) {
|
|
580
666
|
coreConfig.types.healthComponent ??= [];
|
|
581
|
-
if (
|
|
667
|
+
if (envBoolean(envVars, "healthEnabled", false)) {
|
|
582
668
|
coreConfig.types.healthComponent.push({
|
|
583
669
|
type: HealthComponentType.Service,
|
|
584
670
|
options: {
|
|
585
671
|
config: {
|
|
586
|
-
healthCheckInterval: (
|
|
587
|
-
|
|
672
|
+
healthCheckInterval: envSecToMs(envVars, "healthInterval"),
|
|
673
|
+
healthCheckApplicationInterval: envSecToMs(envVars, "healthApplicationInterval"),
|
|
674
|
+
initialInterval: envSecToMs(envVars, "healthStartupInterval")
|
|
588
675
|
}
|
|
589
676
|
},
|
|
590
677
|
isCloneable: false
|
|
@@ -598,7 +685,7 @@ async function configureHealth(coreConfig, envVars) {
|
|
|
598
685
|
* @returns A promise that resolves when the schema migration configuration has been applied.
|
|
599
686
|
*/
|
|
600
687
|
async function configureSchemaMigration(coreConfig, envVars) {
|
|
601
|
-
const isSchemaMigrationEnabled =
|
|
688
|
+
const isSchemaMigrationEnabled = envBoolean(envVars, "schemaMigrationEnabled", true);
|
|
602
689
|
if (isSchemaMigrationEnabled) {
|
|
603
690
|
coreConfig.types.schemaVersionMigrationComponent ??= [];
|
|
604
691
|
coreConfig.types.schemaVersionMigrationComponent.push({
|
|
@@ -614,7 +701,7 @@ async function configureSchemaMigration(coreConfig, envVars) {
|
|
|
614
701
|
* @returns A promise that resolves when the platform configuration has been applied.
|
|
615
702
|
*/
|
|
616
703
|
async function configurePlatform(coreConfig, envVars) {
|
|
617
|
-
const isTenantEnabled =
|
|
704
|
+
const isTenantEnabled = envBoolean(envVars, "tenantEnabled", false);
|
|
618
705
|
coreConfig.types.platformComponent ??= [];
|
|
619
706
|
coreConfig.types.platformComponent.push({
|
|
620
707
|
type: PlatformComponentType.Service,
|
|
@@ -632,7 +719,7 @@ async function configurePlatform(coreConfig, envVars) {
|
|
|
632
719
|
* @returns A promise that resolves when the tenant configuration has been applied.
|
|
633
720
|
*/
|
|
634
721
|
async function configureTenant(coreConfig, envVars) {
|
|
635
|
-
const isTenantEnabled =
|
|
722
|
+
const isTenantEnabled = envBoolean(envVars, "tenantEnabled", false);
|
|
636
723
|
if (isTenantEnabled) {
|
|
637
724
|
coreConfig.types.tenantAdminComponent ??= [];
|
|
638
725
|
coreConfig.types.tenantAdminComponent.push({
|
|
@@ -652,7 +739,7 @@ async function configureContextIdHandlers(coreConfig, envVars) {
|
|
|
652
739
|
type: ContextIdHandlerComponentType.Did,
|
|
653
740
|
features: [CONTEXT_ID_HANDLER_FEATURE_DID]
|
|
654
741
|
});
|
|
655
|
-
if (
|
|
742
|
+
if (envBoolean(envVars, "tenantEnabled", false)) {
|
|
656
743
|
coreConfig.types.contextIdHandlerComponent.push({
|
|
657
744
|
type: ContextIdHandlerComponentType.Tenant,
|
|
658
745
|
features: [CONTEXT_ID_HANDLER_FEATURE_TENANT]
|
|
@@ -666,7 +753,7 @@ async function configureContextIdHandlers(coreConfig, envVars) {
|
|
|
666
753
|
* @returns A promise that resolves when the messaging configuration has been applied.
|
|
667
754
|
*/
|
|
668
755
|
async function configureMessaging(coreConfig, envVars) {
|
|
669
|
-
if (
|
|
756
|
+
if (envBoolean(envVars, "messagingEnabled", false)) {
|
|
670
757
|
coreConfig.types.messagingEmailConnector ??= [];
|
|
671
758
|
coreConfig.types.messagingSmsConnector ??= [];
|
|
672
759
|
coreConfig.types.messagingPushNotificationConnector ??= [];
|
|
@@ -760,13 +847,14 @@ async function configureFaucet(coreConfig, envVars) {
|
|
|
760
847
|
type: FaucetConnectorType.EntityStorage
|
|
761
848
|
});
|
|
762
849
|
}
|
|
763
|
-
else if (envVars.faucetConnector === FaucetConnectorType.Iota
|
|
850
|
+
else if (envVars.faucetConnector === FaucetConnectorType.Iota &&
|
|
851
|
+
Is.stringValue(envVars.iotaFaucetEndpoint)) {
|
|
764
852
|
const dltConfig = EngineTypeHelper.getConfigOfType(coreConfig, "dltConfig", DltConfigType.Iota);
|
|
765
853
|
coreConfig.types.faucetConnector.push({
|
|
766
854
|
type: FaucetConnectorType.Iota,
|
|
767
855
|
options: {
|
|
768
856
|
config: {
|
|
769
|
-
endpoint: envVars.iotaFaucetEndpoint
|
|
857
|
+
endpoint: envVars.iotaFaucetEndpoint,
|
|
770
858
|
clientOptions: dltConfig?.options?.config?.clientOptions ?? { url: "" },
|
|
771
859
|
network: dltConfig?.options?.config?.network ?? ""
|
|
772
860
|
}
|
|
@@ -868,7 +956,16 @@ async function configureImmutableProof(coreConfig, envVars) {
|
|
|
868
956
|
type: ImmutableProofComponentType.Service,
|
|
869
957
|
options: {
|
|
870
958
|
config: {
|
|
871
|
-
verificationMethodId: envVars.immutableProofVerificationMethodId
|
|
959
|
+
verificationMethodId: envVars.immutableProofVerificationMethodId,
|
|
960
|
+
taskRetryCount: envCount(envVars, "immutableProofTaskRetryCount"),
|
|
961
|
+
taskRetryInterval: envSecToMs(envVars, "immutableProofTaskRetryInterval"),
|
|
962
|
+
taskFailureRetainFor: envMinToMs(envVars, "immutableProofTaskFailureRetainFor"),
|
|
963
|
+
sweepIntervalMinutes: envMinutes(envVars, "immutableProofSweepInterval"),
|
|
964
|
+
sweepStaleThresholdMs: envMinToMs(envVars, "immutableProofSweepStaleThreshold"),
|
|
965
|
+
sweepMaxAttempts: envCount(envVars, "immutableProofSweepMaxAttempts"),
|
|
966
|
+
sweepBatchLimit: envCount(envVars, "immutableProofSweepBatchLimit"),
|
|
967
|
+
sweepBackoffMs: envMinToMs(envVars, "immutableProofSweepBackoff"),
|
|
968
|
+
sweepAssumeRetryableBefore: envDateTime(envVars, "immutableProofSweepAssumeRetryableBefore")
|
|
872
969
|
}
|
|
873
970
|
}
|
|
874
971
|
});
|
|
@@ -897,8 +994,10 @@ async function configureIdentity(coreConfig, envVars) {
|
|
|
897
994
|
identityPkgId: Is.stringValue(envVars.iotaIdentityPackageId)
|
|
898
995
|
? envVars.iotaIdentityPackageId
|
|
899
996
|
: undefined,
|
|
900
|
-
walletAddressIndex:
|
|
901
|
-
didResolutionCacheTtlMs:
|
|
997
|
+
walletAddressIndex: envCount(envVars, "identityWalletAddressIndex") ?? 0,
|
|
998
|
+
didResolutionCacheTtlMs: envMs(envVars, "identityDidResolutionCacheTtl"),
|
|
999
|
+
didResolutionCacheCapacity: envCount(envVars, "identityDidResolutionCacheCapacity"),
|
|
1000
|
+
didResolutionCacheMutexTimeoutMs: envMs(envVars, "identityDidResolutionCacheMutexTimeout")
|
|
902
1001
|
}
|
|
903
1002
|
}
|
|
904
1003
|
});
|
|
@@ -1002,13 +1101,13 @@ async function configureAttestation(coreConfig, envVars) {
|
|
|
1002
1101
|
* @returns A promise that resolves when the auditable item graph configuration has been applied.
|
|
1003
1102
|
*/
|
|
1004
1103
|
async function configureAuditableItemGraph(coreConfig, envVars) {
|
|
1005
|
-
if (
|
|
1104
|
+
if (envBoolean(envVars, "auditableItemGraphEnabled", false)) {
|
|
1006
1105
|
coreConfig.types.auditableItemGraphComponent ??= [];
|
|
1007
1106
|
coreConfig.types.auditableItemGraphComponent.push({
|
|
1008
1107
|
type: AuditableItemGraphComponentType.Service,
|
|
1009
1108
|
options: {
|
|
1010
1109
|
config: {
|
|
1011
|
-
mutexTimeoutMs:
|
|
1110
|
+
mutexTimeoutMs: envMs(envVars, "auditableItemGraphMutexTimeout")
|
|
1012
1111
|
}
|
|
1013
1112
|
}
|
|
1014
1113
|
});
|
|
@@ -1021,13 +1120,13 @@ async function configureAuditableItemGraph(coreConfig, envVars) {
|
|
|
1021
1120
|
* @returns A promise that resolves when the auditable item stream configuration has been applied.
|
|
1022
1121
|
*/
|
|
1023
1122
|
async function configureAuditableItemStream(coreConfig, envVars) {
|
|
1024
|
-
if (
|
|
1123
|
+
if (envBoolean(envVars, "auditableItemStreamEnabled", false)) {
|
|
1025
1124
|
coreConfig.types.auditableItemStreamComponent ??= [];
|
|
1026
1125
|
coreConfig.types.auditableItemStreamComponent.push({
|
|
1027
1126
|
type: AuditableItemStreamComponentType.Service,
|
|
1028
1127
|
options: {
|
|
1029
1128
|
config: {
|
|
1030
|
-
mutexTimeoutMs:
|
|
1129
|
+
mutexTimeoutMs: envMs(envVars, "auditableItemStreamMutexTimeout")
|
|
1031
1130
|
}
|
|
1032
1131
|
}
|
|
1033
1132
|
});
|
|
@@ -1040,7 +1139,7 @@ async function configureAuditableItemStream(coreConfig, envVars) {
|
|
|
1040
1139
|
* @returns A promise that resolves when the data processing configuration has been applied.
|
|
1041
1140
|
*/
|
|
1042
1141
|
async function configureDataProcessing(coreConfig, envVars) {
|
|
1043
|
-
if (
|
|
1142
|
+
if (envBoolean(envVars, "dataProcessingEnabled", false)) {
|
|
1044
1143
|
coreConfig.types.dataProcessingComponent ??= [];
|
|
1045
1144
|
coreConfig.types.dataProcessingComponent.push({ type: DataProcessingComponentType.Service });
|
|
1046
1145
|
coreConfig.types.dataConverterConnector ??= [];
|
|
@@ -1066,13 +1165,13 @@ async function configureDataProcessing(coreConfig, envVars) {
|
|
|
1066
1165
|
* @returns A promise that resolves when the document management configuration has been applied.
|
|
1067
1166
|
*/
|
|
1068
1167
|
async function configureDocumentManagement(coreConfig, envVars) {
|
|
1069
|
-
if (
|
|
1168
|
+
if (envBoolean(envVars, "documentManagementEnabled", false)) {
|
|
1070
1169
|
coreConfig.types.documentManagementComponent ??= [];
|
|
1071
1170
|
coreConfig.types.documentManagementComponent.push({
|
|
1072
1171
|
type: DocumentManagementComponentType.Service,
|
|
1073
1172
|
options: {
|
|
1074
1173
|
config: {
|
|
1075
|
-
mutexTimeoutMs:
|
|
1174
|
+
mutexTimeoutMs: envMs(envVars, "documentManagementMutexTimeout")
|
|
1076
1175
|
}
|
|
1077
1176
|
}
|
|
1078
1177
|
});
|
|
@@ -1098,7 +1197,7 @@ async function configureTrust(coreConfig, envVars) {
|
|
|
1098
1197
|
options: {
|
|
1099
1198
|
config: {
|
|
1100
1199
|
verificationMethodId: envVars.trustVerificationMethodId ?? "",
|
|
1101
|
-
tokenTtlInSeconds:
|
|
1200
|
+
tokenTtlInSeconds: envCount(envVars, "trustJwtTtl")
|
|
1102
1201
|
}
|
|
1103
1202
|
}
|
|
1104
1203
|
});
|
|
@@ -1183,7 +1282,7 @@ async function configureRightsManagement(coreConfig, envVars) {
|
|
|
1183
1282
|
config: {
|
|
1184
1283
|
callbackPath: rightsManagementPath,
|
|
1185
1284
|
includeErrorDetails: coreConfig.debug ?? false,
|
|
1186
|
-
mutexTimeoutMs:
|
|
1285
|
+
mutexTimeoutMs: envMs(envVars, "rightsManagementMutexTimeout")
|
|
1187
1286
|
}
|
|
1188
1287
|
},
|
|
1189
1288
|
isDefault: true
|
|
@@ -1193,7 +1292,7 @@ async function configureRightsManagement(coreConfig, envVars) {
|
|
|
1193
1292
|
type: RightsManagementPnapComponentType.Service,
|
|
1194
1293
|
options: {
|
|
1195
1294
|
config: {
|
|
1196
|
-
mutexTimeoutMs:
|
|
1295
|
+
mutexTimeoutMs: envMs(envVars, "rightsManagementMutexTimeout")
|
|
1197
1296
|
}
|
|
1198
1297
|
}
|
|
1199
1298
|
});
|
|
@@ -1276,7 +1375,7 @@ async function configureFederatedCatalogue(coreConfig, envVars) {
|
|
|
1276
1375
|
type: FederatedCatalogueComponentType.RestClient,
|
|
1277
1376
|
options: {
|
|
1278
1377
|
endpoint: envVars.federatedCatalogueRemoteEndpoint,
|
|
1279
|
-
pathPrefix: envVars.federatedCatalogueRestClientPathPrefix ?? "
|
|
1378
|
+
pathPrefix: envVars.federatedCatalogueRestClientPathPrefix ?? "catalog"
|
|
1280
1379
|
}
|
|
1281
1380
|
});
|
|
1282
1381
|
}
|
|
@@ -1285,7 +1384,7 @@ async function configureFederatedCatalogue(coreConfig, envVars) {
|
|
|
1285
1384
|
type: FederatedCatalogueComponentType.Service,
|
|
1286
1385
|
options: {
|
|
1287
1386
|
config: {
|
|
1288
|
-
mutexTimeoutMs:
|
|
1387
|
+
mutexTimeoutMs: envMs(envVars, "federatedCatalogueMutexTimeout")
|
|
1289
1388
|
}
|
|
1290
1389
|
}
|
|
1291
1390
|
});
|
|
@@ -1307,7 +1406,7 @@ async function configureFederatedCatalogue(coreConfig, envVars) {
|
|
|
1307
1406
|
* @returns A promise that resolves when the dataspace configuration has been applied.
|
|
1308
1407
|
*/
|
|
1309
1408
|
async function configureDataspace(coreConfig, envVars) {
|
|
1310
|
-
if (
|
|
1409
|
+
if (envBoolean(envVars, "dataspaceEnabled", false)) {
|
|
1311
1410
|
coreConfig.types.dataspaceControlPlaneComponent ??= [];
|
|
1312
1411
|
// We add a multi instance REST client for remote/consumer-initiated transfers.
|
|
1313
1412
|
coreConfig.types.dataspaceControlPlaneComponent.push({
|
|
@@ -1318,8 +1417,6 @@ async function configureDataspace(coreConfig, envVars) {
|
|
|
1318
1417
|
isMultiInstance: true,
|
|
1319
1418
|
features: ["remote"]
|
|
1320
1419
|
});
|
|
1321
|
-
const stalledNegotiationTimeout = Coerce.integer(envVars.dataspaceStalledNegotiationTimeout);
|
|
1322
|
-
const stalledTransferTimeout = Coerce.integer(envVars.dataspaceStalledTransferTimeout);
|
|
1323
1420
|
coreConfig.types.dataspaceControlPlaneComponent.push({
|
|
1324
1421
|
type: DataspaceControlPlaneComponentType.Service,
|
|
1325
1422
|
options: {
|
|
@@ -1330,30 +1427,29 @@ async function configureDataspace(coreConfig, envVars) {
|
|
|
1330
1427
|
// Base mount path of the data plane only; the transfer handlers append the
|
|
1331
1428
|
// sub-paths themselves (`/entities` for PULL, `/inbox` for PUSH).
|
|
1332
1429
|
dataPlanePath: envVars.dataspaceDataPlanePath,
|
|
1333
|
-
autoStartTransfers:
|
|
1334
|
-
stalledNegotiationTimeoutMs:
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
? stalledTransferTimeout * 1000
|
|
1339
|
-
: undefined
|
|
1430
|
+
autoStartTransfers: envBoolean(envVars, "dataspaceAutoStartTransfers", false),
|
|
1431
|
+
stalledNegotiationTimeoutMs: envSecToMs(envVars, "dataspaceStalledNegotiationTimeout"),
|
|
1432
|
+
stalledTransferTimeoutMs: envSecToMs(envVars, "dataspaceStalledTransferTimeout"),
|
|
1433
|
+
providerTransferIdleTimeoutMs: envSecToMs(envVars, "dataspaceProviderTransferIdleTimeout"),
|
|
1434
|
+
providerTransferPolicySweepIntervalMs: envSecToMs(envVars, "dataspaceProviderTransferPolicySweepInterval")
|
|
1340
1435
|
}
|
|
1341
1436
|
},
|
|
1342
1437
|
isDefault: true
|
|
1343
1438
|
});
|
|
1344
|
-
const retainActivityLogsFor = Coerce.integer(envVars.dataspaceRetainActivityLogsFor);
|
|
1345
|
-
const activityLogsCleanUpInterval = Coerce.integer(envVars.dataspaceActivityLogsCleanupInterval);
|
|
1346
1439
|
coreConfig.types.dataspaceDataPlaneComponent ??= [];
|
|
1347
1440
|
coreConfig.types.dataspaceDataPlaneComponent.push({
|
|
1348
1441
|
type: DataspaceDataPlaneComponentType.Service,
|
|
1349
1442
|
options: {
|
|
1350
1443
|
config: {
|
|
1351
|
-
retainActivityLogsForMs:
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1444
|
+
retainActivityLogsForMs: envSecToMs(envVars, "dataspaceRetainActivityLogsFor"),
|
|
1445
|
+
activityLogsCleanUpIntervalMs: envSecToMs(envVars, "dataspaceActivityLogsCleanupInterval"),
|
|
1446
|
+
retryCount: envCount(envVars, "dataspaceRetryCount"),
|
|
1447
|
+
pushRetryCount: envCount(envVars, "dataspacePushRetryCount"),
|
|
1448
|
+
pushRetryBaseDelayMs: envMs(envVars, "dataspacePushRetryBaseDelay"),
|
|
1449
|
+
pushTimeoutMs: envMs(envVars, "dataspacePushTimeout"),
|
|
1450
|
+
pushSubscriptionCleanupIntervalMs: envMs(envVars, "dataspacePushSubscriptionCleanupInterval"),
|
|
1451
|
+
agreementCacheTtlMs: envMs(envVars, "dataspaceAgreementCacheTtl"),
|
|
1452
|
+
agreementCacheMutexTimeoutMs: envMs(envVars, "dataspaceAgreementCacheMutexTimeout")
|
|
1357
1453
|
}
|
|
1358
1454
|
}
|
|
1359
1455
|
});
|
|
@@ -1385,26 +1481,15 @@ async function configureDlt(coreConfig, envVars) {
|
|
|
1385
1481
|
url: envVars.iotaNodeEndpoint ?? ""
|
|
1386
1482
|
},
|
|
1387
1483
|
network: envVars.iotaNetwork ?? "",
|
|
1388
|
-
coinType:
|
|
1484
|
+
coinType: envCount(envVars, "iotaCoinType"),
|
|
1389
1485
|
gasStation: gasStationConfig,
|
|
1390
|
-
gasBudget:
|
|
1391
|
-
gasReservationDuration:
|
|
1486
|
+
gasBudget: envCount(envVars, "iotaGasBudget"),
|
|
1487
|
+
gasReservationDuration: envSeconds(envVars, "iotaGasReservationDuration")
|
|
1392
1488
|
}
|
|
1393
1489
|
}
|
|
1394
1490
|
});
|
|
1395
1491
|
}
|
|
1396
1492
|
}
|
|
1397
|
-
/**
|
|
1398
|
-
* Converts a comma separated list to an array.
|
|
1399
|
-
* @param value The comma separated list.
|
|
1400
|
-
* @returns The array.
|
|
1401
|
-
*/
|
|
1402
|
-
function commaSeparatedListToArray(value) {
|
|
1403
|
-
return (value ?? "")
|
|
1404
|
-
.split(",")
|
|
1405
|
-
.map(item => item.trim())
|
|
1406
|
-
.filter(item => item.length > 0);
|
|
1407
|
-
}
|
|
1408
1493
|
/**
|
|
1409
1494
|
* Checks if the trust subsystem is required.
|
|
1410
1495
|
* Returns true when any component that depends on the trust subsystem is enabled.
|
|
@@ -1413,7 +1498,7 @@ function commaSeparatedListToArray(value) {
|
|
|
1413
1498
|
*/
|
|
1414
1499
|
export function isTrustRequired(envVars) {
|
|
1415
1500
|
return (isRightsManagementRequired(envVars) ||
|
|
1416
|
-
(
|
|
1501
|
+
envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1417
1502
|
isFederatedCatalogueRequired(envVars));
|
|
1418
1503
|
}
|
|
1419
1504
|
/**
|
|
@@ -1423,7 +1508,7 @@ export function isTrustRequired(envVars) {
|
|
|
1423
1508
|
* @returns True if dataspace or verifiable storage is enabled.
|
|
1424
1509
|
*/
|
|
1425
1510
|
export function isBackgroundTasksRequired(envVars) {
|
|
1426
|
-
return (
|
|
1511
|
+
return envBoolean(envVars, "dataspaceEnabled", false) || isImmutableProofRequired(envVars);
|
|
1427
1512
|
}
|
|
1428
1513
|
/**
|
|
1429
1514
|
* Checks if the immutable proof subsystem is required.
|
|
@@ -1432,9 +1517,9 @@ export function isBackgroundTasksRequired(envVars) {
|
|
|
1432
1517
|
* @returns True if verifiable storage is enabled.
|
|
1433
1518
|
*/
|
|
1434
1519
|
export function isImmutableProofRequired(envVars) {
|
|
1435
|
-
return ((
|
|
1436
|
-
(
|
|
1437
|
-
(
|
|
1520
|
+
return (envBoolean(envVars, "auditableItemGraphEnabled", false) ||
|
|
1521
|
+
envBoolean(envVars, "auditableItemStreamEnabled", false) ||
|
|
1522
|
+
envBoolean(envVars, "documentManagementEnabled", false));
|
|
1438
1523
|
}
|
|
1439
1524
|
/**
|
|
1440
1525
|
* Checks if the federated catalogue subsystem is required.
|
|
@@ -1443,10 +1528,10 @@ export function isImmutableProofRequired(envVars) {
|
|
|
1443
1528
|
* @returns True if the federated catalogue is required.
|
|
1444
1529
|
*/
|
|
1445
1530
|
export function isFederatedCatalogueRequired(envVars) {
|
|
1446
|
-
return ((
|
|
1531
|
+
return (envBoolean(envVars, "federatedCatalogueEnabled", false) ||
|
|
1447
1532
|
Is.stringValue(envVars.federatedCatalogueRemoteEndpoint) ||
|
|
1448
1533
|
Is.stringValue(envVars.federatedCatalogueFilters) ||
|
|
1449
|
-
(
|
|
1534
|
+
envBoolean(envVars, "dataspaceEnabled", false));
|
|
1450
1535
|
}
|
|
1451
1536
|
/**
|
|
1452
1537
|
* Checks if the rights management subsystem is required.
|
|
@@ -1458,7 +1543,7 @@ export function isFederatedCatalogueRequired(envVars) {
|
|
|
1458
1543
|
* @returns True if rights management is enabled.
|
|
1459
1544
|
*/
|
|
1460
1545
|
export function isRightsManagementRequired(envVars) {
|
|
1461
|
-
return
|
|
1546
|
+
return envBoolean(envVars, "dataspaceEnabled", false);
|
|
1462
1547
|
}
|
|
1463
1548
|
/**
|
|
1464
1549
|
* Checks if the task scheduler subsystem is required.
|
|
@@ -1467,10 +1552,11 @@ export function isRightsManagementRequired(envVars) {
|
|
|
1467
1552
|
* @returns True if task scheduler is enabled.
|
|
1468
1553
|
*/
|
|
1469
1554
|
export function isTaskSchedulerRequired(envVars) {
|
|
1470
|
-
return ((
|
|
1471
|
-
(
|
|
1555
|
+
return (envBoolean(envVars, "taskSchedulerEnabled", false) ||
|
|
1556
|
+
envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1472
1557
|
isRightsManagementRequired(envVars) ||
|
|
1473
|
-
isAuthEntityStorageRequired(envVars)
|
|
1558
|
+
isAuthEntityStorageRequired(envVars) ||
|
|
1559
|
+
isImmutableProofRequired(envVars));
|
|
1474
1560
|
}
|
|
1475
1561
|
/**
|
|
1476
1562
|
* Checks if the automation subsystem is required.
|