Data Processing Chain Protocol Exchange inside a project example steps – Prometheus-X Components & Services

Data Processing Chain Protocol Exchange inside a project example steps

This guide demonstrates how to test a complete DPCP exchange flow within a project using the sandbox environment.

Prerequisites

Login

  1. Get Provider token:
curl -X POST http://localhost:3010/login \
  -H "Content-Type: application/json" \
  -d '{"serviceKey": "MLLgUPxnnZLxOAu5tbl_p9Bx_GKJFWJLVkic4jHOirGJjD_6zEbzcCosAhCw7zV_VA9fPYy_vdRkZLuebUAUoQgjAPZGPuI9zaXg",
  "secretKey": "xxRfHgwyb8OGYVuvdn13fwa8glsaFFwzB12laHzqoPs0PFw7HcA1DP6X8wkqEfZ4feUTwfdXO9WHGzlPwstMrE4FJVllcIl5U4nG"}'
  1. Get Consumer token:
curl -X POST http://localhost:3030/login \
  -H "Content-Type: application/json" \
  -d '{"secretKey": "Qh4XvuhSJbOp8nMV1JtibAUqjp3w_efBeFUfCmqQW_Nl8x4t3Sk6fWiK5L05CB3jhKZOgY5JlBSvWkFBHH_6fFhYQZWXNoZxO78x",
  "serviceKey": "dWJUUKH9rYF9wr_UAPb6PQXW9h17G7dzuGCbiDhcyjCGgHzLwBp6QHOQhDg0FFxS24GD8nvw37oe_LOjl7ztNATYiVOd_ZEVHQpV"}'

excepted response :

{
  "timestamp": 1730904960057,
  "code": 200,
  "content": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXJ2aWNlS2V5IjoiTUxMZ1VQeG5uWkx4T0F1NXRibF9wOUJ4X0dLSkZXSkxWa2ljNGpIT2lyR0pqRF82ekViemNDb3NBaEN3N3pWX1ZBOWZQWXlfdmRSa1pMdWViVUFVb1FnakFQWkdQdUk5emFYZyIsImlhdCI6MTczMDkwNDk2MDA1NSwiZXhwIjoxNzMwOTA0OTYwMzU1fQ.HvoHfXFy0L9Qtdl3pm-OSxH9phal_Vlc2_gYpiWJboM",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXJ2aWNlS2V5IjoiTUxMZ1VQeG5uWkx4T0F1NXRibF9wOUJ4X0dLSkZXSkxWa2ljNGpIT2lyR0pqRF82ekViemNDb3NBaEN3N3pWX1ZBOWZQWXlfdmRSa1pMdWViVUFVb1FnakFQWkdQdUk5emFYZyIsImlhdCI6MTczMDkwNDk2MDA1NiwiZXhwIjoxNzMwOTA0OTYwMzU2fQ.la9FDMlOICL1TXQOQSZ-YRLHib1GO3iQskXDk_4sE7w"
  }
}

Save these tokens for subsequent requests.

Trigger the exchange

  1. Initiate data exchange (from Consumer):
curl -X POST http://localhost:3030/exchange \
  -H "Authorization: Bearer {consumer_token}" \
  -H "Content-Type: application/json" \
  -d '{
  "contract": "http://contract:8081/contracts/66db1a6dc29e3ba863a85e0f",
  "purposeId": "http://catalog:8082/v1/catalog/serviceofferings/66d18b79ee71f9f096baecb1",
  "resourceId": "http://catalog:8082/v1/catalog/serviceofferings/66d187f4ee71f9f096bae8ca",
  "serviceChainId": "670e8eb6b439a2379f290fc7"
}
'
  1. Initiate data exchange (from Provider):
curl -X POST http://localhost:3010/exchange \
  -H "Authorization: Bearer {provider_token}" \
  -H "Content-Type: application/json" \
  -d '{
  "contract": "http://contract:8081/contracts/66db1a6dc29e3ba863a85e0f",
  "purposeId": "http://catalog:8082/v1/catalog/serviceofferings/66d18b79ee71f9f096baecb1",
  "resourceId": "http://catalog:8082/v1/catalog/serviceofferings/66d187f4ee71f9f096bae8ca",
  "serviceChainId": "670e8eb6b439a2379f290fc7"
}
'

Monitor

  1. Check exchange status (from Consumer):
curl -X GET http://localhost:3030/dataexchanges
curl -X GET http://localhost:3010/dataexchanges
  1. View Containers logs:
docker logs consumer
docker logs provider

Expected Results

  1. dataExchange:
    • should be created and synchronize on both side
    • Status should progress through: "PENDING" -> "IMPORT_SUCCESS"

Troubleshooting

Common issues:

  1. Exchange Fails
    • Verify all services are up
    • Check network connectivity
    • Ensure all tokens are valid
    • Review logs for detailed error messages

Swagger

💡 All these operations can be executed through the Swagger UI

Each connector provides a comprehensive Swagger documentation interface accessible at its /docs endpoint: