Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added events for successful registration of did-document, schema and credential status #362

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

arnabghose997
Copy link
Contributor

This PR intends to introduce events upon successful registration of DID Document, Schema and Credential Status. The following are the description of events

Event Name Key Value
create_did tx_author <Transaction author's address >
create_schema tx_author <Transaction author's address >
create_credential_status tx_author <Transaction author's address >

After connecting to the WebSocket server of hid-node, subscribing to these events can done as follows:

{"jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "create_did.tx_author='hid1arpjwnd5ujt5lrgvah49nyy63qmunfeh085y4v'"}}
{"jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "create_schema.tx_author='hid1arpjwnd5ujt5lrgvah49nyy63qmunfeh085y4v'"}}
{"jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "create_credential_status.tx_author='hid1arpjwnd5ujt5lrgvah49nyy63qmunfeh085y4v'"}}

The transactions can also fetched using the following API endpoint:

<API_HOST>/cosmos/tx/v1beta1/txs?events="create_did.tx_author='hid1jx7uayq98zgwzrqchfpcpfr4508za04krwxp3a'"

The above endpoint fetches those transactions where the event create_did has the attribute tx_author value to be hid1jx7uayq98zgwzrqchfpcpfr4508za04krwxp3a

@arnabghose997 arnabghose997 added enhancement New feature or request hid-node ssi labels Jul 17, 2023
@arnabghose997 arnabghose997 self-assigned this Jul 17, 2023
@arnabghose997 arnabghose997 merged commit 20281bc into develop Jul 20, 2023
2 checks passed
@arnabghose997 arnabghose997 deleted the ssi-events branch July 20, 2023 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hid-node ssi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants