@twin.org/node 0.0.3-next.27 → 0.0.3-next.29

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.
@@ -1,34 +1,85 @@
1
- # Examples
1
+ # Node Usage
2
2
 
3
- ## CLI Usage
3
+ These commands cover local installation, on demand execution, and a complete bootstrap flow that can be reused in deployment scripts.
4
4
 
5
- To run the command from the package either:
5
+ ## Running
6
6
 
7
- Install `@twin.org/node@next` and use the following command:
7
+ To install and run the CLI locally use the following commands:
8
8
 
9
9
  ```shell
10
- twin-node --help
10
+ npm install @twin.org/node -g
11
+ twin-node
11
12
  ```
12
13
 
13
- or
14
+ or run directly using NPX:
14
15
 
15
16
  ```shell
16
- npx "@twin.org/node@next" --help
17
+ npx "@twin.org/node"
17
18
  ```
18
19
 
19
- ### Display help listing all commands
20
+ ## Help
20
21
 
21
- ```shell
22
- twin-node --help
22
+ ```text
23
+ 🌩️ TWIN Node v0.0.3-next.26
24
+
25
+ Command: help
26
+
27
+ All the commands available are listed below, for more information use the --help option with a specific command.
28
+ bootstrap-legacy: Bootstrap in legacy mode for backwards compatibility, **will be deprecated in future versions**
29
+ identity-create: Create an identity
30
+ identity-import: Import an identity
31
+ identity-verification-method-create: Create an identity verification method
32
+ identity-verification-method-import: Import an identity verification method
33
+ identity-verifiable-credential-create: Create a verifiable credential
34
+ node-set-identity: Set the node identity
35
+ node-set-tenant: Set the node tenant
36
+ tenant-create: Create a tenant with associated api key
37
+ tenant-import: Import a tenant with associated api key
38
+ tenant-update: Update a tenant with associated api key
39
+ user-create: Create a user
40
+ user-update: Update a user
41
+ vault-key-create: Create a vault key for an identity
42
+ vault-key-import: Import a vault key for an identity
23
43
  ```
24
44
 
25
- ### Display help for specific command
45
+ ## identity-create --help
26
46
 
27
- ```shell
28
- twin-node command --help
47
+ ```text
48
+ identity-create: Create an identity
49
+
50
+ env-prefix: (string, optional)
51
+ Prefix to use for standard .env files e.g. TWIN_.
52
+
53
+ mnemonic: (string, 24 words, optional)
54
+ The mnemonic phrase to use for the identity. If not provided, a random mnemonic will be generated.
55
+
56
+ identity: (string, did, optional)
57
+ The DID of the identity to create. If not provided, a new DID will be generated.
58
+
59
+ controller: (string, did, optional)
60
+ The controller DID for the identity. If not provided, the identity will be its own controller.
61
+
62
+ fund-wallet: (boolean, default: 'false', optional)
63
+ Whether to fund the wallet associated with the identity from a faucet.
64
+
65
+ load-env: (string, optional)
66
+ Comma separated list of paths to .env files to read input parameters from.
67
+
68
+ output-json: (string, optional)
69
+ Path to a .json file to store the command output.
70
+
71
+ output-env: (string, optional)
72
+ Path to a .env file to store the command output.
73
+
74
+ output-env-prefix: (string, optional)
75
+ Prefix to use for variables in the output .env file.
76
+
77
+ Example: identity-create --mnemonic="..." --fund-wallet=true
29
78
  ```
30
79
 
31
- ### Bootstrap legacy mode **will be deprecated in future versions**
80
+ ## Example
81
+
82
+ ### Bootstrap legacy mode will be deprecated in future versions
32
83
 
33
84
  ```shell
34
85
  twin-node bootstrap-legacy --load-env=".env.bootstrap-legacy"
@@ -40,7 +91,7 @@ twin-node bootstrap-legacy --load-env=".env.bootstrap-legacy"
40
91
  twin-node identity-create --fund-wallet=true --output-json="node-identity.json" --output-env="node-identity.env" --output-env-prefix=node
41
92
  ```
42
93
 
43
- Alternatively import existing details:
94
+ ### Import existing identity details
44
95
 
45
96
  ```shell
46
97
  twin-node identity-import --load-env="my-identity.env" --identity=!MY_DID --mnemonic=!MY_MNEMONIC
@@ -58,13 +109,13 @@ twin-node node-set-identity --load-env="node-identity.env" --identity=!NODE_DID
58
109
  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"
59
110
  ```
60
111
 
61
- Alternatively import existing details:
112
+ ### Import existing authentication signing key details
62
113
 
63
114
  ```shell
64
115
  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
65
116
  ```
66
117
 
