0xPolygonID / issuer-node

Polygon ID Self-Hosted Issuer Node
Apache License 2.0
83 stars 73 forks source link

Privado ID Issuer Node

Checks golangci-lint

Streamline the Verifiable Credentials issuance process with the user-friendly API and UI of the Issuer Node within the Privado ID ecosystem. The on-premise (self-hosted) Issuer Node, seamlessly integrated with a robust suite of tools including the mobile Wallet, Schema Builder, and Credential Marketplace, guarantees a frictionless experience for effortlessly issuing and verifying credentials.

Triagle-of-trust

Features:


Table of Contents

Quick Start Installation

[!NOTE] The provided installation guide is non-production ready. For production deployments please refer to Standalone Mode Guide.

There is no compatibility with Windows environments at this time. While using WSL should be ok, it's not officially supported.

Prerequisites

Issuer Node API

In this section we will cover the installation of the Issuer Node API.

[!NOTE] This Quick Installation Guide is prepared for Polygon Amoy (Testnet) both for the state contract and issuer dids. If you want to deploy the node with Polygon Main configuration, please visit our advanced Issuer Node configuration guide).

Deploy Issuer Node Infrastructure

  1. Copy the config sample files:

    cp .env-issuer.sample .env-issuer
    cp .env-api.sample .env-api
  2. Fill the .env-issuer config file with the proper variables:

    .env-issuer

    ISSUER_ETHEREUM_URL=<YOUR_RPC_PROVIDER_URI_ENDPOINT>
  3. Start the infrastructure:

    make up
  4. Enable vault authentication:

    make add-vault-token
  5. Write the private key in the vault. This step is needed in order to be able to transit the issuer's state. To perform that action the given account has to be funded. For Amoy network you can request some testing Matic here.

    make private_key=<YOUR_WALLET_PRIVATE_KEY> add-private-key

Troubleshooting:

In order to stop and delete all the containers.

[!WARNING] This will permanently delete all data, making it necessary to create an Issuer DID again.

make down

If you experience problems with the vault, follow these commands:

docker stop issuer-vault-1    // Stops the container issuer-vault-1 
docker rm issuer-vault-1      // Removes container issuer-vault-1
make clean-vault              // Removes all the data in the vault, including the token
make up                       // Starts the database, cache and vault storage (i.e, postgres, redis and vault)

Wait 20 secs so the vault can boot and generate a token.

make add-vault-token                                          // Adds the generated token to the ISSUER_KEY_STORE_TOKEN var in .env-issuer
make private_key=<YOUR_WALLET_PRIVATE_KEY> add-private-key    // Stores the private key in the vault

Run Issuer Node API

The issuer node is extensively configurable, for a detailed list of the configuration, please visit our detailed configuration guide.

  1. Fill the .env-issuer config file with the proper variables:

    .env-issuer

    ISSUER_API_AUTH_USER=user-issuer
    ISSUER_API_AUTH_PASSWORD=password-issuer
    ISSUER_SERVER_URL=<PUBLICLY_ACCESSIBLE_URL_POINTING_TO_ISSUER_SERVER_PORT>
  2. Run api:

    make run

Core API specification - http://localhost:3001/


Troubleshooting:

Restart the api.

make restart-api

Issuer Node UI

In this section we will cover the installation of the Issuer Node UI, before continuing with these steps, make sure that you have followed the Deploy Issuer Node Infrastructure section before continuing.

In order to make the UI work, we will need configure some env variables in the .env-api file

  1. Copy .env-ui sample file and fill the needed env variables:

    cp .env-ui.sample .env-ui

    .env-ui

    ISSUER_UI_AUTH_USERNAME=user-ui
    ISSUER_UI_AUTH_PASSWORD=password-ui

    .env-api

    ISSUER_API_UI_SERVER_URL={PUBLICLY_ACCESSIBLE_URL_POINTING_TO_ISSUER_API_UI_SERVER_PORT}

    NOTE: It is possible to register custom did methods. This field accepts an array of objects in JSON format.
    Example:

    ISSUER_CUSTOM_DID_METHODS='[{"blockchain":"linea","network":"testnet","networkFlag":"0b01000001","chainID":59140}]'
  2. Generate Issuer DID:

    make generate-issuer-did
  3. Run UI:

    make run-ui

API UI specification - http://localhost:3002/

UI - http://localhost:8088/


Troubleshooting:

Restart the ui:

make restart-ui

Quick Start Demo

This Quick Start Demo will walk you through the process of issuing and verifying your first credential.

Documentation

Tools

[!WARNING] Demo Issuer and Verifier Demo are for testing purposes only.

License

See LICENSE.