Skip to content

Commit

Permalink
Merge branch 'main' into create-policy-button
Browse files Browse the repository at this point in the history
  • Loading branch information
daku-de authored Jul 14, 2024
2 parents bc049b1 + 6a95ec7 commit 8ed7461
Show file tree
Hide file tree
Showing 16 changed files with 566 additions and 284 deletions.
Binary file added Deliverables/sprint-12/build-documentation.pdf
Binary file not shown.
80 changes: 58 additions & 22 deletions Documentation/build-documentation.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# Requirements

To run the connectors on your own machine, installing Docker is enough. If you don't want to use Docker, make sure that you have the following packages installed:
To run the connectors on your own machine, installing Docker is enough. You don't need to install any additional packages or dependencies.

[![Docker](https://img.shields.io/badge/Docker-v27-blue.svg)](https://docs.docker.com/get-docker/)

| Package | Version |
| -------- | ------- |
| JDK | 17 |
| Gradle | 8.7 |
| jq | 1.7.1 |
| npm | 10.7 |
| node | 22.2 |
<br>

# Build process

## Docker usage

To run the code using docker, use the following command in the `src` folder:
To run the code using docker, use the following commands in the `src` folder:

```
sudo docker compose up
sudo docker compose --profile complete build
sudo docker compose --profile complete up
```
To start only selected profiles, use:

````
sudo docker compose --profile <company|taxadvisor|bank> up
````

<br>

<span style="color:red"><b> Note: </b></span> If you are using macOS, you might have to modify the `config.json` file:
<b>Note:</b> If you are using macOS, you might have to modify the `config.json` file:
1. Go to `~/.docker/config.json`.
2. Change the `credsStore` value from `desktop` to `osxkeychain`.

Expand All @@ -32,9 +34,18 @@ Alternatively you may:

<br>

## Running the connectors locally
## Running connectors locally

If you want to run and test the connectors without using Docker, make sure you have the following packages installed:

To run the connectors without using Docker, you have to use four different terminals. Use the following commands in separate terminals:
| Package | Version |
| -------- | ------- |
| JDK | 17 |
| Gradle | 8.7 |
| curl | 8.6 |
| jq | 1.7.1 |

Use the following commands in separate terminals from the `src/edc-connector` folder:

### Company connector

Expand All @@ -61,17 +72,35 @@ In the third terminal, use the following command to run the bank connector:
```
java -Dedc.keystore=resources/certs/cert.pfx -Dedc.keystore.password=123456 -Dedc.vault=resources/configuration/bank-vault.properties -Dedc.fs.config=resources/configuration/bank-configuration.properties -jar connector/build/libs/connector.jar
```
<br>

### Running the web app
## Running database locally

Run the app in the forth (main) terminal:
Run the following commands from the `src/databse` folder to build Gradle project and start the database:

```
cd frontend_socket/international-dataspace-station
npm run dev
./gradlew build
java -jar build/libs/filestorage-database.jar
```

After this, you can access the app at `https://localhost:3000`.
Show files in the database:

```
curl localhost:8080/files/list
```

Upload file:

```
curl -X POST -F "file=@/path/to/your/textfile.txt" http://localhost:8080/files/upload
```

Download file:

```
curl localhost:8080/files/get/{id}
```

<br>

Expand Down Expand Up @@ -129,17 +158,24 @@ curl -d @resources/negotiate-contract.json \
-s | jq
```

#### 7. Get contract agreement id
#### 7. Get contract agreement ID

Replace `{{id}}` with the contract negotiation id from the consumer terminal:
Replace `{{id}}` with the contract negotiation ID from the consumer terminal:

```
curl -X GET "http://localhost:{{consumer port}}/management/v2/contractnegotiations/{{id}}" \
--header 'Content-Type: application/json' \
-s | jq
```

<br>
The connectors have now been configured successfully and are ready to be used.

[software_architecture]: https://github.com/amosproj/amos2024ss02-international-dataspace-station/blob/main/Deliverables/sprint-02/software-architecture.pdf
#### 8. Start the transfer

Before executing the request, modify `start-transfer.json` by inserting the contract agreement ID from the previous step. You can re-use the same asset, policies and contract negotiation from before.

```
curl -d @resources/negotiate-contract.json \
-X POST -H 'content-type: application/json' http://localhost:{{consumer port}}/management/v2/contractnegotiations \
-s | jq
```
154 changes: 20 additions & 134 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<h1 align="center"> International Dataspace Station </h1>
<h3 align="center"> in collaboration with DATEV </h3>

<br>

## 📖 About

With the increase of data exchange among different sectors like finance, legal, healthcare, government and others, ensuring easy interoperability while still following data usage rules, policies, and local regulations is becoming increasingly important. **Dataspace** is the envisioned solution to tackle these challenges.
Expand All @@ -11,19 +13,16 @@ Dataspace operates with the help of **data connectors**, which enable secure and

Our goal is to explore the feasibiltiy of dataspace usage with regards to data sovereignty. This includes testing the maturity of dataspace, importance of the components and ease of deployment.

Learn in more detail about how our software works here: [IDS - Documentation][documentation] <br><br>
Learn in more detail about how our software works here: [IDS - Documentation][documentation]

<br>

## ⚡️ Requirements

To run the connectors on your own machine, installing Docker is enough. If you don't want to use Docker, make sure that you have the following packages installed:
To run the connectors on your own machine, installing Docker is enough. You don't need to install any additional packages or dependencies.

[![Docker](https://img.shields.io/badge/Docker-v27-blue.svg)](https://docs.docker.com/get-docker/)

| Package | Version |
| -------- | ------- |
| JDK | 17 |
| Gradle | 8.7 |
| jq | 1.7.1 |
| npm | 10.7 |
| node | 22.2 |
<br>

## 🐳 Docker usage
Expand All @@ -32,14 +31,13 @@ To run the code using docker, use the following commands in the `src` folder:

```
sudo docker compose --profile complete build
sudo docker compose --profile <company|taxadvisor|bank> up
```

Or to start all participants at the same time

```
sudo docker compose --profile complete up
```
To start only selected profiles, use:

````
sudo docker compose --profile <company|taxadvisor|bank> up
````

<br>

Expand All @@ -53,130 +51,18 @@ Alternatively you may:

<br>

## 🖥️ Running the connectors locally

To run the connectors without using Docker, you have to use four different terminals. Use the following commands in separate terminals:

### Company connector

In the first terminal, use the following command to build Gradle project and run the company connector:

```
./gradlew connector:build
java -Dedc.keystore=resources/certs/cert.pfx -Dedc.keystore.password=123456 -Dedc.vault=resources/configuration/company-vault.properties -Dedc.fs.config=resources/configuration/company-configuration.properties -jar connector/build/libs/connector.jar
```
## 🖥️ Running connectors locally

### Tax advisor connector
<b> ❗️ You don't have to do this to use our application or for further app development ❗️ </b>

In the second terminal, use the following command to run the tax advisor connector:

```
java -Dedc.keystore=resources/certs/cert.pfx -Dedc.keystore.password=123456 -Dedc.vault=resources/configuration/tax_advisor-vault.properties -Dedc.fs.config=resources/configuration/tax_advisor-configuration.properties -jar connector/build/libs/connector.jar
```

### Bank connector

In the third terminal, use the following command to run the bank connector:

```
java -Dedc.keystore=resources/certs/cert.pfx -Dedc.keystore.password=123456 -Dedc.vault=resources/configuration/bank-vault.properties -Dedc.fs.config=resources/configuration/bank-configuration.properties -jar connector/build/libs/connector.jar
```

### Running the web app

Run the app in the forth (main) terminal:

```
cd frontend_socket/international-dataspace-station
npm run dev
```

After this, you can access the app at `https://localhost:3000`.
But if you still want to run and test the connectors without using Docker, please refer to the [build documentation][build-documentation].

<br>

## 🔗 Establishing connection for data exchange

Send the following HTTP requests to establish a connection between different connectors to be able to exchange data (replace `{{provider port}}`/`{{consumer port}}` with the corresponding ports on which the connector that provides/consumes data is running):

#### 1. Register data plane

```
curl -H 'Content-Type: application/json' \
-d @resources/dataplane/register-data-plane-provider.json \
-X POST "http://localhost:{{provider port}}/management/v2/dataplanes" -s | jq
```

#### 2. Create an asset

```
curl -d @resources/create-asset.json \
-H 'content-type: application/json' http://localhost:{{provider port}}/management/v3/assets \
-s | jq
```

#### 3. Create a policy

```
curl -d @resources/create-policy.json \
-H 'content-type: application/json' http://localhost:{{provider port}}/management/v2/policydefinitions \
-s | jq
```

#### 4. Create a contract definition

```
curl -d @resources/create-contract-definition.json \
-H 'content-type: application/json' http://localhost:{{provider port}}/management/v2/contractdefinitions \
-s | jq
```

#### 5. Fetch catalog

```
curl -X POST "http://localhost:{{consumer port}}/management/v2/catalog/request" \
-H 'Content-Type: application/json' \
-d @resources/fetch-catalog.json -s | jq
```

#### 6. Negotiate contract

Replace the `{{contract-offer-id}}` placeholder in `negotiate-contract.json` with the contract offer id you found in the catalog at the path `dcat:dataset.odrl:hasPolicy.@id`:

```
curl -d @resources/negotiate-contract.json \
-X POST -H 'content-type: application/json' http://localhost:{{consumer port}}/management/v2/contractnegotiations \
-s | jq
```

#### 7. Get contract agreement id

Replace `{{id}}` with the contract negotiation id from the consumer terminal:

```
curl -X POST "http://localhost:29193/management/v2/transferprocesses" \
-H "Content-Type: application/json" \
-d @resources/start-transfer.json \
-s | jq
```

<br>
The connectors have now been configured successfully and are ready to be used.

#### 8. Start the transfer

Before executing the request, modify the `start-transfer.json` by inserting the contract agreement ID from the previous step. You can re-use the same asset, policies and contract negotiation from before.

```
curl -d @resources/negotiate-contract.json \
-X POST -H 'content-type: application/json' http://localhost:{{consumer port}}/management/v2/contractnegotiations \
-s | jq
```


[software_architecture]: https://github.com/amosproj/amos2024ss02-international-dataspace-station/blob/main/Deliverables/sprint-02/software-architecture.pdf
## 🧑‍💻 IDS Team

[documentation]: https://github.com/amosproj/amos2024ss02-international-dataspace-station/tree/dfd45b9232be4af2d921f3585db6b1aeecc3cd55/Documentation
[![Contributors](https://contrib.rocks/image?repo=amosproj/amos2024ss02-international-dataspace-station)](https://github.com/amosproj/amos2024ss02-international-dataspace-station/graphs/contributors)

[documentation]: https://github.com/amosproj/amos2024ss02-international-dataspace-station/tree/main/Documentation

[build-documentation]: https://github.com/amosproj/amos2024ss02-international-dataspace-station/blob/main/Documentation/build-documentation.md
Loading

0 comments on commit 8ed7461

Please sign in to comment.