Set up Veramo CLI for cheqd
If you're looking to use the Veramo CLI with cheqd or develop a proof-of-concept application, use the official Veramo CLI setup guide.
Step 1: Install requisite packages
Node version recommended Nodev16
. You can install Node here
1.1. Install Veramo CLI
This step is exactly as described in Veramo CLI docs:
Note: Depending on your system permissions, you might be prompted for additional permissions. Add sudo
to the beginning of the command in case that happens.
Verify the installation was correct. Command below should output latest version of veramo you installed.
1.2. Install the did-provider-cheqd
package
did-provider-cheqd
packageInstall the did-provider-cheqd
NPM package in a similar fashion:
You can check all of your NPM package versions by running the command:
Step 2: Modify the cheqd plugin Agent configuration file
2.1. Get the agent.yml
configuration file
agent.yml
configuration fileDownload the agent.yml
file that contains the configuration for cheqd network to be used with Veramo CLI.
You can do this in terminal through:
Note: Alternatively, you can also fetch this by cloning the did-provider-cheqd
repository.
2.2. Open the agent.yml
file in an editor to customise the config
agent.yml
file in an editor to customise the configYou can open the agent.yml
in a text editor/IDE of your choice to edit a few mandatory settings.
In terminal, you can edit the agent.yml
file using an editor like nano
:
Make sure you provide the actual relative/absolute path to the file.
2.3. Generate a new local database encryption key
By default, the did-provider-cheqd
package has a default SQLite database password, but it's a good idea to modify and change this to a new key unique to your install.
Take the key generated and replace the value under dbEncryptionKey
in the agent.yml
file.
2.4. Set your DID Resolver endpoint
In order to be able to read/query did:cheqd
entries from the ledger, you need to configure a REST API endpoint for a cheqd DID Resolver instance.
The default value is set to resolver.cheqd.net
, which is an instance of the cheqd DID Resolver hosted by the cheqd team. This DID Resolver instance can handle requests for did:cheqd:mainnet
as well as did:cheqd:testnet
namespaces.
If you want, you can replace the url
property with a different REST API endpoint for a different instance of the cheqd DID Resolver.
Alternative/Optional: Use Universal Resolver instead
Note: This configuration is an advanced step and not recommended for most users. Skip it and continue to the next step in most cases, unless you know why you want to switch the resolver interface.
If you plan on interacting with multiple DID methods using Veramo CLI, you can alternatively query did:cheqd
using a Universal Resolver instance instead. This allows your CLI configuration to handle any DID method supported by Universal Resolver.
Firstly, comment out the custom did-cheqd-resolver
entry and uncomment the universal-resolver
entry. This tells Veramo CLI to use the Universal Resolver interface for did:cheqd
.
Also comment out this section for the did-cheqd-resolver
:
Finally, uncomment and configure the universal-resolver
interface:
2.5. Add cheqd-testnet to your Keplr wallet
In order to add cheqd-testnet to your Keplr extension, please follow the following instructions:
Go to Axelar to add a custom network, then replace everything with cheqd-testnet json configuration below.
2.6. Configure your cheqd/Cosmos account keys and RPC endpoints
While reading/querying from the cheqd ledger incurs no cost, if you want to create/update a DID to cheqd ledger, you need to pay transaction fees for the ledger writes.
You need to configure this in under didManager
section as shown above, where you'll need to edit:
cosmosPayerMnemonic
: Mnemonic associated with your cheqd/Cosmos SDK account. This is only stored locally, and the mnemonic is used to reconstitute the account address and keys used to pay for the transaction.rpcUrl
: For bothdid:cheqd:mainnet:
as well asdid:cheqd:testnet:
sections, you can specify a Cosmos SDK RPC endpoint. This endpoint is where transactions are sent to. By default, this is populated withrpc.cheqd.net
(for mainnet) andrpc.cheqd.network
(for testnet), but you can can modify this to a different hosted RPC endpoint for cheqd or even your own local/private RPC endpoint.defaultProvider
: The default cheqd network is set todid:cheqd:testnet
to allow developers to test out network functionality. However, if you prefer, you can switch this out todid:cheqd:mainnet
instead.
2.7. Save the agent.yml
file and exit
agent.yml
file and exitMake sure all your edits above are persisted and saved to a file that you can access.
Step 3: Verify your configuration file is correct
Once you've completed Step 2 above, verify that your Veramo configuration is accurate using the following command. If your configuration is correct, you should get a success message like the one below.
If the
config check
throws an error, check out our troubleshooting guide for Veramo CLI setup to see common errors and fixes.
Next steps
Now that your Veramo CLI installation is successfully set up to work with cheqd, try following our tutorials for creating a new DID or querying existing DIDs.
Last updated