Skip to content

Commit 9d67c9b

Browse files
committed
Start verified signer node as block producer
1 parent b1c9555 commit 9d67c9b

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

mithril-infra/assets/docker/docker-compose-signer-verified.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ services:
2424
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/ipc:/ipc
2525
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/pool:/pool
2626
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/www:/www
27+
ports:
28+
- "${SIGNER_CARDANO_PORT}:${SIGNER_CARDANO_PORT}"
2729
environment:
2830
- CARDANO_SOCKET_PATH=/ipc/node.socket
2931
- CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
@@ -35,7 +37,17 @@ services:
3537
"--topology",
3638
"/config/cardano-node/topology.json",
3739
"--database-path",
38-
"/db"
40+
"/db",
41+
"--host-addr",
42+
"${SIGNER_CARDANO_ADDR}",
43+
"--port",
44+
"${SIGNER_CARDANO_PORT}",
45+
"--shelley-kes-key",
46+
"/pool/kes.skey",
47+
"--shelley-vrf-key",
48+
"/pool/vrf.skey",
49+
"--shelley-operational-certificate",
50+
"/pool/opcert.cert"
3951
]
4052

4153
mithril-signer:

mithril-infra/assets/tools/genesis/update-stake-distribution-signer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exec_sql_signer() {
99
}
1010

1111
fix_stake_distribution_signer() {
12-
LAST_EPOCH=$(exec_sql_aggregator $1 $2 "SELECT MAX(key) FROM stake;")
12+
LAST_EPOCH=$(exec_sql_signer $1 $2 "SELECT MAX(key) FROM stake;")
1313

1414
exec_sql_signer $1 $2 "UPDATE stake SET value = json_insert(json(value), '$.${POOL_ID}', ${POOL_STAKES}) WHERE key = '$LAST_EPOCH';"
1515
exec_sql_signer $1 $2 "SELECT * FROM stake WHERE key = $LAST_EPOCH;"

mithril-infra/assets/tools/pool/create-cardano-pool.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ POOL_PLEDGE=$AMOUNT_STAKED
142142
POOL_COST=$(cat $PROTOCOL_FILE | jq .protocolParams.minPoolCost)
143143
POOL_MARGIN=0.1
144144
POOL_METADATA_URL=$(curl -s https://tinyurl.com/api-create.php?url=https://${SIGNER_NODE}.${DOMAIN}/pool-metadata.json)
145-
POOL_RELAY_URL="https://${SIGNER_NODE}.${DOMAIN}/"
145+
POOL_RELAY_URL="${SIGNER_NODE}.${DOMAIN}"
146146

147147
CARDANO_CLI_CMD stake-pool registration-certificate \
148148
--cold-verification-key-file ${POOL_ARTIFACTS_DIR}/cold.vkey \

mithril-infra/main.firewall.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resource "google_compute_firewall" "mithril-vm-firewall" {
44

55
allow {
66
protocol = "tcp"
7-
ports = ["22", "80", "443"]
7+
ports = concat(["22", "80", "443"], values(local.mithril_signers_cardano_port))
88
}
99

1010
source_ranges = ["0.0.0.0/0"]

mithril-infra/mithril.signer.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
locals {
2-
mithril_signers_index = [for key, signer in var.mithril_signers : key]
2+
mithril_signers_index = [for key, signer in var.mithril_signers : key]
3+
mithril_signers_www_port = { for key, signer in var.mithril_signers : key => index(local.mithril_signers_index, key) + 1 + 8080 }
4+
mithril_signers_cardano_port = { for key, signer in var.mithril_signers : key => index(local.mithril_signers_index, key) + 1 + 9090 }
35
}
46
resource "null_resource" "mithril_signer" {
57
for_each = var.mithril_signers
@@ -38,7 +40,9 @@ resource "null_resource" "mithril_signer" {
3840
"export NETWORK=${var.cardano_network}",
3941
"export IMAGE_ID=${var.mithril_image_id}",
4042
"export SIGNER_HOST=${local.mithril_signers_host[each.key]}",
41-
"export SIGNER_WWW_PORT=`expr 8080 + ${index(local.mithril_signers_index, each.key) + 1}`",
43+
"export SIGNER_WWW_PORT=${local.mithril_signers_www_port[each.key]}",
44+
"export SIGNER_CARDANO_ADDR=0.0.0.0",
45+
"export SIGNER_CARDANO_PORT=${local.mithril_signers_cardano_port[each.key]}",
4246
"export CURRENT_UID=$(id -u)",
4347
"export DOCKER_GID=$(getent group docker | cut -d: -f3)",
4448
"docker-compose -p $SIGNER_ID -f /home/curry/docker/docker-compose-signer-${each.value.type}.yaml --profile all up -d",

0 commit comments

Comments
 (0)