@twin.org/node 0.0.3-next.53 → 0.0.3-next.54
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/locales/en.json +9 -6
- package/docs/changelog.md +14 -0
- package/docs/open-api/spec.json +111 -8
- package/docs/usage.md +91 -51
- package/package.json +2 -2
package/dist/locales/en.json
CHANGED
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"bootstrapLegacy": {
|
|
20
20
|
"noFeaturesEnabled": "No features are enabled in legacy bootstrap mode, at least one feature must be enabled.",
|
|
21
|
-
"organizationNotSet": "The organisation identity has not been set. Run
|
|
21
|
+
"organizationNotSet": "The organisation identity has not been set. Run \"set-node-org-id\"."
|
|
22
22
|
},
|
|
23
23
|
"identityCreate": {
|
|
24
24
|
"invalidMnemonic": "The mnemonic is invalid, it should be 24 words from the standard wordlist.",
|
|
25
|
+
"onlyOneAssignmentOptionAllowed": "Only one of node-id, node-organization-id, or tenant-organization-id can be set at the same time.",
|
|
25
26
|
"nodeOrganizationIdNotAvailableInMultiTenantMode": "The node-organization-id option is not available in multi-tenant mode, use tenant-organization-id instead."
|
|
26
27
|
},
|
|
27
28
|
"identityImport": {
|
|
@@ -1376,14 +1377,12 @@
|
|
|
1376
1377
|
"nodeIdentityCreate": "Creating node identity",
|
|
1377
1378
|
"nodeAuthKeyCreate": "Creating node auth key",
|
|
1378
1379
|
"trustVerificationMethodCreate": "Creating trust verification method for organisation identity",
|
|
1379
|
-
"nodeIdentitySet": "Setting node identity",
|
|
1380
1380
|
"nodeTenantCreate": "Creating node tenant",
|
|
1381
1381
|
"organisationCreate": "Creating organisation identity",
|
|
1382
1382
|
"blobStorageKeyCreate": "Creating blob storage encryption key for organisation identity",
|
|
1383
1383
|
"attestationMethodCreate": "Creating attestation method for organisation identity",
|
|
1384
1384
|
"immutableProofMethodCreate": "Creating immutable proof method for organisation identity",
|
|
1385
1385
|
"nodeOrganizationIdSet": "Setting node organisation ID",
|
|
1386
|
-
"tenantOrganizationIdSet": "Setting tenant organisation ID",
|
|
1387
1386
|
"adminIdentityCreate": "Creating admin user identity",
|
|
1388
1387
|
"adminUserCreate": "Creating admin user",
|
|
1389
1388
|
"tenantFallback": "No Node-labelled tenant found; using first available tenant"
|
|
@@ -1420,6 +1419,9 @@
|
|
|
1420
1419
|
"output-env-prefix": {
|
|
1421
1420
|
"description": "Prefix to use for variables in the output .env file."
|
|
1422
1421
|
},
|
|
1422
|
+
"node-id": {
|
|
1423
|
+
"description": "If true, set the created identity DID as the node identity."
|
|
1424
|
+
},
|
|
1423
1425
|
"node-organization-id": {
|
|
1424
1426
|
"description": "If true, set the created identity DID as the node organization ID (not available in multi-tenant mode)."
|
|
1425
1427
|
},
|
|
@@ -1432,12 +1434,12 @@
|
|
|
1432
1434
|
"processingMnemonic": "Processing mnemonic",
|
|
1433
1435
|
"readingMnemonic": "Reading mnemonic",
|
|
1434
1436
|
"storingMnemonic": "Storing mnemonic",
|
|
1435
|
-
"existingMnemonic": "Mnemonic already exists",
|
|
1437
|
+
"existingMnemonic": "Mnemonic already exists, skipping creation",
|
|
1436
1438
|
"noExistingMnemonic": "No existing mnemonic found",
|
|
1437
1439
|
"generatingMnemonic": "Generating mnemonic",
|
|
1438
1440
|
"processingIdentity": "Processing identity",
|
|
1439
1441
|
"resolvingIdentity": "Resolving identity",
|
|
1440
|
-
"existingIdentity": "Identity already exists",
|
|
1442
|
+
"existingIdentity": "Identity already exists, skipping creation",
|
|
1441
1443
|
"noIdentityFound": "No identity found",
|
|
1442
1444
|
"creatingIdentity": "Creating identity",
|
|
1443
1445
|
"createdIdentity": "Created identity",
|
|
@@ -1614,7 +1616,8 @@
|
|
|
1614
1616
|
},
|
|
1615
1617
|
"labels": {
|
|
1616
1618
|
"resolvingIdentity": "Resolving identity",
|
|
1617
|
-
"stored": "The node identity has been stored"
|
|
1619
|
+
"stored": "The node identity has been stored",
|
|
1620
|
+
"skipping": "The node identity has not changed, skipping"
|
|
1618
1621
|
}
|
|
1619
1622
|
},
|
|
1620
1623
|
"tenant-create": {
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.54](https://github.com/iotaledger/twin-node/compare/node-v0.0.3-next.53...node-v0.0.3-next.54) (2026-06-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* improved cli commands ([#206](https://github.com/iotaledger/twin-node/issues/206)) ([cf00850](https://github.com/iotaledger/twin-node/commit/cf0085023a66e187aaaaf3889128c845c73a1faf))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/node-core bumped from 0.0.3-next.53 to 0.0.3-next.54
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.53](https://github.com/iotaledger/twin-node/compare/node-v0.0.3-next.52...node-v0.0.3-next.53) (2026-06-11)
|
|
4
18
|
|
|
5
19
|
|
package/docs/open-api/spec.json
CHANGED
|
@@ -18243,9 +18243,17 @@
|
|
|
18243
18243
|
"papQueryResponseExample": {
|
|
18244
18244
|
"value": [
|
|
18245
18245
|
{
|
|
18246
|
-
"@context":
|
|
18246
|
+
"@context": [
|
|
18247
|
+
"http://www.w3.org/ns/odrl.jsonld",
|
|
18248
|
+
{
|
|
18249
|
+
"dateCreated": "https://schema.org/dateCreated",
|
|
18250
|
+
"dateModified": "https://schema.org/dateModified"
|
|
18251
|
+
}
|
|
18252
|
+
],
|
|
18247
18253
|
"@type": "Set",
|
|
18248
18254
|
"@id": "urn:rights-management:abc123def456",
|
|
18255
|
+
"dateCreated": "2025-09-03T00:00:00.000Z",
|
|
18256
|
+
"dateModified": "2025-09-03T00:00:00.000Z",
|
|
18249
18257
|
"permission": [
|
|
18250
18258
|
{
|
|
18251
18259
|
"target": "http://example.com/asset/1",
|
|
@@ -18468,9 +18476,17 @@
|
|
|
18468
18476
|
"examples": {
|
|
18469
18477
|
"papGetResponseExample": {
|
|
18470
18478
|
"value": {
|
|
18471
|
-
"@context":
|
|
18479
|
+
"@context": [
|
|
18480
|
+
"http://www.w3.org/ns/odrl.jsonld",
|
|
18481
|
+
{
|
|
18482
|
+
"dateCreated": "https://schema.org/dateCreated",
|
|
18483
|
+
"dateModified": "https://schema.org/dateModified"
|
|
18484
|
+
}
|
|
18485
|
+
],
|
|
18472
18486
|
"@type": "Set",
|
|
18473
18487
|
"@id": "urn:rights-management:abc123def456",
|
|
18488
|
+
"dateCreated": "2025-09-03T00:00:00.000Z",
|
|
18489
|
+
"dateModified": "2025-09-03T00:00:00.000Z",
|
|
18474
18490
|
"permission": [
|
|
18475
18491
|
{
|
|
18476
18492
|
"target": "http://example.com/asset/1",
|
|
@@ -18661,14 +18677,22 @@
|
|
|
18661
18677
|
"content": {
|
|
18662
18678
|
"application/json": {
|
|
18663
18679
|
"schema": {
|
|
18664
|
-
"$ref": "
|
|
18680
|
+
"$ref": "#/components/schemas/RightsManagementAgreement"
|
|
18665
18681
|
},
|
|
18666
18682
|
"examples": {
|
|
18667
18683
|
"papGetResponseExample": {
|
|
18668
18684
|
"value": {
|
|
18669
|
-
"@context":
|
|
18685
|
+
"@context": [
|
|
18686
|
+
"http://www.w3.org/ns/odrl.jsonld",
|
|
18687
|
+
{
|
|
18688
|
+
"dateCreated": "https://schema.org/dateCreated",
|
|
18689
|
+
"dateModified": "https://schema.org/dateModified"
|
|
18690
|
+
}
|
|
18691
|
+
],
|
|
18670
18692
|
"@type": "Agreement",
|
|
18671
18693
|
"@id": "urn:rights-management:abc123def456",
|
|
18694
|
+
"dateCreated": "2025-09-03T00:00:00.000Z",
|
|
18695
|
+
"dateModified": "2025-09-03T00:00:00.000Z",
|
|
18672
18696
|
"permission": [
|
|
18673
18697
|
{
|
|
18674
18698
|
"target": "http://example.com/asset/1",
|
|
@@ -18774,14 +18798,22 @@
|
|
|
18774
18798
|
"content": {
|
|
18775
18799
|
"application/json": {
|
|
18776
18800
|
"schema": {
|
|
18777
|
-
"$ref": "
|
|
18801
|
+
"$ref": "#/components/schemas/RightsManagementOffer"
|
|
18778
18802
|
},
|
|
18779
18803
|
"examples": {
|
|
18780
18804
|
"papGetResponseExample": {
|
|
18781
18805
|
"value": {
|
|
18782
|
-
"@context":
|
|
18806
|
+
"@context": [
|
|
18807
|
+
"http://www.w3.org/ns/odrl.jsonld",
|
|
18808
|
+
{
|
|
18809
|
+
"dateCreated": "https://schema.org/dateCreated",
|
|
18810
|
+
"dateModified": "https://schema.org/dateModified"
|
|
18811
|
+
}
|
|
18812
|
+
],
|
|
18783
18813
|
"@type": "Offer",
|
|
18784
18814
|
"@id": "urn:rights-management:abc123def456",
|
|
18815
|
+
"dateCreated": "2025-09-03T00:00:00.000Z",
|
|
18816
|
+
"dateModified": "2025-09-03T00:00:00.000Z",
|
|
18785
18817
|
"permission": [
|
|
18786
18818
|
{
|
|
18787
18819
|
"target": "http://example.com/asset/1",
|
|
@@ -18887,14 +18919,22 @@
|
|
|
18887
18919
|
"content": {
|
|
18888
18920
|
"application/json": {
|
|
18889
18921
|
"schema": {
|
|
18890
|
-
"$ref": "
|
|
18922
|
+
"$ref": "#/components/schemas/RightsManagementSet"
|
|
18891
18923
|
},
|
|
18892
18924
|
"examples": {
|
|
18893
18925
|
"papGetResponseExample": {
|
|
18894
18926
|
"value": {
|
|
18895
|
-
"@context":
|
|
18927
|
+
"@context": [
|
|
18928
|
+
"http://www.w3.org/ns/odrl.jsonld",
|
|
18929
|
+
{
|
|
18930
|
+
"dateCreated": "https://schema.org/dateCreated",
|
|
18931
|
+
"dateModified": "https://schema.org/dateModified"
|
|
18932
|
+
}
|
|
18933
|
+
],
|
|
18896
18934
|
"@type": "Set",
|
|
18897
18935
|
"@id": "urn:rights-management:abc123def456",
|
|
18936
|
+
"dateCreated": "2025-09-03T00:00:00.000Z",
|
|
18937
|
+
"dateModified": "2025-09-03T00:00:00.000Z",
|
|
18898
18938
|
"permission": [
|
|
18899
18939
|
{
|
|
18900
18940
|
"target": "http://example.com/asset/1",
|
|
@@ -22595,6 +22635,14 @@
|
|
|
22595
22635
|
"description": "The body of the request - the policy to create (id will be auto-generated if not provided).",
|
|
22596
22636
|
"type": "object",
|
|
22597
22637
|
"properties": {
|
|
22638
|
+
"dateCreated": {
|
|
22639
|
+
"type": "string",
|
|
22640
|
+
"description": "schema.org dateCreated — ISO 8601 date-time set by PAP on create."
|
|
22641
|
+
},
|
|
22642
|
+
"dateModified": {
|
|
22643
|
+
"type": "string",
|
|
22644
|
+
"description": "schema.org dateModified — ISO 8601 date-time set by PAP on create and update."
|
|
22645
|
+
},
|
|
22598
22646
|
"@context": {
|
|
22599
22647
|
"$ref": "https://schema.twindev.org/w3c-odrl/OdrlContextType"
|
|
22600
22648
|
},
|
|
@@ -22971,6 +23019,30 @@
|
|
|
22971
23019
|
],
|
|
22972
23020
|
"description": "Transfer Process (DSP compliant) with state REQUESTED, or error."
|
|
22973
23021
|
},
|
|
23022
|
+
"RightsManagementAgreement": {
|
|
23023
|
+
"description": "Agreement policy returned by PAP, including optional PAP-managed lifecycle metadata.",
|
|
23024
|
+
"type": "object",
|
|
23025
|
+
"allOf": [
|
|
23026
|
+
{
|
|
23027
|
+
"$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolAgreement"
|
|
23028
|
+
},
|
|
23029
|
+
{
|
|
23030
|
+
"$ref": "#/components/schemas/RightsManagementPolicyMetadata"
|
|
23031
|
+
}
|
|
23032
|
+
]
|
|
23033
|
+
},
|
|
23034
|
+
"RightsManagementOffer": {
|
|
23035
|
+
"description": "Offer policy returned by PAP, including optional PAP-managed lifecycle metadata.",
|
|
23036
|
+
"type": "object",
|
|
23037
|
+
"allOf": [
|
|
23038
|
+
{
|
|
23039
|
+
"$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolOffer"
|
|
23040
|
+
},
|
|
23041
|
+
{
|
|
23042
|
+
"$ref": "#/components/schemas/RightsManagementPolicyMetadata"
|
|
23043
|
+
}
|
|
23044
|
+
]
|
|
23045
|
+
},
|
|
22974
23046
|
"RightsManagementPolicy": {
|
|
22975
23047
|
"description": "Base type for any ODRL policy stored and managed by the TWIN rights-management PAP.",
|
|
22976
23048
|
"type": "object",
|
|
@@ -23183,6 +23255,37 @@
|
|
|
23183
23255
|
"@context",
|
|
23184
23256
|
"@id",
|
|
23185
23257
|
"@type"
|
|
23258
|
+
],
|
|
23259
|
+
"allOf": [
|
|
23260
|
+
{
|
|
23261
|
+
"$ref": "#/components/schemas/RightsManagementPolicyMetadata"
|
|
23262
|
+
}
|
|
23263
|
+
]
|
|
23264
|
+
},
|
|
23265
|
+
"RightsManagementPolicyMetadata": {
|
|
23266
|
+
"description": "PAP-managed metadata attached to stored and returned ODRL policies.",
|
|
23267
|
+
"type": "object",
|
|
23268
|
+
"properties": {
|
|
23269
|
+
"dateCreated": {
|
|
23270
|
+
"type": "string",
|
|
23271
|
+
"description": "schema.org dateCreated — ISO 8601 date-time set by PAP on create."
|
|
23272
|
+
},
|
|
23273
|
+
"dateModified": {
|
|
23274
|
+
"type": "string",
|
|
23275
|
+
"description": "schema.org dateModified — ISO 8601 date-time set by PAP on create and update."
|
|
23276
|
+
}
|
|
23277
|
+
}
|
|
23278
|
+
},
|
|
23279
|
+
"RightsManagementSet": {
|
|
23280
|
+
"description": "Set policy returned by PAP, including optional PAP-managed lifecycle metadata.",
|
|
23281
|
+
"type": "object",
|
|
23282
|
+
"allOf": [
|
|
23283
|
+
{
|
|
23284
|
+
"$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolSet"
|
|
23285
|
+
},
|
|
23286
|
+
{
|
|
23287
|
+
"$ref": "#/components/schemas/RightsManagementPolicyMetadata"
|
|
23288
|
+
}
|
|
23186
23289
|
]
|
|
23187
23290
|
},
|
|
23188
23291
|
"Rule": {
|
package/docs/usage.md
CHANGED
|
@@ -44,6 +44,45 @@ vault-key-create: Create a vault key for an identity
|
|
|
44
44
|
vault-key-import: Import a vault key for an identity
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
## Server Configuration
|
|
48
|
+
|
|
49
|
+
Key environment variables that control how the node server handles authentication. A full reference is in the `.env` example files.
|
|
50
|
+
|
|
51
|
+
| Variable | Default | Description |
|
|
52
|
+
| -------------------------- | -------------- | ---------------------------------------------- |
|
|
53
|
+
| `TWIN_AUTH_API_KEY_HEADER` | `x-api-key` | HTTP header name for the API key on requests. |
|
|
54
|
+
| `TWIN_AUTH_SIGNING_KEY_ID` | `auth-signing` | Vault key ID used to sign authentication JWTs. |
|
|
55
|
+
|
|
56
|
+
## bootstrap-legacy --help
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
bootstrap-legacy: Bootstrap in legacy mode for backwards compatibility, **will be deprecated in future versions**
|
|
60
|
+
|
|
61
|
+
env-prefix: (string, optional)
|
|
62
|
+
Prefix to use for standard .env files e.g. TWIN_.
|
|
63
|
+
|
|
64
|
+
load-env: (string, optional)
|
|
65
|
+
Comma separated list of paths to .env files to read input parameters from.
|
|
66
|
+
|
|
67
|
+
Example: bootstrap-legacy --load-env=".env.bootstrap-legacy"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The command reads the following environment variables (use `load-env` to supply them from a file):
|
|
71
|
+
|
|
72
|
+
| Variable | Default | Description |
|
|
73
|
+
| ---------------------------- | ------------------------------ | --------------------------------------------------------------------------- |
|
|
74
|
+
| `TWIN_NODE_IDENTITY` | generated | The DID of the node identity. |
|
|
75
|
+
| `TWIN_NODE_MNEMONIC` | randomly generated | The Bip39 mnemonic for the node identity seed. |
|
|
76
|
+
| `TWIN_FEATURES` | `admin-user,wallet` | Comma-separated feature flags: `admin-user`, `wallet`. |
|
|
77
|
+
| `TWIN_ORGANIZATION_IDENTITY` | generated | The DID to use for the organisation identity. |
|
|
78
|
+
| `TWIN_ORGANIZATION_MNEMONIC` | randomly generated | The Bip39 mnemonic for the organisation identity seed. |
|
|
79
|
+
| `TWIN_TENANT_ID` | generated | The tenant ID for the node tenant (multi-tenant only). |
|
|
80
|
+
| `TWIN_TENANT_API_KEY` | generated | The API key for the node tenant (multi-tenant only). |
|
|
81
|
+
| `TWIN_ADMIN_USER_IDENTITY` | generated | The DID for the admin user identity (`admin-user` feature). |
|
|
82
|
+
| `TWIN_ADMIN_USER_MNEMONIC` | randomly generated | The Bip39 mnemonic for the admin user identity seed (`admin-user` feature). |
|
|
83
|
+
| `TWIN_ADMIN_USER_NAME` | `admin@node` or `admin@tenant` | The email/username for the admin user (`admin-user` feature). |
|
|
84
|
+
| `TWIN_ADMIN_USER_PASSWORD` | randomly generated | The password for the admin user (`admin-user` feature). |
|
|
85
|
+
|
|
47
86
|
## identity-create --help
|
|
48
87
|
|
|
49
88
|
```text
|
|
@@ -76,145 +115,146 @@ Path to a .env file to store the command output.
|
|
|
76
115
|
output-env-prefix: (string, optional)
|
|
77
116
|
Prefix to use for variables in the output .env file.
|
|
78
117
|
|
|
118
|
+
node-id: (boolean, default: 'false', optional)
|
|
119
|
+
If true, set the created identity DID as the node identity.
|
|
120
|
+
|
|
121
|
+
node-organization-id: (boolean, default: 'false', optional)
|
|
122
|
+
If true, set the created identity DID as the node organization ID (not available in multi-tenant mode).
|
|
123
|
+
|
|
124
|
+
tenant-organization-id: (string, hex(32), optional)
|
|
125
|
+
The tenant ID to set the created identity DID as the organization ID for (requires multi-tenant mode).
|
|
126
|
+
|
|
79
127
|
Example: identity-create --mnemonic="..." --fund-wallet=true
|
|
80
128
|
```
|
|
81
129
|
|
|
82
130
|
## Example
|
|
83
131
|
|
|
84
|
-
### Bootstrap legacy
|
|
132
|
+
### Bootstrap legacy (single command)
|
|
133
|
+
|
|
134
|
+
Runs the complete bootstrap sequence in one step using values from `.env.bootstrap-legacy`:
|
|
85
135
|
|
|
86
136
|
```shell
|
|
87
137
|
twin-node bootstrap-legacy --load-env=".env.bootstrap-legacy"
|
|
88
138
|
```
|
|
89
139
|
|
|
90
|
-
|
|
140
|
+
The sections below show the equivalent step-by-step commands that replicate the bootstrap-legacy process.
|
|
91
141
|
|
|
92
|
-
|
|
93
|
-
twin-node identity-create --fund-wallet=true --output-json="node-identity.json" --output-env="node-identity.env" --output-env-prefix=node
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Import existing identity details
|
|
142
|
+
---
|
|
97
143
|
|
|
98
|
-
|
|
99
|
-
twin-node identity-import --load-env="my-identity.env" --identity=!MY_DID --mnemonic=!MY_MNEMONIC
|
|
100
|
-
```
|
|
144
|
+
### Step 1 - Create the node identity and associate it with the node
|
|
101
145
|
|
|
102
|
-
|
|
146
|
+
Supply `--fund-wallet=true` when the `wallet` feature is enabled. `--node-id=true` sets the created identity as the node identity in the same step.
|
|
103
147
|
|
|
104
148
|
```shell
|
|
105
|
-
twin-node node-
|
|
149
|
+
twin-node identity-create --node-id=true --fund-wallet=true --output-json="node-identity.json" --output-env="node-identity.env" --output-env-prefix=node
|
|
106
150
|
```
|
|
107
151
|
|
|
108
|
-
###
|
|
152
|
+
### Step 2 - Create the authentication signing key for the node
|
|
109
153
|
|
|
110
154
|
```shell
|
|
111
|
-
twin-node vault-key-create --load-env="node-identity.env" --identity=!NODE_DID --key-id=!TWIN_AUTH_SIGNING_KEY_ID --output-json="node-auth-key.json" --output-env="node-auth-key.env"
|
|
155
|
+
twin-node vault-key-create --load-env="node-identity.env" --identity=!NODE_DID --key-type=Ed25519 --key-id=!TWIN_AUTH_SIGNING_KEY_ID --overwrite-mode=skip --output-json="node-auth-key.json" --output-env="node-auth-key.env"
|
|
112
156
|
```
|
|
113
157
|
|
|
114
|
-
|
|
158
|
+
To import an existing authentication signing key instead:
|
|
115
159
|
|
|
116
160
|
```shell
|
|
117
161
|
twin-node vault-key-import --load-env="node-identity.env,node-auth-key.json" --identity=!NODE_DID --key-id=!TWIN_AUTH_SIGNING_KEY_ID --key-type=!KEY_TYPE --private-key-hex=!PRIVATE_KEY_HEX
|
|
118
162
|
```
|
|
119
163
|
|
|
120
|
-
###
|
|
164
|
+
### Step 3 - Create the organisation identity
|
|
121
165
|
|
|
122
166
|
```shell
|
|
123
|
-
twin-node
|
|
167
|
+
twin-node identity-create --load-env="node-identity.env" --fund-wallet=true --output-json="organization-identity.json" --output-env="organization-identity.env" --output-env-prefix=organization
|
|
124
168
|
```
|
|
125
169
|
|
|
126
|
-
###
|
|
170
|
+
### Step 4 - Add the trust verification method to the organisation identity
|
|
127
171
|
|
|
128
172
|
```shell
|
|
129
|
-
twin-node identity-create --load-env="node-identity.env" --
|
|
173
|
+
twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --verification-method-type=assertionMethod --verification-method-id=!TWIN_TRUST_VERIFICATION_METHOD_ID --overwrite-mode=skip --output-json="organization-trust.json" --output-env="organization-trust.env"
|
|
130
174
|
```
|
|
131
175
|
|
|
132
|
-
###
|
|
176
|
+
### Step 5 - Set the organisation identity on the node (single-tenant)
|
|
133
177
|
|
|
134
178
|
```shell
|
|
135
|
-
twin-node
|
|
179
|
+
twin-node set-node-org-id --load-env="organization-identity.env" --organization-id=!ORGANIZATION_DID
|
|
136
180
|
```
|
|
137
181
|
|
|
138
|
-
###
|
|
182
|
+
### Step 6 - Create the node tenant and associate the organisation (multi-tenant only)
|
|
139
183
|
|
|
140
184
|
```shell
|
|
141
|
-
twin-node tenant-
|
|
185
|
+
twin-node tenant-create --load-env="node-identity.env" --label="Node" --output-json="node-tenant.json" --output-env="node-tenant.env" --output-env-prefix=node
|
|
142
186
|
```
|
|
143
187
|
|
|
144
|
-
### Update a tenant to be used by the node
|
|
145
|
-
|
|
146
188
|
```shell
|
|
147
|
-
twin-node tenant-
|
|
189
|
+
twin-node set-tenant-org-id --load-env="node-tenant.env,organization-identity.env" --tenant-id=!NODE_TENANT_ID --organization-id=!ORGANIZATION_DID
|
|
148
190
|
```
|
|
149
191
|
|
|
150
|
-
|
|
192
|
+
To import an existing tenant instead:
|
|
151
193
|
|
|
152
194
|
```shell
|
|
153
|
-
twin-node
|
|
195
|
+
twin-node tenant-import --load-env="node-tenant.json" --tenant-id=!NODE_TENANT_ID --api-key=!NODE_API_KEY --label=!NODE_LABEL --public-origin="https://api.example.com"
|
|
154
196
|
```
|
|
155
197
|
|
|
156
|
-
|
|
198
|
+
To update an existing tenant:
|
|
157
199
|
|
|
158
200
|
```shell
|
|
159
|
-
twin-node
|
|
201
|
+
twin-node tenant-update --load-env="node-tenant.json" --tenant-id=!NODE_TENANT_ID --label="New Label"
|
|
160
202
|
```
|
|
161
203
|
|
|
162
|
-
|
|
204
|
+
To remove a stale organisation alias from a tenant:
|
|
163
205
|
|
|
164
206
|
```shell
|
|
165
207
|
twin-node remove-tenant-org-alias --load-env="node-tenant.env" --tenant-id=!NODE_TENANT_ID --alias=!OLD_ORGANIZATION_DID
|
|
166
208
|
```
|
|
167
209
|
|
|
168
|
-
|
|
210
|
+
---
|
|
169
211
|
|
|
170
|
-
|
|
171
|
-
twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --controller=!NODE_DID --verification-method-id=!TWIN_ATTESTATION_VERIFICATION_METHOD_ID --output-json="organization-attestation.json" --output-env="organization-attestation.env"
|
|
172
|
-
```
|
|
212
|
+
The following steps run when the `admin-user` feature is enabled.
|
|
173
213
|
|
|
174
|
-
###
|
|
214
|
+
### Step 7 - Add the blob encryption key to the organisation (if blob encryption is enabled)
|
|
175
215
|
|
|
176
216
|
```shell
|
|
177
|
-
twin-node
|
|
217
|
+
twin-node vault-key-create --load-env="organization-identity.env" --identity=!ORGANIZATION_DID --key-type=ChaCha20Poly1305 --key-id=!TWIN_BLOB_STORAGE_ENCRYPTION_KEY_ID --overwrite-mode=skip --output-json="organization-blob-encryption.json" --output-env="organization-blob-encryption.env"
|
|
178
218
|
```
|
|
179
219
|
|
|
180
|
-
###
|
|
220
|
+
### Step 8 - Add the attestation verification method to the organisation (if attestation is enabled)
|
|
181
221
|
|
|
182
222
|
```shell
|
|
183
|
-
twin-node identity-
|
|
223
|
+
twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --verification-method-type=assertionMethod --verification-method-id=!TWIN_ATTESTATION_VERIFICATION_METHOD_ID --overwrite-mode=skip --output-json="organization-attestation.json" --output-env="organization-attestation.env"
|
|
184
224
|
```
|
|
185
225
|
|
|
186
|
-
|
|
226
|
+
To import an existing attestation verification method:
|
|
187
227
|
|
|
188
228
|
```shell
|
|
189
|
-
twin-node identity-verification-method-
|
|
229
|
+
twin-node identity-verification-method-import --load-env="node-identity.env,organization-identity.env,organization-attestation.env" --identity=!ORGANIZATION_DID --verification-method-id=!DID_VERIFICATION_METHOD_ID --private-key-hex=!DID_VERIFICATION_METHOD_PRIVATE_KEY_HEX
|
|
190
230
|
```
|
|
191
231
|
|
|
192
|
-
|
|
232
|
+
To create a verifiable credential using the attestation verification method:
|
|
193
233
|
|
|
194
234
|
```shell
|
|
195
|
-
twin-node identity-
|
|
235
|
+
twin-node identity-verifiable-credential-create --load-env="organization-identity.env,organization-attestation.env" --identity=!ORGANIZATION_DID --verification-method-id=!TWIN_ATTESTATION_VERIFICATION_METHOD_ID --subject-json="subject.json" --output-json="organization-attestation-credential.json" --output-env="organization-attestation-credential.env"
|
|
196
236
|
```
|
|
197
237
|
|
|
198
|
-
### Add
|
|
238
|
+
### Step 9 - Add the immutable proof verification method to the organisation (if immutable proofs are enabled)
|
|
199
239
|
|
|
200
240
|
```shell
|
|
201
|
-
twin-node
|
|
241
|
+
twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --verification-method-type=assertionMethod --verification-method-id=!TWIN_IMMUTABLE_PROOF_VERIFICATION_METHOD_ID --overwrite-mode=skip --output-json="organization-immutable-proof.json" --output-env="organization-immutable-proof.env"
|
|
202
242
|
```
|
|
203
243
|
|
|
204
|
-
###
|
|
244
|
+
### Step 10 - Create the admin user identity
|
|
205
245
|
|
|
206
246
|
```shell
|
|
207
|
-
twin-node identity-create --load-env="organization-identity.env" --controller=!ORGANIZATION_DID --output-json="user-identity.json" --output-env="user-identity.env" --output-env-prefix=
|
|
247
|
+
twin-node identity-create --load-env="organization-identity.env" --controller=!ORGANIZATION_DID --output-json="admin-user-identity.json" --output-env="admin-user-identity.env" --output-env-prefix=admin_user
|
|
208
248
|
```
|
|
209
249
|
|
|
210
|
-
###
|
|
250
|
+
### Step 11 - Create the admin user account
|
|
211
251
|
|
|
212
252
|
```shell
|
|
213
|
-
twin-node user-create --load-env="organization-identity.env,user-identity.env,node-tenant.env" --user-identity=!
|
|
253
|
+
twin-node user-create --load-env="organization-identity.env,admin-user-identity.env,node-tenant.env" --user-identity=!ADMIN_USER_DID --organization-identity=!ORGANIZATION_DID --email="admin@node" --given-name="Node" --family-name="Admin" --scope="tenant-admin,user-admin" --output-json="user-account-admin.json" --output-env="user-account-admin.env" --output-env-prefix=admin
|
|
214
254
|
```
|
|
215
255
|
|
|
216
|
-
|
|
256
|
+
To update an existing user:
|
|
217
257
|
|
|
218
258
|
```shell
|
|
219
|
-
twin-node user-update --load-env="organization-identity.env,user-identity.env,node-tenant.env" --email="admin@node" --scope="tenant-admin,foo"
|
|
259
|
+
twin-node user-update --load-env="organization-identity.env,admin-user-identity.env,node-tenant.env" --email="admin@node" --scope="tenant-admin,user-admin,foo"
|
|
220
260
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/node",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.54",
|
|
4
4
|
"description": "TWIN Node serving APIs using the specified configuration",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/node-core": "0.0.3-next.
|
|
17
|
+
"@twin.org/node-core": "0.0.3-next.54"
|
|
18
18
|
},
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "git+https://github.com/iotaledger/twin-node/issues"
|