Skip to content

Commit e36367e

Browse files
ff137rblaine95wdbassoncl0ete
authored
✨ Migrate from Indy to Cheqd (#1552)
* 🧪 Create did:cheqd for governance * ✨ Support posting did:cheqd schemas to trust registry * 🚧 Support fetching did:cheqd schemas from TR Need to accommodate slashes in schema id, which is being passed as a query param * 🔧 Disable registering sov did for governance * 🎨 Default cheqd * 🚧 * 🔧 Disable ledger * 🚧 Use cloudcontroller with some field validators removed didx-xyz/aries-cloudcontroller-python#249 * 🐛 TODO: retrieve schema_id from cheqd cred def * 🐛 Fix reading did from cred def id for cheqd * 🚧 Use updated debug branch for cheqd plugin * ♻️ Change sov to cheqd * 🎨 Rename module * 🛂 Remove endorser connection check for revocable cred def * 🎨 Cred def: create_transaction_for_endorser=False * 🧪 Fix unit tests * 👷 Dump DID Registrar/Resolver logs * 🚧 Remove parallel tests command * 🔧 Reduce default registry size to 5000 * 🔧 Set did-registrar log level to warn * 🐛 Match `get_schema` on entire path * 🐛 Replace hack to `get_schema` by matching entire path * 🔧 Set did-registrar log level to warn * 🧪 Fix test: issuer no longer has endorser connection * 🧪 Fix test: remove did:sov * 🧪 Fix schema id assertion * 🧪 Skip setting endpoint for cheqd did * 🐛 Fix registrar log level * 🧪 * 🧪 Cover cheqd schema * 🎨 * 🐛 Add additional path extender * 🐛 Yet another path extender! * 🧪 * 🚧 Update acapy base image * 🚧 Update cheqd plugin - improved logging * 🚧 Use same commit hash for nats and cheqd plugins * 🔥 Remove Indy Ledger from Local Dev (#1566) * 🔥 Remove Indy Ledger from Local Dev * 🥷🦨 Blacksmith 8vCPU runner for local tests * 🔥 Remove Ledger Nodes from Docker Build + Local Tests (#1567) * 🔥 Remove Docker Cache Logs Also disable Mise caching in Local Tests * 🔥 Disable Python venv cache * ⏪ Revert "🔥 Disable Python venv cache" This reverts commit a20fcd1. * 👷 Use bigger Github Runner rather than Blacksmith Re-enable Mise Caching * 🧪 Fix Ed25519 signature version * 🧪 Skip broken did-exchange/rotate tests for now * ⬆️ Use latest plugin commit hash * 👷 Add Cheqd testnet mnemonic to CI/CD (#1569) Configure the GitHub Actions workflow to pass the Cheqd testnet mnemonic secret to the `driver-did-cheqd` component. This allows the driver to interact with the Cheqd testnet blockchain during CI/CD runs and local tests. * The mnemonic is used as a fee-payer account for testnet transactions * Added as a required secret to both `cicd.yml` and `local-tests.yml` workflows * Passed as `FEE_PAYER_TESTNET_MNEMONIC` environment variable to Tilt * 🎨 `mise run fmt` * 🎨 Remove commented out code * 🎨 Fix return types * 📝 Update OpenAPI Specs * 🔥 Delete Indy Ledger in Dev (#1570) * 🔥 Delete Indy Ledger in Dev * Delete Indy Ledger from Helmfile and Dev config * Set `ACAPY_NO_LEDGER` in Dev * 🔧 Configure Cheqd plugin in Dev * 🔧 Set default registry size to 200 * K6: with temporary OOB * 🎨 Remove from create tenant request * 🔧 Remove ACAPY_WALLET_SEED from dev governance agent * 👷 Remove xdist config from pytest * 🔖 5.0.0-rc2 * K6: use OOB invitation * K6: Delete issuers at end of tests * 🔊 Improve error logging in cheqd plugin * 🎨 Remove unused wallet_type arg * 🎨 Improve cheqd error messages * ✨ Support configuring Cheqd network * 🎨 Remove sov from supported methods * ✨ 🐛 Add asyncio.lock to DIDRegistrar * 🎨 Remove wallet type from fixture method * 🚧 Test cheqd plugin fix Force 1 second sleep between sequential requests, and retry if account sequence mismatch occurs * 🎨 Improve error messages when Cheqd resources fail * 🚧 Debug * K6: Re-enable revocation * 🚧 Test queuing pending jobs * ✅ Update fixtures and tests (#1574) * add :path to resolve new ids * update test to make api call * import router * use asyncClient * make api call * use RichAsyncClient * make api call * use RichAsyncClient * make api call * use RichAsyncClient * make api call and respond with model * use RichAsyncClient * change scope * remove import * raise value error if bad test_mode * 🚧 * 🐛 Fix indent * 🚧 * 🚧 * 🚧 * 🔧 Update TESTNET_ENDPOINT for dev * 🧪 Skip test properly for later review * 🚧 Attempt to fix lock write bug * 📝 Update OpenAPI Spec * 🎨 * 🎨 Remove prints * 🚧 Attempt to fix retries * 🔧 GP3 instead of EFS * 🔧 Increase REGISTRY_CREATION_TIMEOUT * 🎨 Fix spec * 🔧 Pod/Container Security Context on MT Agent * 🔧 Acapy Agent Fix volumes --------- Co-authored-by: Robbie Blaine <[email protected]> Co-authored-by: Robbie Blaine <[email protected]> Co-authored-by: wdbasson <[email protected]> Co-authored-by: cl0ete <[email protected]>
1 parent 2a5ec31 commit e36367e

File tree

75 files changed

+745
-860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+745
-860
lines changed

.github/workflows/cicd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ jobs:
156156
mise-version: ${{ needs.prep.outputs.mise-version }}
157157
secrets:
158158
codacy-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
159+
cheqd-mnemonic: ${{ secrets.CHEQD_TESTNET_MNEMONIC }}
159160
concurrency:
160161
group: local-tests-${{ github.ref_name }}
161162
cancel-in-progress: true

.github/workflows/docker-build.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
- agent
2323
- app
2424
- endorser
25-
# - ledger-nodes # AMD64 only
2625
- pytest
2726
- tails-server
2827
- trust-registry
@@ -101,7 +100,6 @@ jobs:
101100
- agent
102101
- app
103102
- endorser
104-
- ledger-nodes
105103
- pytest
106104
- tails-server
107105
- trust-registry
@@ -120,10 +118,6 @@ jobs:
120118
context: .
121119
file: dockerfiles/endorser/Dockerfile
122120
platforms: linux/amd64,linux/arm64
123-
- image: ledger-nodes
124-
context: https://github.com/bcgov/von-network.git#v1.9.0
125-
file: Dockerfile
126-
platforms: linux/amd64
127121
- image: pytest
128122
context: .
129123
file: dockerfiles/tests/Dockerfile
@@ -194,6 +188,4 @@ jobs:
194188
type=gha,scope=build-${{ matrix.image }}-arm64
195189
type=gha,scope=build-${{ matrix.image }}-amd64
196190
type=registry,ref=ghcr.io/${{ github.repository_owner }}/acapy-cloud/${{ matrix.image }}:latest
197-
cache-to: |
198-
${{ matrix.image == 'ledger-nodes' && 'type=gha,mode=max,scope=build-${{ matrix.image }}-amd64' || '' }}
199191
platforms: ${{ matrix.platforms }}

.github/workflows/local-tests.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ on:
1212
secrets:
1313
codacy-token:
1414
required: true
15+
cheqd-mnemonic:
16+
required: true
1517

1618
permissions: {}
1719

1820
jobs:
1921
local:
2022
name: Local End-to-End
21-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-8-core-32-gb
2224

2325
timeout-minutes: 30
2426

@@ -57,8 +59,9 @@ jobs:
5759
run: mise run tilt:ci
5860
shell: bash
5961
env:
60-
REGISTRY: ghcr.io/${{ github.repository_owner }}
62+
FEE_PAYER_TESTNET_MNEMONIC: ${{ secrets.cheqd-mnemonic }}
6163
IMAGE_TAG: ${{ inputs.image-version }}
64+
REGISTRY: ghcr.io/${{ github.repository_owner }}
6265

6366
- name: Test with pytest
6467
run: |
@@ -68,12 +71,7 @@ jobs:
6871
cp .env.example .env
6972
source .env
7073
71-
# Any port forwards will not be active after `tilt ci` has exited.
72-
kubectl port-forward svc/ledger-browser 9000:8000 -n cloudapi &
73-
7474
poetry run pytest \
75-
--numprocesses 4 \
76-
--dist loadgroup \
7775
--durations=25 \
7876
--ignore ./tilt \
7977
--cov | tee test_output.txt
@@ -144,9 +142,15 @@ jobs:
144142
# Connect Cloud can generate a lot of logs...
145143
if: always()
146144
run: kubectl logs -n cloudapi -l app.kubernetes.io/instance=connect-cloud --tail 10000
147-
- name: Docker Cache Logs
145+
- name: Cheqd DID Registrar Logs
148146
if: always()
149-
run: docker logs docker-cache
147+
run: kubectl logs -n cloudapi -l app.kubernetes.io/instance=driver-did-cheqd --tail 10000
148+
- name: Cheqd DID Resolver Logs
149+
if: always()
150+
run: kubectl logs -n cloudapi -l app.kubernetes.io/instance=did-resolver --tail 10000
151+
- name: DID Registrar (Universal Registrar) Logs
152+
if: always()
153+
run: kubectl logs -n cloudapi -l app.kubernetes.io/instance=did-registrar --tail 10000
150154
- name: Endorser Logs
151155
if: always()
152156
run: kubectl logs -n cloudapi -l app.kubernetes.io/instance=endorser --tail 10000
@@ -159,12 +163,6 @@ jobs:
159163
- name: Ingress Nginx Logs
160164
if: always()
161165
run: kubectl logs -n ingress-system -l app.kubernetes.io/instance=ingress-nginx --tail 10000
162-
- name: Ledger Browser Logs
163-
if: always()
164-
run: kubectl logs -n cloudapi -l app.kubernetes.io/instance=ledger-browser --tail 10000
165-
- name: Ledger Nodes Logs
166-
if: always()
167-
run: kubectl logs -n cloudapi -l app.kubernetes.io/instance=ledger-nodes --tail 10000
168166
- name: Mediator Logs
169167
if: always()
170168
run: kubectl logs -n cloudapi -l app.kubernetes.io/instance=mediator --tail 10000

.mise/tasks/kind/create

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ EOF
5656
# Cache registries
5757
retry_count=0
5858
while [ $retry_count -lt $MAX_RETRIES ]; do
59+
# Disable Docker cache in CI
60+
if [ -n "${GITHUB_ACTIONS}" ]; then
61+
echo "Skipping Docker cache setup in CI environment."
62+
break
63+
fi
5964
if docker exec "${node}" curl -s -f ${CACHE_SETUP_URL} > /dev/null; then
6065
docker exec "${node}" bash -c "\
6166
curl -s ${CACHE_SETUP_URL} \

.mise/tasks/kind/install/docker-cache

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env bash
22
# mise description="Start up the Docker Pullthrough Cache"
33

4+
# Disable Docker cache in CI
5+
if [ -n "${GITHUB_ACTIONS}" ]; then
6+
echo "Skipping Docker cache setup in CI environment."
7+
exit 0
8+
fi
9+
410
# 'gcr.io' seems to have issues when run in Github Actions
511
# https://github.com/rpardini/docker-registry-proxy/issues/115
612
registries="quay.io ghcr.io registry.k8s.io"

Tiltfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,8 @@ if config.tilt_subcommand in ("down"):
9797

9898
if destroy_all:
9999
print(color.red("Destroying Kind cluster and deleting docker registry & cache"))
100-
local(
101-
"docker compose -f ./docker-compose-ledger.yaml down -v",
102-
dir=os.path.dirname(__file__),
103-
)
104100
local("mise run kind:destroy:all", dir=os.path.dirname(__file__))
105101

106102
if destroy:
107103
print(color.red("Destroying Kind cluster"))
108-
local(
109-
"docker compose -f ./docker-compose-ledger.yaml down -v",
110-
dir=os.path.dirname(__file__),
111-
)
112104
local("mise run kind:destroy", dir=os.path.dirname(__file__))

app/models/tenants.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ class CreateTenantRequest(BaseModel):
6262
group_id: Optional[str] = group_id_field
6363
image_url: Optional[str] = image_url_field
6464
extra_settings: Optional[Dict[ExtraSettings, bool]] = ExtraSettings_field
65-
did_method: Optional[Literal["sov", "cheqd"]] = Field(
66-
default="sov",
67-
description="The DID method to use for onboarding the tenant (only used for issuers)",
68-
examples=["sov", "cheqd"],
69-
)
7065

7166
@field_validator("wallet_label", mode="before")
7267
@classmethod

app/models/wallet.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Optional
1+
from typing import List, Literal, Optional
22

33
from aries_cloudcontroller.models.did_create import DIDCreate as DIDCreateAcaPy
44
from aries_cloudcontroller.models.did_create_options import DIDCreateOptions
@@ -36,10 +36,10 @@ class DIDCreate(BaseModel):
3636
# Downstream processes should use the `to_acapy_options` method to convert the model's fields
3737
# into the `DIDCreateOptions` structure expected by ACA-Py.
3838

39-
_supported_methods = ["cheqd", "sov", "key", "web", "did:peer:2", "did:peer:4"]
39+
_supported_methods = ["cheqd", "key", "web", "did:peer:2", "did:peer:4"]
4040

4141
method: Optional[StrictStr] = Field(
42-
default="sov",
42+
default="cheqd",
4343
description=(
4444
"Method for the requested DID. Supported methods are "
4545
f"{', '.join(_supported_methods)}."
@@ -59,6 +59,11 @@ class DIDCreate(BaseModel):
5959
default=None,
6060
description="Specify the final value of DID (including `did:<method>:` prefix) if the method supports it.",
6161
)
62+
network: Optional[Literal["mainnet", "testnet"]] = Field(
63+
default=None,
64+
description="Specify the network to use for Cheqd DIDs. Valid values are `mainnet` and `testnet`.",
65+
examples=["mainnet", "testnet"],
66+
)
6267

6368
def to_acapy_options(self) -> DIDCreateOptions:
6469
"""

app/routes/admin/tenants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ async def create_tenant(
189189
roles=roles,
190190
wallet_auth_token=wallet_response.token,
191191
wallet_id=wallet_response.wallet_id,
192-
did_method=body.did_method,
193192
)
194193
bound_logger.debug("Registering actor in the trust registry")
195194
await register_actor(

app/routes/definitions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ async def get_schemas(
174174

175175

176176
@router.get(
177-
"/schemas/{schema_id}",
177+
"/schemas/{schema_id:path}",
178178
summary="Get a Schema",
179179
response_model=CredentialSchema,
180180
)
@@ -384,7 +384,7 @@ async def get_credential_definitions(
384384

385385

386386
@router.get(
387-
"/credentials/{credential_definition_id}",
387+
"/credentials/{credential_definition_id:path}",
388388
summary="Get a Credential Definition",
389389
response_model=CredentialDefinition,
390390
)

0 commit comments

Comments
 (0)