This document guides the deployment of the complete chat application stack using docker-compose.yaml. The setup includes multiple components working together for real-time messaging and data transfer.
- Control Plane (2 instances): Manages assets, policies, and contracts.
- Data Plane (2 instances): Transfers data.
- Backend Application (2 instances): Supports asset configuration and facilitates communication with the UI.
- UI Application (2 instances): Provides a real-time chat interface for two business partners.
- Vault: Manages secrets required by the control and data planes.
- Postgres Database: Stores data for EDC and backend applications.
- Wallet-Stub (Optional): Uncomment in the
docker-compose.yaml
file if needed.
- Purpose: Securely stores secrets used by EDC components.
- Setup:
- Uses the
prepopulate_vault.sh
script to automatically migrate secrets during deployment.
- Uses the
- Purpose: Hosts multiple databases required by EDC and backend applications.
- Setup:
- The
create_database.sh
script creates required databases at startup.
- The
- Note:
- To ensure functionality, manually run the provided
migration.sql
to create EDC-specific tables.
- To ensure functionality, manually run the provided
- The create_database.sh needs to be modified. The
chmod +x /docker-entrypoint-initdb.d/create_databases.sh
needs to be removed. - Additionally, Windows uses CRLF line separators instead of LF, causing issues while running the init script.
- To change the line separators in IntelliJ IDEA, go to
File -> File Properties -> Line Separators
and selectLF - Unix and macOS (\n)
. - To change the line separators in Notepad++, go to
Edit -> EOL Conversion
and selectUnix (LF)
- To change the line separators in IntelliJ IDEA, go to
- Version: 0.7.7
- Components:
- Control Plane: Manages assets, policies, and contracts.
- Data Plane: Transfers data securely between sender and receiver.
- Deployment: Configured via
docker-compose.yaml
.
- Purpose:
- Handles asset configuration with URLs for message reception.
- Communicates with the UI application.
- Setup: A separate backend application is deployed for each EDC instance.
NOTE:
- When the backend application starts, it will create the Asset with id
edc-chat-app
, Policy, and Contract Definition. Please referEDCService.initializePreEdcProcess()
for more details - However, if the assetId as an
edc-chat-app
is already in the edc database, it’ll skip this process. - Policy is created to check
Membership
credential of participant. Each participate needs to presentMembership
credential to start data negotiation.
- Purpose: Provides a WebSocket-enabled interface for real-time chat.
- Setup: Each backend application has a corresponding UI instance.
- Install Docker and Docker Compose.
- Clone the repository containing
docker-compose.yaml
and accompanying scripts.
Note: below steps are tested with Docker version 27.3.1
- Run the following command to start the deployment:
docker compose up --build
- After the deployment the stack will look like below:
- We can access the UI using the http://localhost:8280 and http://localhost:8180.
- Select partner from the drop down list.
- Start the chat with the selected business partner.
- When message has been passed then the logs are looks like below:
- Comment on the following services from the
docker-compose.yaml
file.- smartsense-backend
- catena-x-backend
- smartsense-ui
- catena-x-ui
- After commenting this, use the below commands which will deploy the Edc and it's relevant services.
docker compose up -d
- remove the
postgres_data
folder from the root path of the code. - Once removal is done, execute the below command.
docker compose down -v
- After removing the data and all, we will run the whole stack again with below command.
docker compose up -d
The wallet-stub service is currently deployed in our shared environment at:wallet-stub.
- Make sure your wallet is created in Wallet stub application if you are changing or register new BPNs before starting data transfer/chat.
- You can create wallets just by calling
https://wallet.learn.smartsenselabs.com/yourBPN/did.json
URL in the browser.
If you want to deploy the wallet-stub service in your local environment, follow these steps:
- Open the
docker-compose.yaml
file in your project directory. - Locate the
wallet-stub
service configuration within the file. - Uncomment the
wallet-stub
service block. - Expose port
80
with ngrok and update the above host with the ngrok url. - Run the Docker Compose command to start the services:
docker compose up -d