openwallet-foundation / acapy

ACA-Py is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://aca-py.org
Apache License 2.0
412 stars 512 forks source link

unable to receive `state = credential_acked` #535

Closed emptybytes closed 4 years ago

emptybytes commented 4 years ago

I have issued credential to my subject.

On my subject webhook (agent), I have traced all the state till credential_received.. next I am waiting for state=credential_acked to get credential_id.

when and how I will get credential acknowledgement.?

happppyboy commented 4 years ago

Do you store the received credential? You should store the credential in holder, then issuer and holder are communicate with ack. Also you can set the agent option(--auto-store-credential, default: false), then the set agent is working to store the received credential after receive credential from issuer.

sklump commented 4 years ago

The holder does not receive an acknowledgement. The holder sends an acknowledgement to the issuer. The end state for the credential exchange is,

happppyboy commented 4 years ago

You can see that the state is set V10CredentialExchange.STAKE_ACKED (equals "credential_acked") after receive the credential ack from issuer. In source: https://github.com/hyperledger/aries-cloudagent-python/blob/master/aries_cloudagent/protocols/issue_credential/v1_0/manager.py?#L678

emptybytes commented 4 years ago

The holder does not receive an acknowledgement. The holder sends an acknowledgement to the issuer. The end state for the credential exchange is,

  • for the issuer: "credential_acked"
  • for the holder: "credential_received". Note that by default, aca-py deletes credential exchanges once the exchange completes - specify --preserve-exchange-records to retain them.

The holder does not receive an acknowledgement. The holder sends an acknowledgement to the issuer. The end state for the credential exchange is,

  • for the issuer: "credential_acked"
  • for the holder: "credential_received". Note that by default, aca-py deletes credential exchanges once the exchange completes - specify --preserve-exchange-records to retain them.

Ok I understood thanks for the clarification.

So In faber/alice demo, alice is holder, just want to understand why they are validating credential_acked( https://github.com/hyperledger/aries-cloudagent-python/blob/master/demo/runners/alice.py#L84).

emptybytes commented 4 years ago

Do you store the received credential? You should store the credential in holder, then issuer and holder are communicate with ack. Also you can set the agent option(--auto-store-credential, default: false), then the set agent is working to store the received credential after receive credential from issuer.

basically I am storing credentially manually ( Store APIs ).

Let me apply --auto-store-credential and check.

sklump commented 4 years ago

You can see that the state is set V10CredentialExchange.STAKE_ACKED (equals "credential_acked") after receive the credential ack from issuer. In source: https://github.com/hyperledger/aries-cloudagent-python/blob/master/aries_cloudagent/protocols/issue_credential/v1_0/manager.py?#L678

Note that the issuer is running the software too - this is the issuer, receiving the holder's ack.

sklump commented 4 years ago

The holder does not receive an acknowledgement. The holder sends an acknowledgement to the issuer. The end state for the credential exchange is,

  • for the issuer: "credential_acked"
  • for the holder: "credential_received". Note that by default, aca-py deletes credential exchanges once the exchange completes - specify --preserve-exchange-records to retain them.

The holder does not receive an acknowledgement. The holder sends an acknowledgement to the issuer. The end state for the credential exchange is,

  • for the issuer: "credential_acked"
  • for the holder: "credential_received". Note that by default, aca-py deletes credential exchanges once the exchange completes - specify --preserve-exchange-records to retain them.

Ok I understood thanks for the clarification.

So In faber/alice demo, alice is holder, just want to understand why they are validating credential_acked( https://github.com/hyperledger/aries-cloudagent-python/blob/master/demo/runners/alice.py#L84).

On storage of the credential, the holder's operation marks the credential exchange record state as "credential_acked" (https://github.com/hyperledger/aries-cloudagent-python/blob/634ea6c5af4da2dddd3e2cc356526f88aa4c5150/aries_cloudagent/protocols/issue_credential/v1_0/manager.py#L655) and saves it https://github.com/hyperledger/aries-cloudagent-python/blob/634ea6c5af4da2dddd3e2cc356526f88aa4c5150/aries_cloudagent/protocols/issue_credential/v1_0/manager.py#L661

emptybytes commented 4 years ago

Understand the flow, and working as expected.

Thanks @msjeong482 @sklump for your support.

nuwairah-aimi commented 10 months ago

Hi regarding the --preserve-exchange-records, it retains for the holder side but not on the issuer's side. Is there a way to retain the exchange records for the issuer's side as well?