Skip to content

Commit 529a6f3

Browse files
committed
feat(infra): support for DMQ protocol in aggregator infrastructure
1 parent f4f5bbe commit 529a6f3

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
mithril-aggregator:
3+
environment:
4+
- DMQ_NODE_SOCKET_PATH=/ipc/dmq.socket
5+
- NETWORK=${NETWORK}
6+
- NETWORK_MAGIC=${NETWORK_MAGIC}
7+
mithril-aggregator-relay:
8+
volumes:
9+
- ../data/${NETWORK}/mithril-aggregator/cardano/ipc:/ipc
10+
environment:
11+
- DMQ_NODE_SOCKET_PATH=/ipc/dmq.socket
12+
- NETWORK=${NETWORK}
13+
- NETWORK_MAGIC=${NETWORK_MAGIC}

mithril-infra/mithril.aggregator.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ EOT
7676
inline = [
7777
"set -e",
7878
"export NETWORK=${var.cardano_network}",
79+
"export NETWORK_MAGIC=${var.cardano_network_magic_map[var.cardano_network]}",
7980
"export CARDANO_IMAGE_ID=${var.cardano_image_id}",
8081
"export CARDANO_IMAGE_REGISTRY=${var.cardano_image_registry}",
8182
"export MITHRIL_IMAGE_ID=${var.mithril_image_id}",
@@ -157,6 +158,10 @@ fi
157158
if [ "${local.mithril_aggregator_is_follower}" = "true" ]; then
158159
DOCKER_COMPOSE_FILES="$DOCKER_COMPOSE_FILES -f $DOCKER_DIRECTORY/docker-compose-aggregator-follower-override.yaml"
159160
fi
161+
# Support for DMQ protocol
162+
if [ "${var.mithril_p2p_use_dmq_protocol}" = "true" ]; then
163+
DOCKER_COMPOSE_FILES="$DOCKER_COMPOSE_FILES -f $DOCKER_DIRECTORY/docker-compose-aggregator-p2p-dmq-override.yaml"
164+
fi
160165
EOT
161166
,
162167
"docker compose $DOCKER_COMPOSE_FILES --profile all up -d",

mithril-infra/variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ variable "cardano_network" {
1414
description = "The Cardano network name to attach: preview, preprod or mainnet"
1515
}
1616

17+
variable "cardano_network_magic_map" {
18+
type = map(number)
19+
description = "The Cardano network magic number mapping from Cardano network name"
20+
default = {
21+
"mainnet" = 764824073,
22+
"preprod" = 1,
23+
"preview" = 2,
24+
}
25+
}
26+
1727
locals {
1828
environment_name_short = format("%s%s", "${var.environment_prefix}-${var.cardano_network}", var.environment_suffix != "" ? "-${var.environment_suffix}" : "")
1929
environment_name = "mithril-${local.environment_name_short}"
@@ -184,6 +194,12 @@ variable "mithril_use_p2p_network" {
184194
default = false
185195
}
186196

197+
variable "mithril_p2p_use_dmq_protocol" {
198+
type = bool
199+
description = "Use the Decentralized Message Queue protocol (DMQ) (experimental, for test only)"
200+
default = false
201+
}
202+
187203
variable "mithril_p2p_network_bootstrap_peer" {
188204
type = string
189205
description = "The dial to address of a bootstrap peer of the P2P network layer. Useful when setting-up a follower aggregator and signers in a different VM. (experimental, for test only)"
@@ -457,6 +473,7 @@ variable "mithril_signers" {
457473
type = string
458474
pool_id = string
459475
}))
476+
description = "The Mithril signers configuration to deploy"
460477
default = {
461478
"1" = {
462479
type = "unverified-cardano-passive",

0 commit comments

Comments
 (0)