DID Document Management
Every blocklet is identified by a Decentralized Identifier (DID), which is associated with a DID Document. This document contains crucial metadata, such as public keys and service endpoints, allowing other services to discover and interact with your blocklet securely. While Blocklet Server typically manages this document automatically, there are situations where a manual update is necessary.
This section covers how to use the CLI to manage your blocklet's DID document.
Update DID Document#
The blocklet document update command allows you to manually refresh and republish the DID document for a specific blocklet. This is useful for ensuring the on-chain information is perfectly synchronized with your blocklet's current configuration.
Usage#
command
blocklet document update <appId>Arguments#
Argument | Description |
|---|---|
| The DID of the blocklet to be updated. |
Example#
Running the command will trigger the update process, showing a spinner while it communicates with the node.
blocklet document update z8ia12z3ySA1J5694T1aW3E8a3z3e1X9V3E2Upon successful completion, you will see a confirmation message:
✔ Updating...
✔ Update did document for z8ia12z3ySA1J5694T1aW3E8a3z3e1X9V3E2 successfully!If the blocklet with the specified appId cannot be found, the command will fail with an error:
✖ Failed to update did document for blocklet z8ia12z3ySA1J5694T1aW3E8a3z3e1X9V3E2, error: Blocklet z8ia12z3ySA1J5694T1aW3E8a3z3e1X9V3E2 not foundCommon Use Cases#
You might need to use this command in the following scenarios:
- After Configuration Changes: If you've manually altered settings that affect the blocklet's public-facing endpoints or metadata, running this command ensures those changes are reflected in the DID document.
- Troubleshooting: When encountering issues with DID resolution, authentication, or service discovery, forcing an update can help rule out synchronization problems.
- State Resynchronization: To ensure the on-chain DID document is a precise representation of the blocklet's current state after a server migration or restoration from backup.