Skip to content

Installation

This article outlines the steps required to set up a local instance of the Credential Verification Service (CVS).

In its default configuration, the CVS uses Partisia Blockchain's testnet as both the registry and the storage solution. Follow our guides to set up a different registry or storage.

To receive the verification results in your application you must also create a presentation definition and configure your application to receive post requests from the CVS.

Before installing a CVS instance you must:

  • Have Docker installed on your machine
  • Be logged in to the gitlab registry to pull the images. This can be done by running the command:
    docker login registry.gitlab.com
    
  • Have access to a Partisia Platform to use for testing. Our default configuration below uses Partisia Blockchain's testnet. Another option is to use your own Partisia Platform deployment. You can follow this guide on how to setup and run your deployment.

Configuring the Credential Verification Service

To use the Docker image of the CVS, a configuration file is required. This file handles all aspects of your CVS instance configuration. Create a JSON file containing the necessary settings. The following example, referred to as server.json, can be used as a starting point for testing:

Example configuration file:
server.json
{
  "port": 8081,
  "baseUrl": "http://docker:8081",
  "registryConfig": {
    "baseUrl": "https://node1.testnet.partisiablockchain.com",
    "shards": 3,
    "addresses": {
      "registry": "027f3a703fe38cf0525ceaaa3815ffb4140efd8d9a"
    }
  },
  "stateConfig": {
    "baseUrl": "https://node1.testnet.partisiablockchain.com",
    "shards": 3,
    "privateKey": "348571a75bcb4f4adf169fe5a1c8f03af29b42435a7854d77fb873964f3fd9c1",
    "addresses": {
      "deployPublic": "0197a0e238e924025bad144aa0c4913e46308f9a4d"
    }
  },
  "claimsConfig": {
    "destinationUrl": "https://example-application.com/verified-claims",
    "auth": {
      "mode": "API-KEY",
      "apiKey": "123"
    }
  }
}

Here is an explanation of the first-level fields in the configuration file:

  • port server port

  • baseUrl is the url of the CVS. This is required for the verifier to handle communication with the wallet

  • registryConfig Configures which blockchain registry should be used

    • For a full explanation of this field go here
  • stateConfig Configures which blockchain should be used to store the verification states

    • For a full explanation of this field go here
  • claimsConfig Configures where the verified claims should be pushed

    • For a full explanation of this field go here

Downloading and Running the docker image

We have to mount the above config file into the container running the project. This can be done by running the following command:

docker run -d -p 8000:8081 -v PATH_TO_YOUR_SERVER.JSON:/conf/server.json registry.gitlab.com/secata/platform/did/did-verifier-backend:latest 

Navigate to http://localhost:8000/openapi to start interacting with the Credential Verification Service (CVS).

You can interact with the CVS by calling the different endpoints through the user interface. As an example you can start a new presentation by calling presentation/oid4vp/new-request. This endpoint should return a request id and a request uri. You can confirm that a new verification session was created by pasting the requestId in the testnet's search bar. You should see a newly created contract - this is the verification session you have created.

What's next?

The CVS is now configured to interact with wallets and verify presentations received from them. To make the most of your CVS setup, follow these actions based on your needs:

  1. Requesting a verifiable presentation: To request a verifiable presentation from a wallet, you must first specify a presentation definition.

  2. Integrating CVS with your application: To integrate the CVS into your application and receive verification results, follow these steps.

  3. Configuring the Registry: If you wish to change or update the registry, refer to the registry configuration guide.

  4. Updating the Storage Blockchain: To change or update the blockchain used for storage, refer to the storage configuration guide.

Partisia All Rights Reserved © 2023