hypersign-protocol / hid-node

A permissionless blockchain network to manage digital identity and access rights
https://hypersign.id
Apache License 2.0
223 stars 23 forks source link

feat: added CLI commands to generate a minimal DID Document #352

Closed arnabghose997 closed 1 year ago

arnabghose997 commented 1 year ago

The PR aims to introduce CLI commands to generate a minimal DID document, and extend the current create-did capability to refer to the generated DID Document, without the need of explicitly specifying the DID Document JSON.

  1. Generation of a DID Document using an alias:
hid-noded ssi-tools generate-did --from <name or address of account> --keyring-backend <test is the only supported keyring backend> --did-alias <name of the DID Document alias> --did-namespace <Optional Flag to specify the DID Namespace>

Example:
hid-noded ssi-tools generate-did --from node1 --keyring-backend test --did-alias production1
hid-noded ssi-tools generate-did --from node1 --keyring-backend test --did-alias production1 --did-namespace devnet
  1. List all the DID aliases generated:
hid-noded ssi-tools list-did-aliases
  1. Show the DID Document of a particular DID alias
hid-noded ssi-tools show-did-by-alias [alias-name]

Example:
hid-noded ssi-tools show-did-by-alias production1
  1. Register the DID Alias on-chain
hid-noded tx ssi create-did --did-alias <name of the DID Document alias>

Example:
hid-noded tx ssi create-did --did-alias production1 --from node1 --keyring-backend test --broadcast-mode block --chain-id hidnode

Note: If the author of the CreateDID Transaction is not the author of the referred DID Alias, the transaction will fail.