Crates.io | affinidi-messaging-mediator |
lib.rs | affinidi-messaging-mediator |
version | 0.7.6 |
source | src |
created_at | 2024-09-09 18:13:06.011287 |
updated_at | 2024-09-24 11:36:08.064398 |
description | DIDComm Mediator service for Affinidi Messaging |
homepage | https://affinidi.com/ |
repository | |
max_upload_size | |
id | 1369627 |
size | 415,877 |
[[TOC]]
A DIDComm Messaging v2 mediator & relay service that listens to send &receive messages over https.
To run the mediator, it requires these packages that is also part of the Affinidi Messaging project.
To build and run this project, you need to set up the following:
Run Redis docker container using the command below:
docker run --name=redis-local --publish=6379:6379 --hostname=redis --restart=on-failure --detach redis:latest
Navigate to the affinidi-messaging-mediator
subfolder and create certificates for affinidi-messaging-mediator
service:
cd affinidi-messaging-mediator
cargo run --example create_local_certs
This will generate certificate files in the affinidi-messaging-mediator/conf/keys
folder. You should use client.chain
file to override the default SSL certificates in affinidi-messaging-sdk
, like:
let mut config = Config::builder()
.with_ssl_certificates(&mut vec![
"../affinidi-messaging-mediator/conf/keys/client.chain".into()
])
In the same affinidi-messaging-mediator
subfolder run the following command to generate DID and the corresponding keys:
cargo run --example generate_secrets
This will generate affinidi-messaging-mediator/conf/secrets.json-generated
file containing a did:peer together with the pair of keys for verification and encryption and jwt_authorization_secret
you shall use for jwt_authorization_secret
value in mediator.toml
.
Use the generated did:peer as a value for <MEDIATOR_DID>
placeholder in following commands as well as in affinidi-messaging-sdk - Examples.
Save the generated secrets.json-generated
file as affinidi-messaging-mediator/conf/secrets.json
.
Start affinidi-messaging-mediator
service via:
cd affinidi-messaging-mediator
export MEDIATOR_DID=did://<MEDIATOR_DID>
export REDIS_URL=redis://@localhost:6379
cargo run
Refer to affinidi-messaging-sdk - Examples.