The aries-framework-go project can be used as a DIDComm Router/Mediator. The agents that do not have inbound transport can register with the router. Basically, the agent asks another agent to route the messages to it by asking for permission. On successful grant, agent receives the endpoint and routing key details. These details are used in DID Exchange Invitation or DID Document Service Descriptor.
To set up the project as a mediator, configure WebSocket
for inbound and outbound communication.
// add http inbound and outbound
opts = append(opts, http_inbound, http_outbound))
// add websocket inbound and outbound
inbound, err := ws.NewInbound(...)
if err != nil {
return err
}
opts = append(opts, aries.WithInboundTransport(inbound), aries.WithOutboundTransports(ws.NewOutbound()))
framework := aries.New(aries.WithInboundTransport(inbound), aries.WithOutboundTransports(ws.NewOutbound()))
- ARIESD_INBOUND_HOST=http@$<http_internal>,ws@$<ws_internal>
- ARIESD_INBOUND_HOST_EXTERNAL=http@$<http_extenal_url>,ws@$<ws_extenal_url>
- ARIESD_OUTBOUND_TRANSPORT=http,ws
The project supports DIDComm between two agents without inbound capability through a router. The framework needs to be initialized with Transport Return route options.
// create the framework with Transport return route and websocket outbound
framework := aries.New(aries.WithTransportReturnRoute("all"), aries.WithOutboundTransports(ws.NewOutbound())
- ARIESD_TRANSPORT_RETURN_ROUTE=all
- ARIESD_OUTBOUND_TRANSPORT=ws
Currently, framework supports limited set of features.
- Supports only
all
transport route option. - Supports only
websocket
for duplex communication. ie, websocket needs to be used as the Outbound transport while initializing the framework for agents without inbound capabilities. - Aries RFC 0211: Mediator Coordination Protocol : No support for Key List Query and Key List messages - Issue #942.
- Aries RFC 0094: Forward Message : Uses recipient key in the
to
field instead of DID keyid - Issue #965. - Aries RFC 0212: Pickup Protocol : No support for Message Query With Message Id List message - Issue #2351.