@twin.org/node 0.0.3-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.
@@ -0,0 +1,149 @@
1
+ # Examples
2
+
3
+ ## CLI Usage
4
+
5
+ To run the command from the package either:
6
+
7
+ Install `@twin.org/node` and use the following command:
8
+
9
+ ```shell
10
+ twin-node
11
+ ```
12
+
13
+ or
14
+
15
+ ```shell
16
+ npx "@twin.org/node"
17
+ ```
18
+
19
+ ### Display help listing all commands
20
+
21
+ ```shell
22
+ twin-node --help
23
+ ```
24
+
25
+ ### Display help for specific command
26
+
27
+ ```shell
28
+ twin-node command --help
29
+ ```
30
+
31
+ ### Bootstrap legacy mode **will be deprecated in future versions**
32
+
33
+ ```shell
34
+ twin-node bootstrap-legacy --load-env=".env.bootstrap-legacy"
35
+ ```
36
+
37
+ ### Create the identity for the node
38
+
39
+ ```shell
40
+ twin-node identity-create --fund-wallet=true --output-json="node-identity.json" --output-env="node-identity.env" --output-env-prefix=node
41
+ ```
42
+
43
+ Alternatively import existing details:
44
+
45
+ ```shell
46
+ twin-node identity-import --load-env="my-identity.env" --identity=!MY_DID --mnemonic=!MY_MNEMONIC
47
+ ```
48
+
49
+ ### Associate the identity with the node
50
+
51
+ ```shell
52
+ twin-node node-set-identity --load-env="node-identity.env" --identity=!NODE_DID
53
+ ```
54
+
55
+ ### Add a key associated with the node identity for use in authentication signing
56
+
57
+ ```shell
58
+ 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
+ ```
60
+
61
+ Alternatively import existing details:
62
+
63
+ ```shell
64
+ 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
+ ```
66
+
67
+ ### Add a key associated with the node identity for use by the synchronised storage blob encryption
68
+
69
+ ```shell
70
+ 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"
71
+ ```
72
+
73
+ ### Import an existing key associated with the node identity for use in authentication signing
74
+
75
+ ```shell
76
+ 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
+ ```
78
+
79
+ Alternatively import existing details:
80
+
81
+ ```shell
82
+ twin-node tenant-create --output-json="node-tenant.json" --output-env="node-tenant.env" --label="node" --output-env-prefix=node
83
+ ```
84
+
85
+ ### Import a tenant to be used by the node
86
+
87
+ ```shell
88
+ twin-node tenant-import --load-env="node-tenant.json" --tenant-id=!NODE_TENANT_ID --api-key=!NODE_API_KEY --label=!NODE_LABEL
89
+ ```
90
+
91
+ ### Associated the tenant with the node
92
+
93
+ ```shell
94
+ twin-node node-set-tenant --load-env="node-tenant.env" --tenant-id=!NODE_TENANT_ID
95
+ ```
96
+
97
+ ### Create an organization identity
98
+
99
+ ```shell
100
+ 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
101
+ ```
102
+
103
+ ### Add a verification method to the organization identity for attestation
104
+
105
+ ```shell
106
+ 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"
107
+ ```
108
+
109
+ Alternatively import existing details:
110
+
111
+ ```shell
112
+ 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
113
+ ```
114
+
115
+ ### Create a verifiable credential based on the organisation attestation verification method
116
+
117
+ ```shell
118
+ 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"
119
+ ```
120
+
121
+ ### Add a verification method to the organization identity for immutable proofs
122
+
123
+ ```shell
124
+ 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"
125
+ ```
126
+
127
+ ### Add a verification method to the organization identity for verifiable credential authentication
128
+
129
+ ```shell
130
+ twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --controller=!NODE_DID --verification-method-id=!TWIN_VC_AUTHENTICATION_VERIFICATION_METHOD_ID --output-json="organization-vc-authentication.json" --output-env="organization-vc-authentication.env"
131
+ ```
132
+
133
+ ### Add a key associated with the organization to be used for blob encryption
134
+
135
+ ```shell
136
+ 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"
137
+ ```
138
+
139
+ ### Create a user identity associated with the organization
140
+
141
+ ```shell
142
+ 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
143
+ ```
144
+
145
+ ### Create a user login associated with the user identity
146
+
147
+ ```shell
148
+ twin-node user-create --load-env="organization-identity.env,user-identity.env,node-tenant.env" --user-identity=!USER_DID --organization-identity=!ORGANIZATION_DID --tenant-id=!NODE_TENANT_ID --email="admin@node" --output-json="user-account-admin.json" --output-env="user-account-admin.env" --output-env-prefix=admin
149
+ ```