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.