You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+67-40Lines changed: 67 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Guardian is a modular open-source solution that includes best-in-class identity
11
11
## Discovering Digital Environmental Assets assets on Hedera
12
12
13
13
14
-
As identified in Hedera Improvement Proposal 19 (HIP-19), each entity on the Hedera network may contain a specific identifier in the memo field for discoverability. Guardian demonstrates this when every Hedera Consensus Service transaction is logged to a Hedera Consensus Service (HCS) Topic. Observing the Hedera Consensus Service Topic, you can discover newly minted tokens.
14
+
As identified in Hedera Improvement Proposal 19 (HIP-19), each entity on the Hedera network may contain a specific identifier in the memo field for discoverability. Guardian demonstrates this when every Hedera Consensus Service transaction is logged to a Hedera Consensus Service (HCS) Topic. Observing the Hedera Consensus Service Topic, you can discover newly minted tokens.
15
15
16
16
In the memo field of each token mint transaction you will find a unique Hedera message timestamp. This message contains the url of the Verifiable Presentation (VP) associated with the token. The VP can serve as a starting point from which you can traverse the entire sequence of documents produced by Guardian policy workflow, which led to the creation of the token. This includes a digital Methodology (Policy) HCS Topic, an associated Registry HCS Topic for that Policy, and a Project HCS Topic.
17
17
@@ -73,7 +73,7 @@ For this example purpose let's name the Guardian platform as "develop"
73
73
GUARDIAN_ENV="develop"
74
74
```
75
75
76
-
> **_NOTE:_** Every single service is provided in its folder with a `.env.template` file, this set of files are only needed for the case of Manual installation.
76
+
> **_NOTE:_** Every single service is provided in its folder with a `.env.template` file, this set of files are only needed for the case of Manual installation.
77
77
78
78
#### 3. Update BC access variables.
79
79
@@ -87,7 +87,7 @@ There will be other steps in the Demo Usage Guide that will be required for the
87
87
The parameter `HEDERA_NET` may assume the following values: `mainnet`, `testnet`, `previewnet`, `localnode`. choose the right value depending on your target Hedera network on which the `OPERATOR_ID` has been defined.
88
88
89
89
As examples:
90
-
90
+
91
91
following the previous example, the file to configure should be named: `./configs/.env.develop.guardian.system`, this file is already provided in the folder as an example, only update the variables OPERATOR_ID, OPERATOR_KEY and HEDERA_NET.
92
92
93
93
```plaintext
@@ -97,7 +97,7 @@ The parameter `HEDERA_NET` may assume the following values: `mainnet`, `testnet`
97
97
```
98
98
99
99
Starting from Multi-environment release (2.13.0) it has been introduced a new parameter `PREUSED_HEDERA_NET`.
100
-
Multienvironemnt is a breaking change and the configuration of this parameter intend to smooth the upgrading.
100
+
Multienvironemnt is a breaking change and the configuration of this parameter intend to smooth the upgrading.
101
101
`PREUSED_HEDERA_NET` configuration depends on the installation context.
102
102
103
103
- If the installation is a completely new one just remove the parameter and feel free to jump to the next paragraph.
@@ -107,15 +107,15 @@ Multienvironemnt is a breaking change and the configuration of this parameter in
107
107
##### 3.1. PREUSED_HEDERA_NET configuration
108
108
109
109
The `PREUSED_HEDERA_NET` parameter is intended to hold the target Hedera network that the system already started to notarize data to. PREUSED\_HEDERA\_NET is the reference to the HEDERA_NET that was in use before the upgrade.
110
-
To let the Multi-environment transition happen in a transparent way the `GUARDIAN_ENV` parameter in the `.env` file has to be configured as empty while the `PREUSED_HEDERA_NET` has to be set with the same value configured in the `HEDERA_NET` parameter in the previous configuration file.
110
+
To let the Multi-environment transition happen in a transparent way the `GUARDIAN_ENV` parameter in the `.env` file has to be configured as empty while the `PREUSED_HEDERA_NET` has to be set with the same value configured in the `HEDERA_NET` parameter in the previous configuration file.
111
111
112
112
`PREUSED_HEDERA_NET` never needs to be changed after the first initialization. On the contrary it will be possible to change `HEDERA_NET` to dials with all the Hedera different networks.
113
113
114
-
- as first Example:
114
+
- as first Example:
115
115
116
116
in case of the upgrading from a release minor then 2.13.0 to a bigger one and keep using the same HEDERA_NET="Mainnet"(as example)
117
117
118
-
configure the name the Guardian platform as empty in the `.env` file
118
+
configure the name the Guardian platform as empty in the `.env` file
119
119
120
120
```shell
121
121
GUARDIAN_ENV=""
@@ -138,7 +138,7 @@ To let the Multi-environment transition happen in a transparent way the `GUARDIA
138
138
139
139
- As a second example: to test the new release change the HEDERA_NET to "testnet". This is the complete configuration:
140
140
141
-
Set the name of the Guardian platform to whatever descripting name in the `.env` file
141
+
Set the name of the Guardian platform to whatever descripting name in the `.env` file
142
142
143
143
```shell
144
144
GUARDIAN_ENV="testupgrading"
@@ -158,7 +158,7 @@ To let the Multi-environment transition happen in a transparent way the `GUARDIA
158
158
PREUSED_HEDERA_NET="mainnet"
159
159
```
160
160
161
-
This configuration allows you to leave untouched all the data referring to Mainnet in the Database while testing on Testnet. Refer to Guardian
161
+
This configuration allows you to leave untouched all the data referring to Mainnet in the Database while testing on Testnet. Refer to Guardian
162
162
[documentation](https://docs.hedera.com/guardian/guardian/readme/environments/multi-session-consistency-according-to-environment) for more details.
163
163
164
164
> **_NOTE:_** You can use the Schema Topic ID (`INITIALIZATION_TOPIC_ID`) already present in the configuration files, or you can specify your own.
@@ -185,25 +185,25 @@ To let the Multi-environment transition happen in a transparent way the `GUARDIA
185
185
To select this option ensure that `IPFS_PROVIDER="web3storage"` setting exists in your `./configs/.env.<environment>.guardian.system` file.
186
186
187
187
To configure access to the [w3up](https://github.com/web3-storage/w3up) IPFS upload API from web3.storage for your Guardian instance you need to set correct values to the following variables in the `./configs/.env.<environment>.guardian.system` file:
188
-
188
+
189
189
```
190
190
IPFS_STORAGE_KEY="..."
191
191
IPFS_STORAGE_PROOF="..."
192
192
```
193
193
194
194
> **_NOTE:_** When Windows OS is used for creating the IPFS values, please use bash shell to prevent issues with base64 encoding.
195
-
195
+
196
196
To obtain the values for these variables please follow the steps below:
197
197
- Create an account on https://web3.storage, please specify the email you have access to as the account authentication is based on the email validation. Make sure to follow through the registration process to the end, choose an appropriate billing plan for your needs (e.g. 'starter') and enter your payment details.
198
198
- Install w3cli as described in the [corresponding section](https://web3.storage/docs/w3cli/#install) of the web3.storage documentation.
199
199
- Create your 'space' as described in the ['Create your first space'](https://web3.storage/docs/w3cli/#create-your-first-space) section of the documentation.
200
-
- Execute the following to set the Space you intend on delegating access to:
200
+
- Execute the following to set the Space you intend on delegating access to:
201
201
`w3 space use`.
202
-
- Execute the following command to retrieve your Agent private key and DID:
203
-
`npx ucan-key ed`.
202
+
- Execute the following command to retrieve your Agent private key and DID:
203
+
`npx ucan-key ed`.
204
204
The private key (starting with `Mg...`) is the value to be used in the environment variable `IPFS_STORAGE_KEY`.
The output of this command is the value to be used in the environment variable `IPFS_STORAGE_PROOF`.
208
208
209
209
To summarise, the process of configuring delegated access to the w3up API consists of execution the following command sequence:
@@ -230,7 +230,7 @@ configuration.
230
230
231
231
For detailed setup instructions, refer to the
232
232
official <https://docs.filebase.com/api-documentation/ipfs-pinning-service-api>.
233
-
233
+
234
234
#### 5. Setting up Chat GPT API KEY to enable AI Search and Guided Search:
235
235
236
236
For setting up AI and Guided Search, we need to set OPENAI_API_KEY variable in `./configs/.env*` files.
@@ -239,13 +239,40 @@ For setting up AI and Guided Search, we need to set OPENAI_API_KEY variable in `
239
239
OPENAI_API_KEY="..."
240
240
```
241
241
242
-
#### 6. Build and launch with Docker. Please note that this build is meant to be used in production and will not contain any debug information. From the project's root folder:
242
+
#### 6. Build and launch with Docker.
243
243
244
-
```shell
245
-
docker compose up -d --build
246
-
```
247
-
248
-
> **_NOTE:_** About docker-compose: from the end of June 2023 Compose V1 won’t be supported anymore and will be removed from all Docker Desktop versions. Make sure you use Docker Compose V2 (comes with Docker Desktop > 3.6.0) as at https://docs.docker.com/compose/install/
244
+
The following list outlines various Docker Compose configurations for different purposes. Choose the one that best suits your needs.
245
+
246
+
| Configuration | Description | Command to Run |
247
+
|---------------|-------------|----------------|
248
+
| Guardian (Demo Mode) | Guardian using pre-built images |`docker-compose up -d --build`|
249
+
| Guardian Build (Demo Mode) | Builds Guardian from source code |`docker-compose -f docker-compose-build.yml up -d --build`|
250
+
| Production Guardian | Guardian using pre-built images, no demo mode |`docker-compose -f docker-compose-production.yml up -d --build`|
251
+
| Production Guardian Build | Builds Guardian from source code, no demo mode |`docker-compose -f docker-compose-production-build.yml up -d --build`|
252
+
| Indexer | Indexer using pre-built images |`docker-compose -f docker-compose-indexer.yml up -d --build`|
253
+
| Indexer Build | Builds Indexer from source code |`docker-compose -f docker-compose-indexer-build.yml up -d --build`|
254
+
| Analytics Service | Analytics Service using pre-built images |`docker-compose -f docker-compose-analytics.yml up -d --build`|
255
+
| Analytics Service Build | Builds Analytics Service from source code |`docker-compose -f docker-compose-analytics-build.yml up -d --build`|
256
+
257
+
To proceed:
258
+
259
+
1. Choose the configuration that matches your requirements.
260
+
2. Open a terminal in the project root folder.
261
+
3. Run the corresponding command from the "Command to Run" column.
262
+
263
+
For example, to run the standard Guardian in demo mode:
264
+
265
+
```shell
266
+
docker-compose up -d --build
267
+
```
268
+
269
+
This will start the containers in detached mode (-d) and build them if necessary.
270
+
271
+
> **_NOTE:_** Configurations with "Build" in their name compile the application from source code, which may take longer but allows for customization.
272
+
273
+
> **_NOTE:_** Production configurations do not include demo features and will not contain any debug information.
274
+
275
+
> **_NOTE:_** From the end of June 2023 Compose V1 won’t be supported anymore and will be removed from all Docker Desktop versions. Make sure you use Docker Compose V2 (comes with Docker Desktop > 3.6.0) as at https://docs.docker.com/compose/install/
249
276
250
277
#### 7. Browse to <http://localhost:3000> and complete the setup.
251
278
@@ -272,9 +299,9 @@ If you want to manually build every component with debug information, then build
272
299
273
300
Install, configure and start all the prerequisites, then build and start each component.
274
301
275
-
#### Services Configuration:
302
+
#### Services Configuration:
276
303
277
-
- for each of the services create the file `./<service_name>/.env` to do this copy, paste and rename the file `./<service_name>/.env.template`
304
+
- for each of the services create the file `./<service_name>/.env` to do this copy, paste and rename the file `./<service_name>/.env.template`
278
305
279
306
For example:
280
307
@@ -285,11 +312,11 @@ Install, configure and start all the prerequisites, then build and start each co
285
312
286
313
If need to configure OVERRIDE uncomment the variable in file `./guardian-service/.env`:
287
314
```plaintext
288
-
OVERRIDE="false"
315
+
OVERRIDE="false"
289
316
```
290
317
291
-
- configure the file `./<service_name>/configs/.env.<service>.<GUARDIAN_ENV>` file: to do this copy,
292
-
paste and rename the file `./<service_name>/.env.<service>.template`
318
+
- configure the file `./<service_name>/configs/.env.<service>.<GUARDIAN_ENV>` file: to do this copy,
319
+
paste and rename the file `./<service_name>/.env.<service>.template`
293
320
294
321
following previous example:
295
322
@@ -321,7 +348,7 @@ For setting up AI and Guided Search, we need to set OPENAI_API_KEY variable in `
321
348
Npm:
322
349
```
323
350
npm install
324
-
```
351
+
```
325
352
#### 3. From the **interfaces** folder
326
353
327
354
Yarn:
@@ -399,7 +426,7 @@ For setting up AI and Guided Search, we need to set OPENAI_API_KEY variable in `
399
426
```
400
427
npm --workspace=auth-service start
401
428
```
402
-
429
+
403
430
#### 7. From the **policy-service** folder
404
431
405
432
To build the service:
@@ -425,7 +452,7 @@ For setting up AI and Guided Search, we need to set OPENAI_API_KEY variable in `
425
452
Npm:
426
453
```
427
454
npm --workspace=policy-service start
428
-
```
455
+
```
429
456
#### 8. Build and start **worker-service** service
Note: VAULT_PROVIDER can be set to "database" or "hashicorp" to select Database instance or a hashicorp vault instance correspondingly.
622
-
623
-
If the VAULT_PROVIDER value is set to "hashicorp" the following 3 parameters should be configured in the auth-service folder.
624
-
649
+
650
+
If the VAULT_PROVIDER value is set to "hashicorp" the following 3 parameters should be configured in the auth-service folder.
651
+
625
652
1. HASHICORP_ADDRESS : http://localhost:8200 for using local vault. For remote vault, we need to use the value from the configuration settings of Hashicorp vault service.
626
653
2. HASHICORP_TOKEN : the token from the Hashicorp vault.
627
654
3. HASHICORP_WORKSPACE : this is only needed when we are using cloud vault for Hashicorp. Default value is "admin".
0 commit comments