did:cheqd Plugin¶
Description¶
This plugin contains the components needed for ACA-Py to use did:cheqd method for did creation and Anoncreds issuance, presentation and revocation. It also contains the Base class definitions for DIDRegistrar
and DIDManager
.
Operations¶
The did:cheqd Manager plugin supports following new endpoints:
- POST /did/cheqd/create
- POST /did/cheqd/update
- POST /did/cheqd/deactivate
The did:cheqd Manager plugin supports did:cheqd
for the following existing endpoints:
- POST /anoncreds/schema
- POST /anoncreds/credential-definition
- POST /anoncreds/revocation/revoke
- GET /resolver/resolve/{did}
- GET /wallet/did
- GET /wallet/did/public
Developer Notes¶
The best way to develop and test this plugin is to use the DevContainer configured in this repository (configurations provided in the .devcontainer
folder).
- Open devcontainer in VS Code.
- Python and all dependencies will be loaded.
- Poetry will be loaded and configured, dependencies will be installed.
- Docker and Docker Compose will be available.
Configuration¶
- The plugin expects a DID Registrar and a DID Resolver URL to be provided. It is recommended that the registrar and resolver are run locally. The URLs can be passed via
plugin-config.yml
. - The plugin works only with
askar-anoncreds
wallet type. - Using a Postgres DB as wallet storage type is also recommended.
Running with the configuration¶
An example configuration for the plugin can be found in default.yml
Pre-requisites¶
# Install the plugin locally
pip install -e .
# If using local Cheqd DID registrar, set the environment variables
export FEE_PAYER_TESTNET_MNEMONIC="..."
export FEE_PAYER_MAINNET_MNEMONIC="..."
# start the registrar, resolver and postgres-db services locally, if needed
docker-compose -f ./docker/docker-compose.yml up -d
# For first time only, provision the wallet
aca-py provision --arg-file ./docker/provision.yml
Running the plugin¶
- If you are using your own DID registrar and resolver, update the urls in plugin-config.yml file.
Testing¶
Unit Tests¶
A coverage report is created when ran from the devcontainer.Integration Tests¶
All integrations tests and configurations are in integration
folder.
To run the integration tests:
Deploy¶
For production use, this plugin should be installed as libraries to an ACA-Py image.
This requires having a Dockerfile and a config file for your agent.
Example Dockerfile:
FROM ghcr.io/openwallet-foundation/acapy:py3.12-1.1.0
USER root
# install plugins as binaries
RUN pip install git+https://github.com/openwallet-foundation/acapy-plugins@main#subdirectory=cheqd
USER $user
COPY ./configs configs
ENTRYPOINT ["aca-py"]
An example config file is provided here.
Now you can deploy a agent with as many plugins as you want as long as they are declared in your build config file and installed.