Skip to content

An implementation of the Valyu DID method specification, providing RESTful APIs for creating and resolving Valyu DIDs.

License

Notifications You must be signed in to change notification settings

valyu-network/valyu-did

Repository files navigation

ValyuDID

Welcome to the ValyuDID repository! This project acts as an implementation of the Valyu DID method specification (outlined in DDOC.md), and facilitates the creation and resolution of Valyu DIDs using RESTful APIs, and a simple SQL database.

Overview 📖

ValyuDID provides a suite of endpoints to manage DIDs, enabling interactions such as creating new DIDs for users and data, and resolving existing DIDs through a custom-built Veramo-based resolver.

Getting Started 🚀

Prerequisites 📋

  • Node.js (v18 or higher)
  • npm (v8 or higher)
  • Access to .env configurations (see example below)

Setting Up the Environment 🛠️

Clone the Repository:

git clone https://github.com/valyu-network/valyu-did.git
cd valyu-did

Install Dependencies:

npm install

Configuration 🛠️

Environment Variables:

Create a .env file in the root directory and populate it with the necessary secrets:

KMS_SECRET_KEY=<Your_Secret_Key>

The KMS_SECRET_KEY can be any string, like a password. It's used for key management operations within Veramo.

Running the Project 🌐

Start the server locally with:

npm start

This will run the project at http://localhost:3000.

Usage 🛠️

The server exposes three primary endpoints:

  • POST /createUserDID - Create a new user DID.
  • POST /createDataDID - Create a new data DID.
  • POST /resolveDID - Resolve an existing DID.

These endpoints allow you to interact with the blockchain and manage DIDs efficiently.

Postman API Documentation 📚

For comprehensive API testing and documentation, access our Postman collection:

Valyu-DID Postman Collection

This collection includes detailed requests and responses for each endpoint, helping you to effectively integrate and test the Valyu-DID APIs.

Docker Image 🐳

For those interested in deploying using Docker, the Valyu-DID Docker image is available on DockerHub:

DockerHub: yorkeccak/valyu-did

APIs Included in the Collection:

  • Create Data DID (POST /createDataDID): Create a new data DID.

    • Request Body: alias, dataTokenAddress, chainId, accessEndpoint.
    • Success Response: Returns a DID document for the registered data asset.
  • Create User DID (POST /createUserDID): Create a new user DID.

    • Request Body: alias (required).
    • Success Response: Returns a DID document for the newly created user identity.
  • Resolve DID (POST /resolveDID): Resolve a DID and retrieve the associated DID document.

    • Request Body: did (required).
    • Success Response: Returns the resolved DID document.

Contributing 🤝

We welcome contributions from the community! Please follow these steps:

  • Fork the repository.
  • Create a new branch for your feature.
  • Commit your changes.
  • Push to the branch.
  • Submit a pull request.

Conventions

  • Use camelCase for variable names and function names.
  • Keep functions small and focused.
  • Document your code where necessary.

Docker Deployment 🐳

This project includes a Dockerfile for building and running the app in a containerized environment. To build and run the Docker container, use:

docker build -t valyudid .
docker run -p 3000:3000 valyudid

This will expose the application on port 3000, accessible via http://localhost:3000.

License 📄

This project is currently unlicensed and proprietary. Please contact us for any inquiries regarding usage or licensing.

About

An implementation of the Valyu DID method specification, providing RESTful APIs for creating and resolving Valyu DIDs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published