This guide provides step-by-step instructions for setting up the Credential Constructor and Datastore services. You will learn how to make the API accessible from your host for seamless interaction, explore the API using the Swagger UI, and enable tracing with Jaeger. This setup is part of the VC Project, a suite of services designed to manage verifiable credentials.
Prerequisites
Before starting, ensure that you have the following tools installed:
- Docker: Ensure Docker is installed and running on your system. Installation Guide
- Docker Compose: If you're using Docker Compose separately, install it. It may already be integrated into Docker.
- Git: Required to clone the repository. Git Installation Guide
What is VC?
VC stands for Verifiable Credential, a set of services that provide functionalities for handling verifiable credentials, including:
ApiGW (API Gateway): Acts as the frontend for backend services, handling external connections and distributing messages to other VC services. It’s stateless, so it can run across multiple servers or data centers.
Datastore: An integration point for storing documents (e.g., PDA1, EHIC) with metadata. It aims to be flexible for various use cases.
Issuer: Issues verifiable credentials based on documents from the Datastore or an authentic source, currently focused on Selective Disclosure JWT (SDJWT).
Verifier: Verifies credentials issued by the system.
Persistent: Stores persistent data, such as authentic source documents, in MongoDB.
Registry: Manages credential registration (still under development).
1. Clone the Repository
To begin, clone the vc_up_and_running repository from GitHub. This contains all the necessary files to set up the VC services.
Code Block | ||
---|---|---|
| ||
git clone git@github.com:dc4eu/vc_up_and_running.git |
...
This will create a local copy of the repository on your machine.
2. Navigate to the Base Directory
Once the repository is cloned, navigate to the base directory where all the service configurations are located.
Code Block | ||
---|---|---|
| ||
cd vc_up_and_running |
...
Ensure that all subsequent commands are run from this directory.
3. Expose
...
Services to the Host
In order to interact with the API from your host machine, you need to expose the relevant service ports. We'll do this by creating a Docker Compose override file that maps the necessary ports.
Steps to expose the API:
Create a
docker-compose.override.yaml
file in the base directory.Add the following configuration to expose the
apigw
andJaeger
ports:
Code Block | ||
---|---|---|
| ||
version: "3"
services:
apigw:
ports:
- "8080:8080"
jaeger:
ports:
- "16686:16686" |
This will expose:
The ports for both the API Gateway and Jaeger services are configured in the .env
file. The following ports are used by default, but they can be customized by modifying the .env
file.
API Gateway:
The APIGW_HOST_PORT
is set in the .env
file. By default, it is set to 8080
.
Access the Swagger documentation:
Jaeger Tracing:
The JAEGER_HOST_PORT
is also set in the .env
file, defaulting to 16686
.
http://127.0.0.1:16686
- The
apigw
service on port8080
. - The
Jaeger
tracing UI on port16686
.
4. Start the Docker Containers
Start the Docker Containers
The start.sh
script will generate a signing key if one doesn’t exist and then With the ports configured, start the Docker containers using the following command:
docker compose up
...
. Run it with:
Code Block | ||
---|---|---|
| ||
./start.sh |
5. Access the Swagger UI for API Exploration
Once the containers are running, you can explore the API using Swagger, which provides an interactive interface for testing the API.
...
Here, you can view the available API endpoints, test them, and explore the documentation.
Jaeger Tracing
Jaeger is used to trace the flow of requests across the VC services, enabling you to monitor distributed transactions.
...
This will allow you to monitor the internal communications between the services in real-time.
Next Steps
After exploring the Swagger UI, you can interact with the API directly using
APIclients such as curl or Postman. For more information regarding the API, please see this page: Authentic Source using Datastore and Issuer to issue credentials
- Modify the service configurations as needed for your environment or development purposes.
...
- .