67
- ### Add a key associated with the node identity for use by the synchronised storage blob encryption
118
+ ### Add a key associated with the node identity for use by synchronised storage blob encryption
68
119
 
69
120
  ```shell
70
121
  twin-node vault-key-create --load-env="node-identity.env" --identity=!NODE_DID --key-id=!TWIN_SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_ID --key-type=ChaCha20Poly1305 --output-json="node-synchronised-storage-encryption-key.json" --output-env="node-synchronised-storage-encryption-key.env"
@@ -76,7 +127,7 @@ twin-node vault-key-create --load-env="node-identity.env" --identity=!NODE_DID -
76
127
  twin-node vault-key-import --load-env="node-identity.env,my-key.json" --identity=!NODE_DID --key-id=!TWIN_AUTH_SIGNING_KEY_ID --key-type=!KEY_TYPE --private-key-hex=!PRIVATE_KEY_HEX
77
128
  ```
78
129
 
79
- Alternatively import existing details:
130
+ ### Create a tenant to be used by the node
80
131
 
81
132
  ```shell
82
133
  twin-node tenant-create --label="node" --public-origin="https://api.example.com" --output-env-prefix=node --output-json="node-tenant.json" --output-env="node-tenant.env"
@@ -94,25 +145,25 @@ twin-node tenant-import --load-env="node-tenant.json" --tenant-id=!NODE_TENANT_I
94
145
  twin-node tenant-update --load-env="node-tenant.json" --tenant-id=!NODE_TENANT_ID --label="New Label"
95
146
  ```
96
147
 
97
- ### Associated the tenant with the node
148
+ ### Associate the tenant with the node
98
149
 
99
150
  ```shell
100
151
  twin-node node-set-tenant --load-env="node-tenant.env" --tenant-id=!NODE_TENANT_ID
101
152
  ```
102
153
 
103
- ### Create an organization identity
154
+ ### Create an organisation identity
104
155
 
105
156
  ```shell
106
- 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
157
+ 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
107
158
  ```
108
159
 
109
- ### Add a verification method to the organization identity for attestation
160
+ ### Add a verification method to the organisation identity for attestation
110
161
 
111
162
  ```shell
112
163
  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"
113
164
  ```
114
165
 
115
- Alternatively import existing details:
166
+ ### Import an attestation verification method for the organisation identity
116
167
 
117
168
  ```shell
118
169
  twin-node identity-verification-method-import --load-env="node-identity.env,organization-identity.env,organization-attestation.env" --identity=!ORGANIZATION_DID --controller=!NODE_DID --verification-method-id=!DID_VERIFICATION_METHOD_ID --private-key-hex=!DID_VERIFICATION_METHOD_PRIVATE_KEY_HEX
@@ -124,25 +175,25 @@ twin-node identity-verification-method-import --load-env="node-identity.env,orga
124
175
  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"
125
176
  ```
126
177
 
127
- ### Add a verification method to the organization identity for immutable proofs
178
+ ### Add a verification method to the organisation identity for immutable proofs
128
179
 
129
180
  ```shell
130
181
  twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --controller=!NODE_DID --verification-method-id=!TWIN_IMMUTABLE_PROOF_VERIFICATION_METHOD_ID --output-json="organization-immutable-proof.json" --output-env="organization-immutable-proof.env"
131
182
  ```
132
183
 
133
- ### Add a verification method to the organization identity for trust verification
184
+ ### Add a verification method to the organisation identity for trust verification
134
185
 
135
186
  ```shell
136
187
  twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --controller=!NODE_DID --verification-method-id=!TWIN_TRUST_VERIFICATION_METHOD_ID --output-json="organization-trust.json" --output-env="organization-trust.env"
137
188
  ```
138
189
 
139
- ### Add a key associated with the organization to be used for blob encryption
190
+ ### Add a key associated with the organisation to be used for blob encryption
140
191
 
141
192
  ```shell
142
193
  twin-node vault-key-create --load-env="organization-identity.env" --identity=!ORGANIZATION_DID --key-id=!TWIN_BLOB_STORAGE_ENCRYPTION_KEY_ID --key-type=ChaCha20Poly1305 --output-json="organization-blob-encryption.json" --output-env="organization-blob-encryption.env"
143
194
  ```
144
195
 
145
- ### Create an identity associated with the organization
196
+ ### Create an identity associated with the organisation
146
197
 
147
198
  ```shell
148
199
  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=user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/node",
3
- "version": "0.0.3-next.27",
3
+ "version": "0.0.3-next.29",
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.27"
17
+ "@twin.org/node-core": "0.0.3-next.29"
18
18
  },
19
19
  "bugs": {
20
20
  "url": "git+https://github.com/twinfoundation/node/issues"