Consume Artifact via Docker Compose

The consumption of artifacts is the default IDS way of interaction between two connectors. Following the general process of:

  1. retrieving the metadata of the connector and artifact,
  2. negotiating a contract for the artifact,
  3. retrieving the artifact.

The test connector deployed at https://test-connector.playground.dataspac.es/ui/ provides a single artifact with a simple policy offer attached to it that allows for READ and USE rights if a consumer requests a contract with a validity in 2022 and 2023.

Configuration

  • Download templates
  • Provide IDS Identity
    Configure the certificates that you’ve created in the Request Playground Identities step.
    • Make sure the following files are in the same folder as docker-compose.yml: cachain.crt, component.crt, component.key with the PEM-based CA chain, public and private keys
    • Modify info.idsid, info.curator, info.maintainer to the corresponding identifiers that you filled in during creation of the certificates. info.idsid should be the Connector ID, and info.curator, info.maintainer should be the Participant ID.
  • Change Admin User credentials
    The default password is playground but this can be changed to a more secure password, which is especially needed for public Kubernetes deployments.

Deployment

To deploy the TSG Core Container execute:

docker-compose up -d

The containers will be deployed in detached mode, the user interface of the TSG Core Container will be available at: http://localhost:31000

To follow the logs of the TSG Core Container execute:

docker-compose logs -f tsg-core-container

Request artifact

An artifact is provided by a connector deployed on https://test-connector.playground.dataspac.es. The following steps show how this artifact can be retrieved from this connector.

The steps that must be followed are:

  1. Retrieve metadata of the artifact.
    See Self Description Message Flow
  2. Perform the contract negotiation process to establish a contract agreement.
    See Policy Negotiation Message Flow
  3. Retrieve the artifact.
    See Artifact Request Message Flow

Retrieve metadata of the artifact

Navigate to http://localhost:31000/#/selfdescription/request

Fill in the form with the following values:

Connector ID urn:playground:tsg:connectors:TestConnector
Agent ID leave empty
Access URL https://test-connector.playground.dataspac.es/selfdescription
Requested Element leave empty

And click Request description.

When the self description of the connector is retrieved successfully, the details are shown in a tabular form.

Click the catalog urn:playground:tsg:connectors:TestConnector:resources to show the available resources.

Click on the lock icon under Actions to go the next step directly.

Perform the contract negotiation process to establish a contract agreement

If you’ve clicked the lock icon in the previous step, the values in the form are filled in automatically. Otherwise, navigate to http://localhost:31000/#/artifacts/consumer and the following values can be used:

Connector ID urn:playground:tsg:connectors:TestConnector
Agent ID leave empty
Access URL https://test-connector.playground.dataspac.es/router/artifacts/urn%3Aplayground%3Atsg%3Aconnectors%3ATestConnector%3Aresources%3Aa3ea77e5-e786-4b5b-a637-4467c029df2e
Contract Offer
Contract Offer JSON-LD
  {
    "@type": "ids:ContractOffer",
    "@id": "https://w3id.org/idsa/autogen/contractOffer/211791f1-7ce6-4e01-b198-6abfcdd97719",
    "ids:permission": [
        {
        "@type": "ids:Permission",
        "@id": "https://w3id.org/idsa/autogen/permission/2441e172-574e-4bf5-b78b-51325b825253",
        "ids:action": [
            {
            "@id": "https://w3id.org/idsa/code/READ"
            },
            {
            "@id": "https://w3id.org/idsa/code/USE"
            }
        ],
        "ids:target": {
            "@id": "urn:playground:tsg:connectors:TestConnector:artifacts:9aa27c59-9f0c-4e77-9ad5-420f5eda0b98"
        }
        }
    ],
    "ids:contractStart": {
        "@value": "2022-01-01T00:00:00.000Z",
        "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp"
    },
    "ids:contractEnd": {
        "@value": "2023-12-31T00:00:00.000Z",
        "@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp"
    }
  }

Click Request Contract to perform the contract negotiation process.

If the process is successfully completed, the Transfer Contract field in the Request Artifact form should be filled with an URL similar to https://w3id.org/idsa/autogen/contractAgreement/00000000-0000-0000-0000-000000000000

Retrieve the artifact

If you’ve just executed the contract negotiation process, the Request Artifact is filled in automatically. Otherwise, navigate to http://localhost:31000/#/artifacts/consumer and use the following values:

Artifact ID urn:playground:tsg:connectors:TestConnector:artifacts:9aa27c59-9f0c-4e77-9ad5-420f5eda0b98
Connector ID urn:playground:tsg:connectors:TestConnector
Agent ID urn:playground:tsg:TNO
AccessURL https://test-connector.playground.dataspac.es/router/artifacts/urn%3Aplayground%3Atsg%3Aconnectors%3ATestConnector%3Aresources%3Aa3ea77e5-e786-4b5b-a637-4467c029df2e
Transfer Contract navigate to http://localhost:31000/#/pef/pap and copy the Agreement ID. If it’s automatically filled in, you don’t have to copy the ID from the PAP.

Click Request Artifact to actually download the artifact to your local system.

Clean-up

If you do not want to proceed with other tutorials, you can remove the resources used.

To clean-up all resources of the playground execute, in the same folder as the docker-compose.yml file:

docker-compose down

Didn't find what you were looking for?