Skip to content

Commit

Permalink
Merge pull request #885 from jkbquabeck/main
Browse files Browse the repository at this point in the history
doc(tutorials): adapt tutorial description to fit new structure/basis
  • Loading branch information
stephanbcbauer authored Aug 2, 2024
2 parents ab0e085 + bd810c7 commit 2b8ac7a
Show file tree
Hide file tree
Showing 21 changed files with 2,068 additions and 1,404 deletions.
6 changes: 3 additions & 3 deletions docs/tutorials/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Completing this tutorial is recommended for IT departments prior to participatin

:::info

With the Minimum Tractus-X Dataspace (MXD), IT departments can set up their own data space locally to perform a data exchange between two parties (Alice and Bob in our example). The MXD can be used as a sandbox for testing and exploring the EDC.
With the Minimum Tractus-X dataspace (MXD), IT departments can set up their own data space locally to perform a data exchange between two parties (Alice and Bob in our example). The MXD can be used as a sandbox for testing and exploring the EDC.

:::

## Target Audience

This tutorial is built for employees of the **IT department who operates the IT stack of an adopter (data provider/consumer)**. It shows how to operate the various Catena-X components in combination with each other. It also explains the basic connection with the core services (e.g. Keycloak and MIW), as provided by an operating company (e.g. first Catena-X Operating Company Confinity-X).
This tutorial is built for employees of the **IT department who operates the IT stack of an adopter (data provider/consumer)**. It shows how to operate the various Catena-X components in combination with each other. It also explains the basic connection with the core services (e.g. keycloak and MIW), as provided by an operating company (e.g. first Catena-X Operating Company Cofinity-X).

:::note

Expand Down Expand Up @@ -60,7 +60,7 @@ Technical knowledge (Docker, Kubernetes, Helm, Terraform) to deploy components o

## Tutorial Description

This tutorial is split into three chapters (more will follow) that build on each other. It won't provide deep dives into each of the technical components that will be deployed. If you are interested in getting a deeper understanding of each of the components, or the realted standards, please have a look into the [kits](https://eclipse-tractusx.github.io/developer) section.
This tutorial is split into three chapters (more will follow) that build on each other. It won't provide deep dives into each of the technical components that will be deployed. If you are interested in getting a deeper understanding of each of the components, or the related standards, please have a look into the [kits](https://eclipse-tractusx.github.io/developer) section.

:::tip

Expand Down
11 changes: 11 additions & 0 deletions docs/tutorials/e2e/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

All notable changes to this tutorial will be documented in this file.

## [1.0.0] - 2024-06-24

### Added

- Digital twin registry (dtr) as component and related description "how to use it" as a provider
- Example for restrictions via different policies

### Changed

- Deployable local dataspace via umbrella helm charts

## [0.1.0] - 2023-11-28

### Added
Expand Down
Binary file not shown.
140 changes: 102 additions & 38 deletions docs/tutorials/e2e/boost/consumeData.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ To see Bob's data offerings, Alice must request access to his catalog. The catal
So Alice requests Bob's catalog using the following `curl` commands:

```shell
curl --location 'http://localhost/alice/management/v2/catalog/request' \
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/catalog/request' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: password' \
--header 'X-Api-Key: TEST1' \
--data-raw '{
"@context": {},
"protocol": "dataspace-protocol-http",
"counterPartyAddress": "http://bob-controlplane:8084/api/v1/dsp",
"counterPartyAddress": "http://dataprovider-controlplane.tx.test/api/v1/dsp",
"querySpec": {
"offset": 0,
"limit": 100
Expand All @@ -34,22 +34,26 @@ Alice finds the Asset with the ID 3 and the description "Product EDC Demo Asset

## Negotiate a contract

:::info
Dont forget to change the `offerId`with the one you received in the previous step in your catalog request.
:::

But before she can transfer the data, she must negotiate the contract with Bob. To do this, she uses the following `curl` command:

```shell
curl --location 'http://localhost/alice/management/v2/contractnegotiations' \
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/contractnegotiations' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: password' \
--header 'X-Api-Key: TEST1' \
--data-raw '{
"@context": {
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@type": "NegotiationInitiateRequestDto",
"connectorAddress": "http://bob-controlplane:8084/api/v1/dsp",
"connectorAddress": "http://dataprovider-controlplane.tx.test/api/v1/dsp",
"protocol": "dataspace-protocol-http",
"providerId": "BPNL000000000002",
"providerId": "BPNL00000003AYRE",
"offer": {
"offerId": "Mw==:Mw==:ODRkYjJhZjQtZjMxOC00ZjgyLThjMjktODQwZThjYjBjNjVl",
"offerId": "Mw==:Mw==:NTYzYWRkYTItNmEzMy00YTNhLWFmOTQtYjVjOWM0ZDMyODA1",
"assetId": "3",
"policy": {
"@type": "odrl:Set",
Expand All @@ -62,15 +66,39 @@ curl --location 'http://localhost/alice/management/v2/contractnegotiations' \
}' | jq
```

In the response, Alice gets a UUID. This is the ID of the created contract negotiation. Alice can now use this ID to see the current status of the negotiation and - if the negotiation was successful - the ID of the created contract agreement.
The response should look like this:

```json
{
"@type": "edc:IdResponse",
"@id": "65356596-dd7c-4ad4-8fc6-8512be6f0ec2",
"edc:createdAt": 1715669329095,
"@context": {
"dct": "http://purl.org/dc/terms/",
"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"dcat": "https://www.w3.org/ns/dcat/",
"odrl": "http://www.w3.org/ns/odrl/2/",
"dspace": "https://w3id.org/dspace/v0.8/"
}
}
```

In the response, Alice gets a UUID (attribute is `@id`). This is the ID of the created contract negotiation. Alice can now use this ID to see the current status of the negotiation and - if the negotiation was successful - the ID of the created contract agreement.

:::tip
Make sure to replace `<ID>` in the URL with the UUID you just received.
Make sure to replace `<ID>` in the URL with the UUID you just received. in the current case the UUID is `65356596-dd7c-4ad4-8fc6-8512be6f0ec2`. So the curl command should look like this:

```shell
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/contractnegotiations/65356596-dd7c-4ad4-8fc6-8512be6f0ec2' \
--header 'X-Api-Key: TEST1' | jq
```

:::

```shell
curl --location 'http://localhost/alice/management/v2/contractnegotiations/<ID>' \
--header 'X-Api-Key: password' | jq
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/contractnegotiations/<ID>' \
--header 'X-Api-Key: TEST1' | jq
```

- If the negotiation was **successful**, Alice will see an ouput as shown below.
Expand All @@ -79,17 +107,17 @@ curl --location 'http://localhost/alice/management/v2/contractnegotiations/<ID>'
```json
{
"@type": "edc:ContractNegotiation",
"@id": "4e74a632-94bc-4bfb-acf5-230f7d18b080",
"@id": "65356596-dd7c-4ad4-8fc6-8512be6f0ec2",
"edc:type": "CONSUMER",
"edc:protocol": "dataspace-protocol-http",
"edc:state": "FINALIZED",
"edc:counterPartyId": "BPNL000000000002",
"edc:counterPartyAddress": "http://bob-controlplane:8084/api/v1/dsp",
"edc:counterPartyId": "BPNL00000003AYRE",
"edc:counterPartyAddress": "http://dataprovider-controlplane.tx.test/api/v1/dsp",
"edc:callbackAddresses": [],
"edc:createdAt": 1702989093837,
"edc:contractAgreementId": "Mw==:Mw==:NmY5MDA4OGEtOWY1ZC00YmYyLWFiZjMtMjRiNzY0YzEyOTk4",
"edc:createdAt": 1715669329095,
"edc:contractAgreementId": "Mw==:Mw==:N2RhZGI3OGMtYzUxNC00OTkzLWI3MzktNDE3YmJhMDNkMDU4",
"@context": {
"dct": "https://purl.org/dc/terms/",
"dct": "http://purl.org/dc/terms/",
"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"dcat": "https://www.w3.org/ns/dcat/",
Expand All @@ -107,30 +135,30 @@ Alice wants to send the data to her backend application ("<http://backend:8080>"

:::warning

For testing purposes, you should replace `backend:8080` with your own test API or use [webhook.site](https://webhook.site/) as your backend system.
For testing purposes, you should replace `<backend>` with your own test API or use [webhook.site](https://webhook.site/) as your backend system.
If you do not change this, you will not be able to view the received token, which is required for requesting the data!
If you are using webhook.site, please make sure that you use "Your unique URL" and that you do not transfer any sensitive information to webhook.

Replace `<contractAgreementId>` with the contract agreement ID you received in the previous step.
:::

```shell
curl --location 'http://localhost/alice/management/v2/transferprocesses' \
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/transferprocesses' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: password' \
--header 'X-Api-Key: TEST1' \
--data-raw '{
"@context": {
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"assetId": "3",
"connectorAddress": "http://bob-controlplane:8084/api/v1/dsp",
"connectorId": "BPNL000000000002",
"connectorAddress": "http://dataprovider-controlplane.tx.test/api/v1/dsp",
"connectorId": "BPNL00000003AYRE",
"contractId": "<contractAgreementId>",
"dataDestination": {
"type": "HttpProxy"
},
"privateProperties": {
"receiverHttpEndpoint": "http://backend:8080"
"receiverHttpEndpoint": "<backend:8080>"
},
"protocol": "dataspace-protocol-http",
"transferType": {
Expand All @@ -140,40 +168,64 @@ curl --location 'http://localhost/alice/management/v2/transferprocesses' \
}' | jq
```

The response in this case looks like this:

```json
{
"@type": "edc:IdResponse",
"@id": "9d6a0507-25f5-4a81-8885-a47bc3809451",
"edc:createdAt": 1715669899367,
"@context": {
"dct": "http://purl.org/dc/terms/",
"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"dcat": "https://www.w3.org/ns/dcat/",
"odrl": "http://www.w3.org/ns/odrl/2/",
"dspace": "https://w3id.org/dspace/v0.8/"
}
}
```

Just to make sure everything worked, Alice uses another `curl` command to check if the transfer was successful.

In the response, Alice gets a UUID. This is the ID of the created transfer. Alice can now use this ID to see the current status of the transfer.

:::tip
Make sure to replace `<ID>` in the URL with the UUID you just received.
Make sure to replace `<ID>` in the URL with the UUID you just received. In our case, the UUID is `9d6a0507-25f5-4a81-8885-a47bc3809451`. So the curl command should look like this:

```shell
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/transferprocesses/9d6a0507-25f5-4a81-8885-a47bc3809451' \
--header 'X-Api-Key: TEST1' | jq
```

:::

```shell
curl --location 'http://localhost/alice/management/v2/transferprocesses/<ID>' \
--header 'X-Api-Key: password' | jq
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/transferprocesses/<ID>' \
--header 'X-Api-Key: TEST1' | jq
```

- If the transfer was **successful**, Alice will see an ouput as shown below.
- If the transfer was **unsuccessful**, the transfer state (`edc:state`) will be `TERMINATED`.

```json
{
"@id": "6d6bca4e-4da5-4ed3-9fe5-2b98623d9a59",
"@id": "9d6a0507-25f5-4a81-8885-a47bc3809451",
"@type": "edc:TransferProcess",
"edc:correlationId": "6d6bca4e-4da5-4ed3-9fe5-2b98623d9a59",
"edc:correlationId": "9d6a0507-25f5-4a81-8885-a47bc3809451",
"edc:state": "STARTED",
"edc:stateTimestamp": 1702990026966,
"edc:stateTimestamp": 1715669901450,
"edc:type": "CONSUMER",
"edc:assetId": "3",
"edc:contractId": "Mw==:Mw==:NmY5MDA4OGEtOWY1ZC00YmYyLWFiZjMtMjRiNzY0YzEyOTk4",
"edc:contractId": "Mw==:Mw==:N2RhZGI3OGMtYzUxNC00OTkzLWI3MzktNDE3YmJhMDNkMDU4",
"edc:callbackAddresses": [],
"edc:dataDestination": {
"@type": "edc:DataAddress",
"edc:type": "HttpProxy"
},
"edc:connectorId": "BPNL000000000002",
"edc:connectorId": "BPNL00000003AYRE",
"@context": {
"dct": "https://purl.org/dc/terms/",
"dct": "http://purl.org/dc/terms/",
"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"dcat": "https://www.w3.org/ns/dcat/",
Expand All @@ -197,14 +249,14 @@ If you used webhook.site as your backend system, you can now go to [webhook.site

In her backend (as already mentioned [webhook.site](https://webhook.site/)) you will now find the following (as an example) entry

![Consume data backend](@site/static/tutorials/e2e/consume_data_backend.png)
![Consume data backend](/tutorials/e2e/consume_data_backend.png)

```json
{
"id": "841e3cd7-add0-47fd-adef-ea8074ec50af",
"endpoint": "http://bob-tractusx-connector-dataplane:8081/api/public",
"id": "9d6a0507-25f5-4a81-8885-a47bc3809451",
"endpoint": "http://dataprovider-dataplane.tx.test/api/public",
"authKey": "Authorization",
"authCode": "eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3MTE5MTIzMDgsImRhZCI6IktaamRBV3ZSV0xpS3V5akNwSjRIdEgwT2lqOEdQRno2SVdXcWxMMEFFZUloS25wOU5mZll2R1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lpyaTZzVWFXQU1WOXVsQ2JGS2NPM2xxMERPaWRuQjNqSXJ4blh4Y3JjVHl3MEkzV3JjN2k2ZG1nejlXMTFvYTR5VUpJWU92R1lkdWNXdk1pemk3b01mck5SdXE0SVJ1djR6ai9Cemcxb2NZalB5Y0RvK2I2M0RheWpyWmVNS1c4OGNRUnlvUDdpbExsMVNVVmFlRUxZQ3lieitCYUxpd2x1d0lpcWxFckJrTDNlOXptNGpJYz0iLCJjaWQiOiJNdz09Ok13PT06TjJSaFpHSTNPR010WXpVeE5DMDBPVGt6TFdJM016a3ROREUzWW1KaE1ETmtNRFU0In0.AOt6rXbcK44RD7XNCMN16zjvurzdkMNCki3HkvZ_VJ43eDkCDDbquDSvW0SmEnp9cqhjMbUqnO-iGJheI4TbkIc9dxFouJGtHvKFAjOG7LFSErwvH0yNXus1TPN41BCp_jP1tpH63s3PuRqgdzzn1axkJ57aGo9ibqnKRm7ZhM8pgkReWQpHwlFz3QuOMFWHNmPm_HMePPsUxZM7OpARwgShGMqATHEJmoIff2S1yLLeN0k97JT4BzL7xwM9VB-Yssq1rWxBp3GITcBta5R1EVjzaEZseYn_wxFFmVlXQtu_lkvbgihEsvCgtXI_c-EGZl_gTVe9DMfq4cM2XXfE8A",
"properties": {}
}
```
Expand All @@ -222,7 +274,19 @@ In this example, we can not use the endpoint URL as is, because we are working w
In this example, this results in the following request:

```shell
curl -X GET -H 'Authorization: eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3MTE5MTIzMDgsImRhZCI6IktaamRBV3ZSV0xpS3V5akNwSjRIdEgwT2lqOEdQRno2SVdXcWxMMEFFZUloS25wOU5mZll2R1Q0M0N4dURZVHhUK3lRaXhrcWU1dVN1Sk5JR09GTi9kRlQ4R29WNGFHZ3FpdzhXMXBLT2ZLMUdtM1NkeFRIeWR0QTlnTnZoZFJ6T05RclpxbUlwNGxwZVBRaS9CSGVNTEYycEVsRVUvcExzU3dTbDh3eUplY3lSM2thTnJiUUw0a3RnajNMeDB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heWpyWmVNS1c4OGNRUnlvUDdpbExsMVNVVmFlRUxZQ3lieitCYUxpd2x1d0lpcWxFckJrTDNlOXptNGpJYz0iLCJjaWQiOiJNdz09Ok13PT06TjJSaFpHSTNPR010WXpVeE5DMDBPVGt6TFdJM016a3ROREUzWW1KaE1ETmtNRFU0In0.AOt6rXbcK44RD7XNCMN16zjvurzdkMNCki3HkvZ_VJ43eDkCDDbquDSvW0SmEnp9cqhjMbUqnO-iGJheI4TbkIc9dxFouJGtHvKFAjOG7LFSErwvH0yNXus1TPN41BCp_jP1tpH63s3PuRqgdzzn1axkJ57aGo9ibqnKRm7ZhM8pgkReWQpHwlFz3QuOMFWHNmPm_HMePPsUxZM7OpARwgShGMqATHEJmoIff2S1yLLeN0k97JT4BzL7xwM9VB-Yssq1rWxBp3GITcBta5R1EVjzaEZseYn_wxFFmVlXQtu_lkvbgihEsvCgtXI_c-EGZl_gTVe9DMfq4cM2XXfE8A' http://dataprovider-dataplane.tx.test/api/public | jq
```

:::info
Currently the response for this curl commoand is

```json
{
"userId": 1,
"id": 3,
"title": "fugiat veniam minus",
"completed": false
}
```

## Notice
Expand Down
Loading

0 comments on commit 2b8ac7a

Please sign in to comment.