Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the MVD tutorial: Textual and programmatic fixes/additions #405

Closed
wants to merge 11 commits into from
3 changes: 2 additions & 1 deletion .run/Connector Consumer Corp.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
<option name="MAIN_CLASS_NAME" value="org.eclipse.edc.boot.system.runtime.BaseRuntime" />
<module name="mvd.launchers.runtime-embedded.main" />
<option name="PROGRAM_PARAMETERS" value="--log-level=debug" />
<shortenClasspath name="ARGS_FILE" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
</component>
3 changes: 2 additions & 1 deletion .run/Connector _provider-manufacturing_.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
</option>
<option name="MAIN_CLASS_NAME" value="org.eclipse.edc.boot.system.runtime.BaseRuntime" />
<module name="mvd.launchers.runtime-embedded.main" />
<shortenClasspath name="ARGS_FILE" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
</component>
3 changes: 2 additions & 1 deletion .run/Connector _provider-qna_.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
</option>
<option name="MAIN_CLASS_NAME" value="org.eclipse.edc.boot.system.runtime.BaseRuntime" />
<module name="mvd.launchers.runtime-embedded.main" />
<shortenClasspath name="ARGS_FILE" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
</component>
3 changes: 2 additions & 1 deletion .run/IdentityHub Consumer Corp.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
</option>
<option name="MAIN_CLASS_NAME" value="org.eclipse.edc.boot.system.runtime.BaseRuntime" />
<module name="mvd.launchers.identity-hub.main" />
<shortenClasspath name="ARGS_FILE" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
</component>
3 changes: 2 additions & 1 deletion .run/IdentityHub Provider Corp.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
</option>
<option name="MAIN_CLASS_NAME" value="org.eclipse.edc.boot.system.runtime.BaseRuntime" />
<module name="mvd.launchers.identity-hub.main" />
<shortenClasspath name="ARGS_FILE" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
</component>
3 changes: 2 additions & 1 deletion .run/Provider Catalog Server.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
</option>
<option name="MAIN_CLASS_NAME" value="org.eclipse.edc.boot.system.runtime.BaseRuntime" />
<module name="mvd.launchers.catalog-server.main" />
<shortenClasspath name="ARGS_FILE" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
</component>
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ Consumer Corp has a connector plus its own IdentityHub.

"provider-qna" and "provider-manufacturing" both have two data assets each, named `"asset-1"` and `"asset-2"` but
neither "provider-qna" nor "provider-manufacturing" expose their catalog endpoint directly to the internet. Instead, the
catalog server (of the Provider Corp) provides a catalog that contains special assets (think: pointers) to both "
provider-qna"'s and "provider-manufacturing"'s connectors, specifically, their DSP endpoints.
catalog server (of the Provider Corp) provides a catalog that contains special assets (think: pointers) to both
"provider-qna"'s and "provider-manufacturing"'s connectors, specifically, their DSP endpoints.

We call this a "root catalog", and the pointers are called "catalog assets". This means, that by resolving the root
catalog, and by following the links therein, "Consumer Corp" can resolve the actual asset from "provider-qna" and
Expand Down Expand Up @@ -211,7 +211,7 @@ latter is a compound run config an brings up all other runtimes together.

### 4.1 Start NGINX

The issuer's DID document is hosted on NGINX, so the easiest way of running NGINX is with a docker container:
The issuer's DID document is hosted on NGINX, so the easiest way of running NGINX is with a docker container (Windows users remove all `"` around `$PWD`, and execute this command using the Powershell in the `MinimumViableDataspace` directory):

```shell
docker run -d --name nginx -p 9876:80 --rm \
Expand Down Expand Up @@ -266,15 +266,17 @@ The connector runtimes contain both the controlplane and the dataplane. Note tha
likely be separate runtimes to be able to scale and deploy them individually. Note also, that the Kubernetes deployment
(next chapter) does indeed run them as separate pods.

The run configs use the `temurin-22` JDK. If you don't have it installed already, you can choose to install it (IntelliJ
makes this really easy), or to select whatever JDK you have available in each run config.
Select and execute the `dataspace` run configuration to start the runtimes now.

The run configs use the `temurin-21` JDK. If you don't have it installed already, you can choose to install it (IntelliJ
will prompt you to do so), or to select whatever JDK you have available in each run config.

All run configs take their configuration from `*.env` files which are located in `deployment/assets/env`.

### 4.3 Seeding the dataspace

DID documents are dynamically generated when "seeding" the data, specifically when creating the `ParticipantContext`
objects in IdentityHub. This is automatically being done by a script `seed.sh`.
objects in IdentityHub. This is automatically being done by a script `seed.sh`. Windows user might need to configure a shell interpreter in IntelliJ first, for which they could use `C:\WINDOWS\system32\CMD.exe` with script option `/C`.

After executing the `dataspace` run config in Intellij, be sure to **execute the `seed.sh` script after all the runtimes
have started**. Omitting to do so will leave the dataspace in an uninitialized state and cause all
Expand All @@ -284,10 +286,9 @@ connector-to-connector communication to fail.

All REST requests made from the script are available in the [Postman
collection](./deployment/postman/MVD.postman_collection.json). With the [HTTP
Client](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html) and [Import from Postman
Collections](https://plugins.jetbrains.com/plugin/22438-import-from-postman-collections) plugins, the Postman collection
can be imported and then executed by means of the [environment file](./deployment/postman/http-client.env.json),
selecting the "Local" environment.
Client](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html) plugin, the Postman collection
can be imported (right click on the file in IntelliJ, then `Convert Collection to .http File`).
Then, open the generated .http file in IntelliJ, do a search-and-replace (change all `Content-Type: text/plain` to `Content-Type: application/json`), select "run with environment: Local" ([environment file](./deployment/postman/http-client.env.json)), and run chosen requests.

Please read [chapter 7](#7-executing-rest-requests-using-postman) for details.

Expand Down Expand Up @@ -859,4 +860,4 @@ into a filter expression, for example `org.eclipse.edc.vc.type:DataProcessorCred
query for `DataProcessorCredentials` in the database.

The MVD uses the default `EdcScopeToCriterionTransformer` to achieve this. It is recommended to implement a custom
`ScopeToCriterionTransformer` for an actual production scenario.
`ScopeToCriterionTransformer` for an actual production scenario.