Skip to main content

Update a Credential Schema

Update the validity periods attached to an existing credential schema. This does not change the JSON Schema itself or the permission management modes; it only adjusts how long validations remain effective for each role.

tip

Only the account that controls the trust registry that owns this credential schema can run this command.

Message Parameters

NameDescriptionMandatory
credential-schema-idID of the credential schema to updateyes
issuer-grantor-validityMax days an Issuer‑Grantor validation remains validyes
verifier-grantor-validityMax days a Verifier‑Grantor validation remains validyes
issuer-validityDays an Issuer validation remains validyes
verifier-validityMax days a Verifier validation remains validyes
holder-validityMax days a Holder validation remains validyes

Post the Message

Usage

veranad tx cs update <credential-schema-id> <issuer-grantor-validity> <verifier-grantor-validity> <issuer-validity> <verifier-validity> <holder-validity> --from <user> --chain-id <chain-id> --keyring-backend test --fees <amount> --gas auto --node $NODE_RPC

Copy‑pasteable example

Set your environment (adjust values):

SCHEMA_ID=10
USER_ACC="mat-test-acc"
CHAIN_ID="vna-testnet-1"
NODE_RPC=http://node1.testnet.verana.network:26657

Increase Issuer/Verifier periods and keep grantor/holder at 365 days:

veranad tx cs update $SCHEMA_ID 365 365 280 280 365 --from $USER_ACC --chain-id $CHAIN_ID --keyring-backend test --fees 600000uvna --gas auto --node $NODE_RPC

Verify the update

Query the schema and inspect the validity fields:

veranad query cs get-schema $SCHEMA_ID --node $NODE_RPC --output json | jq

Notes

  • Validity values must be positive integers (days).
  • You cannot change permission management modes (OPEN, GRANTOR_VALIDATION, ECOSYSTEM) with this command; create a new schema if you need different modes.
  • Only the controller of the trust registry that owns the schema can update it.