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.
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.
- Node.js (v18 or higher)
- npm (v8 or higher)
- Access to
.env
configurations (see example below)
Clone the Repository:
git clone https://github.com/valyu-network/valyu-did.git
cd valyu-did
Install Dependencies:
npm install
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.
Start the server locally with:
npm start
This will run the project at http://localhost:3000
.
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.
For comprehensive API testing and documentation, access our Postman collection:
This collection includes detailed requests and responses for each endpoint, helping you to effectively integrate and test the Valyu-DID APIs.
For those interested in deploying using Docker, the Valyu-DID Docker image is available on DockerHub:
DockerHub: yorkeccak/valyu-did
-
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.
- Request Body:
-
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.
- Request Body:
-
Resolve DID (POST /resolveDID): Resolve a DID and retrieve the associated DID document.
- Request Body:
did
(required). - Success Response: Returns the resolved DID document.
- Request Body:
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.
- Use camelCase for variable names and function names.
- Keep functions small and focused.
- Document your code where necessary.
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
.
This project is currently unlicensed and proprietary. Please contact us for any inquiries regarding usage or licensing.