Skip to content

pilacorp/nda-resolver-driver

Repository files navigation

NDA Resolver Driver: did:nda

This is a Universal Resolver driver for did:nda identifiers. The driver resolves did:nda identifiers by making HTTP API calls to the NDA DID resolution service.

Specifications

Example DIDs

did:nda:testnet:0x86977f96a4f0973819d204541b1d9d48424302d9

Environment Configuration

The driver requires the NDA_API_URL environment variable to be set. Copy the example environment file and configure it:

cp .env.example .env

Edit .env and set your API URL:

NDA_API_URL=https://example.com/api/v1/did
# Example full URL: https://example.com/api/v1/did/did:nda:testnet:0x86977f96a4f0973819d204541b1d9d48424302d9

Build and Run (NodeJS - Local Development)

  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
  1. Start the server:
npm start

The server will start on port 8080. You can test it with:

curl -X GET http://localhost:8080/1.0/identifiers/did:nda:testnet:0x86977f96a4f0973819d204541b1d9d48424302d9

Build and Run (Docker)

Build and Run Locally

docker build -t driver-did-nda .
docker run -p 8080:8080 -e NDA_API_URL=https://example.com/api/v1/did driver-did-nda

Or use a .env file:

docker run -p 8080:8080 --env-file .env driver-did-nda

Test the container:

curl -X GET http://localhost:8080/1.0/identifiers/did:nda:testnet:0x86977f96a4f0973819d204541b1d9d48424302d9

Push to Docker Hub

  1. Login to Docker Hub:
docker login
  1. Tag your image (replace yourusername with your Docker Hub username):
docker tag driver-did-nda yourusername/driver-did-nda:latest
# Optionally tag with a version:
docker tag driver-did-nda yourusername/driver-did-nda:v1.0.0
  1. Push the image:
docker push yourusername/driver-did-nda:latest
docker push yourusername/driver-did-nda:v1.0.0
  1. Run from Docker Hub:
docker run -p 8080:8080 -e NDA_API_URL=https://example.com/api/v1/did yourusername/driver-did-nda:latest

API Endpoint

The driver calls the following API endpoint to resolve DIDs:

{NDA_API_URL}/{full_did_identifier}

Where:

  • NDA_API_URL is configured via the NDA_API_URL environment variable (default: https://example.com/api/v1/did)
  • {full_did_identifier} is the complete DID identifier (e.g., did:nda:testnet:0x86977f96a4f0973819d204541b1d9d48424302d9)

The full URL format is: https://example.com/api/v1/did/{full_did_identifier}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors