openwallet-foundation / acapy

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
408 stars 512 forks source link

How the Mediator Knows Which Connection to Use #3217

Open Arif-Shahriar028 opened 1 month ago

Arif-Shahriar028 commented 1 month ago

In ACA-Py, when a message needs to be forwarded to a mobile wallet, how the mediator determines which WebSocket connection (session) to use? How websocket connections are managed? Any insight will be very much appreciated!

swcurran commented 1 month ago

Here is a rough overview off the top of my head.

I think it is that last bit you are looking for. The overall process is covered in RFC 0046 Mediators and Relays, RFC 0211 Mediator Coordination and RFC 0685 Pickup Protocol v2.

The painful part as that is described is that the mediator can not horizontally scale (many instances) because the websockets have to remain connected to the same instance of ACA-Py that is the mediator. There is a component Aries SocketDock that addresses this — allowing ACA-Py to scale, but AFAIK, no one has published an open source DIDComm Mediator that has SocketDock support. For now, we just throw hardware at the mediator. Not ideal, but…

Hope that helps.