Skip to content

Commit d0ecaad

Browse files
authored
Merge pull request #1985 from input-output-hk/jpraynaud/1984-fix-infra-configuration-signer
Fix: topology computation of the Cardano nodes of the signers in infra
2 parents a95ace1 + b5c5ba2 commit d0ecaad

File tree

9 files changed

+32
-33
lines changed

9 files changed

+32
-33
lines changed

mithril-infra/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ terraform apply --var-file=env.$DEPLOY_ENVIRONMENT.tfvars
6969
You should see this output from terraform:
7070
7171
```bash
72-
aggregator_endpoint = "https://aggregator.***.api.mithril.network/aggregator"
73-
api_subdomain = "***.api.mithril.network."
72+
aggregator_endpoint = "https://aggregator.**.api.mithril.network/aggregator"
73+
api_subdomain = "**.api.mithril.network."
7474
external-ip = "35.195.148.171"
7575
google_project = "mithril"
7676
name_servers = tolist([
@@ -154,14 +154,14 @@ In order to retire a stake pool:
154154
155155
- Retire a stake poool with `retire-stake-pool.sh`
156156
157-
| Script | Description | Usage |
158-
| --------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
159-
| `create-keys.sh` | Script for creating keys for a Cardano pool (SPO) | `./tools/pool/create-keys.sh` |
160-
| `query-stake-pool.sh` | Script for querying info about a Cardano pool (SPO) | `./tools/pool/query-stake-pool.sh` |
161-
| `register-stake-address.sh` | Script for registering stake address of a Cardano pool (SPO) | `TX_IN=***YOUR_TX_IN*** ./tools/pool/register-stake-address.sh` |
162-
| `register-stake-pool.sh` | Script for registering a Cardano stake pool (SPO) | `TX_IN=***YOUR_TX_IN*** SIGNER_DOMAIN=***YOUR_SIGNER_DOMAIN_NAME*** POOL_TICKER=***YOUR_TICKER*** ./tools/pool/register-stake-pool.sh` |
163-
| `renew-opcert.sh` | Script for renewing Operational Certificate for a Cardano pool (SPO) | `./tools/pool/renew-opcert.sh` |
164-
| `retire-stake-pool.sh` | Script for retiring a Cardano pool (SPO) | `TX_IN=***YOUR_TX_IN*** VALUE_OUT=***YOUR_VALUE_OUT*** ./tools/pool/retire-stake-pool.sh` |
157+
| Script | Description | Usage |
158+
| --------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
159+
| `create-keys.sh` | Script for creating keys for a Cardano pool (SPO) | `GENESIS_FILE=**YOUR_GENESIS_FILE** ./tools/pool/create-keys.sh` |
160+
| `query-stake-pool.sh` | Script for querying info about a Cardano pool (SPO) | `./tools/pool/query-stake-pool.sh` |
161+
| `register-stake-address.sh` | Script for registering stake address of a Cardano pool (SPO) | `TX_IN=**YOUR_TX_IN** ./tools/pool/register-stake-address.sh` |
162+
| `register-stake-pool.sh` | Script for registering a Cardano stake pool (SPO) | `GENESIS_FILE=**YOUR_GENESIS_FILE** TX_IN=**YOUR_TX_IN** SIGNER_DOMAIN=**YOUR_SIGNER_DOMAIN_NAME** POOL_TICKER=**YOUR_TICKER** ./tools/pool/register-stake-pool.sh` |
163+
| `renew-opcert.sh` | Script for renewing Operational Certificate for a Cardano pool (SPO) | `./tools/pool/renew-opcert.sh` |
164+
| `retire-stake-pool.sh` | Script for retiring a Cardano pool (SPO) | `TX_IN=**YOUR_TX_IN** VALUE_OUT=**YOUR_VALUE_OUT** ./tools/pool/retire-stake-pool.sh` |
165165
166166
### Genesis
167167
@@ -245,7 +245,7 @@ sqlite3 data/$NETWORK/mithril-aggregator/mithril/stores/aggregator.sqlite3 "SELE
245245
Run the following Rust snippet (see below)
246246
247247
### Update the current genesis certificate of the aggregator database
248-
./tools/genesis/update-genesis-certificate.sh $NETWORK mithril-aggregator ***YOUR_UPDATED_CERTIFICATE_HASH*** '***YOUR_UPDATED_JSON_CERTIFICATE***'
248+
./tools/genesis/update-genesis-certificate.sh $NETWORK mithril-aggregator **YOUR_UPDATED_CERTIFICATE_HASH** '**YOUR_UPDATED_JSON_CERTIFICATE**'
249249
```
250250
251251
Snippet code to re-compute a valid genesis certificate:
@@ -256,7 +256,7 @@ Snippet code to re-compute a valid genesis certificate:
256256
fn update_genesis_certificate() {
257257
use crate::entities::Certificate;
258258
259-
let certificate_json = "***YOUR_GENESIS_CERTIFICATE***";
259+
let certificate_json = "**YOUR_GENESIS_CERTIFICATE**";
260260
let mut certificate: Certificate = serde_json::from_str(certificate_json).unwrap();
261261
certificate.beacon.epoch -= 1;
262262
certificate.hash = certificate.compute_hash();

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ services:
122122
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/block-producer:/mithril-signer-${SIGNER_ID}/cardano/db
123123
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/pool:/mithril-signer-${SIGNER_ID}/cardano/pool
124124
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/ipc:/ipc
125-
- ./cardano-configurations/network/${NETWORK}:/config
126125
command: ["-vvv"]
127126
depends_on:
128127
cardano-node-signer-block-producer:

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ services:
122122
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/block-producer:/mithril-signer-${SIGNER_ID}/cardano/db
123123
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/pool:/mithril-signer-${SIGNER_ID}/cardano/pool
124124
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/ipc:/ipc
125-
- ./cardano-configurations/network/${NETWORK}:/config
126125
command: ["-vvv"]
127126
depends_on:
128127
cardano-node-signer-block-producer:

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ services:
132132
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/block-producer:/mithril-signer-${SIGNER_ID}/cardano/db
133133
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/pool:/mithril-signer-${SIGNER_ID}/cardano/pool
134134
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/ipc:/ipc
135-
- ./cardano-configurations/network/${NETWORK}:/config
136135
command: ["-vvv"]
137136
depends_on:
138137
cardano-node-signer-block-producer:

mithril-infra/assets/infra.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.2
1+
0.3.3

mithril-infra/assets/tools/pool/_prelude.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ fi
4242
POOL_ARTIFACTS_DIR=/pool
4343
POOL_ARTIFACTS_DIR_PREFIX=./data/${NETWORK}/${SIGNER_NODE}/cardano
4444
POOL_WWW_DIR=/www
45-
GENESIS_FILE=/home/curry/docker/cardano-configurations/network/${NETWORK}/genesis/shelley.json
4645
if [ -z "${AMOUNT_STAKED}" ]; then
4746
AMOUNT_STAKED=1000000000
4847
fi
49-
50-
# Compute transaction input if needed
51-
#if [ -z "${TX_IN}" ]; then
52-
# TX_IN=$(CARDANO_CLI_CMD query utxo \
53-
# --testnet-magic $NETWORK_MAGIC \
54-
# --address $(cat ${POOL_ARTIFACTS_DIR_PREFIX}${POOL_ARTIFACTS_DIR}/payment.addr) | tail -n 1 | awk '{print $1;}')#1
55-
#fi

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
# Import prelude
77
. $(dirname -- "$0")/_prelude.sh
88

9+
if [ -z "${GENESIS_FILE}" ]; then
10+
echo Missing environment variable: GENESIS_FILE
11+
exit 1
12+
fi
13+
914
# Create keys and addresses
1015
## Create payment keypair
1116
CARDANO_CLI_CMD address key-gen \

mithril-infra/assets/tools/pool/register-stake-pool.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
# Import prelude
77
. $(dirname -- "$0")/_prelude.sh
88

9+
if [ -z "${GENESIS_FILE}" ]; then
10+
echo Missing environment variable: GENESIS_FILE
11+
exit 1
12+
fi
13+
914
# Check if all env vars are set
1015
if [ -z "${TX_IN}" ]; then
1116
echo Missing environment variable: TX_IN

mithril-infra/mithril.signer.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,18 @@ resource "null_resource" "mithril_signer" {
4343
"mkdir -p /home/curry/data/${var.cardano_network}/mithril-signer-${each.key}/mithril/snapshots",
4444
"echo -n ${local.mithril_signers_relay_cardano_port[each.key]} > /home/curry/data/${var.cardano_network}/mithril-signer-${each.key}/cardano/pool/port",
4545
<<-EOT
46-
# Setup cardano node block producer topology
47-
cat /home/curry/docker/cardano-configurations/network/${var.cardano_network}/cardano-node/topology.json | jq 'del(.publicRoots[0].accessPoints[0:])' | jq '.localRoots[0].accessPoints[0] |= . + { "address": "${google_compute_address.mithril-external-address.address}", "port": ${local.mithril_signers_relay_cardano_port[each.key]}}' > /home/curry/data/${var.cardano_network}/mithril-signer-${each.key}/cardano/pool/topology-block-producer.json
48-
49-
# Setup cardano node relay topology
50-
cat /home/curry/docker/cardano-configurations/network/${var.cardano_network}/cardano-node/topology.json | jq '.localRoots[0].accessPoints[0] |= . + { "address": "${google_compute_address.mithril-external-address.address}", "port": ${local.mithril_signers_block_producer_cardano_port[each.key]}}' > /home/curry/data/${var.cardano_network}/mithril-signer-${each.key}/cardano/pool/topology-relay.json
51-
EOT
52-
,
53-
<<-EOT
5446
set -e
5547
# Setup cardano node configuration
5648
CARDANO_NODE_EXACT_VERSION="${var.cardano_image_id}"
5749
CARDANO_NODE_MINOR_VERSION=$(echo $CARDANO_NODE_EXACT_VERSION | cut -d. -f1,2)
5850
CARDANO_NODE_VERSIONS="$CARDANO_NODE_EXACT_VERSION $CARDANO_NODE_MINOR_VERSION"
5951
SIGNER_TYPES="full relay block-producer"
6052
for SIGNER_TYPE in $SIGNER_TYPES; do
61-
# Copy the cardano node configuration files to the signer (exact version, and fallback to minor version)
53+
# Copy the cardano node configuration files to the signer and setup topology files (exact version, and fallback to minor version of the Cardano node)
6254
FOUND_CONFIGURATION=false
6355
for CARDANO_NODE_VERSION in $CARDANO_NODE_VERSIONS; do
6456
if [ -d "/home/curry/docker/cardano/config/$CARDANO_NODE_VERSION/${var.cardano_network}" ]; then
57+
# Copy the configuration files to the signer
6558
SIGNER_TYPE_CONFIG_DIRECTORY=/home/curry/data/${var.cardano_network}/mithril-signer-${each.key}/cardano/config/$SIGNER_TYPE
6659
rm -rf $SIGNER_TYPE_CONFIG_DIRECTORY
6760
mkdir -p $SIGNER_TYPE_CONFIG_DIRECTORY
@@ -70,6 +63,13 @@ for SIGNER_TYPE in $SIGNER_TYPES; do
7063
cat $SIGNER_TYPE_CONFIG_DIRECTORY/${var.cardano_network}/cardano-node/config.json | jq ".hasPrometheus[0] |= \"cardano-node-$SIGNER_TYPE-signer-${each.key}\"" > $SIGNER_TYPE_CONFIG_DIRECTORY/${var.cardano_network}/cardano-node/config.json.new
7164
rm -f $SIGNER_TYPE_CONFIG_DIRECTORY/${var.cardano_network}/cardano-node/config.json
7265
mv $SIGNER_TYPE_CONFIG_DIRECTORY/${var.cardano_network}/cardano-node/config.json.new $SIGNER_TYPE_CONFIG_DIRECTORY/${var.cardano_network}/cardano-node/config.json
66+
67+
# Setup cardano node block producer topology
68+
cat /home/curry/docker/cardano/config/$CARDANO_NODE_VERSION/${var.cardano_network}/cardano-node/topology.json | jq 'del(.bootstrapPeers)' | jq 'del(.useLedgerAfterSlot)' | jq '.localRoots[0].accessPoints[0] |= . + { "address": "${google_compute_address.mithril-external-address.address}", "port": ${local.mithril_signers_relay_cardano_port[each.key]}}' > /home/curry/data/${var.cardano_network}/mithril-signer-${each.key}/cardano/pool/topology-block-producer.json
69+
70+
# Setup cardano node relay topology
71+
cat /home/curry/docker/cardano/config/$CARDANO_NODE_VERSION/${var.cardano_network}/cardano-node/topology.json > /home/curry/data/${var.cardano_network}/mithril-signer-${each.key}/cardano/pool/topology-relay.json
72+
7373
FOUND_CONFIGURATION=true
7474
break
7575
fi

0 commit comments

Comments
 (0)