Skip to content

Commit

Permalink
Merge pull request #2171 from input-output-hk/jpraynaud/2421-enhance-…
Browse files Browse the repository at this point in the history
…recompute-certificate-hash-runbook

Docs: enhance recompute certificates hash runbook
  • Loading branch information
jpraynaud authored Dec 12, 2024
2 parents 572f00e + 6d6dd1b commit 12c09d8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 22 additions & 26 deletions docs/runbook/recompute-certificates-hash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,46 @@ Export the environment variables:
```bash
export MITHRIL_VM=**MITHRIL_VM**
export CARDANO_NETWORK=**CARDANO_NETWORK**
export MITHRIL_DISTRIBUTION_LINUX_PKG=**MITHRIL_DISTRIBUTION_LINUX_PKG**
export MITHRIL_DISTRIBUTION=**MITHRIL_DISTRIBUTION**
```

Here is an example for the `release-mainnet` network:

```bash
export MITHRIL_VM=aggregator.release-mainnet.api.mithril.network
export CARDANO_NETWORK=mainnet
export MITHRIL_DISTRIBUTION_LINUX_PKG=https://github.com/input-output-hk/mithril/releases/download/2342.0/mithril-2342.0-linux-x64.tar.gz
export MITHRIL_DISTRIBUTION=latest
```

## Make a backup of the aggregator database
## Connect to the VM

Connect to the aggregator VM:

```bash
ssh curry@$MITHRIL_VM
```

Once connected to the aggregator VM, export the environment variables:
## Stop the aggregator

Stop the aggregator container:

```bash
docker stop mithril-aggregator
```

## Make a backup of the aggregator database

Export the environment variables:

```bash
export CARDANO_NETWORK=**CARDANO_NETWORK**
export MITHRIL_DISTRIBUTION_LINUX_PKG=**MITHRIL_DISTRIBUTION_LINUX_PKG**
export MITHRIL_DISTRIBUTION=**MITHRIL_DISTRIBUTION**
```

Truncate WAL and SHM files:

```bash
sqlite3 /home/curry/data/$CARDANO_NETWORK/mithril-aggregator/mithril/stores/aggregator.sqlite3 "PRAGMA wal_checkpoint(TRUNCATE);"
```

And copy the SQLite database file `aggregator.sqlite3`:
Expand Down Expand Up @@ -60,19 +76,7 @@ wget https://raw.githubusercontent.com/input-output-hk/mithril/main/docs/runbook
Download the mithril pre-compiled binaries package:

```bash
wget $MITHRIL_DISTRIBUTION_LINUX_PKG -O mithril-bin.tar.gz
```

Unpack the mithril aggregator binary:

```bash
tar xzf mithril-bin.tar.gz mithril-aggregator
```

Make mithril aggregator binary executable:

```bash
chmod u+x mithril-aggregator
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/input-output-hk/mithril/refs/heads/main/mithril-install.sh | sh -s -- -c mithril-aggregator -d $MITHRIL_DISTRIBUTION -p $(pwd)
```

Make sure you are running the expected version of the aggregator:
Expand All @@ -81,14 +85,6 @@ Make sure you are running the expected version of the aggregator:
./mithril-aggregator --version
```

## Stop the aggregator

Stop the aggregator container:

```bash
docker stop mithril-aggregator
```

## Run the migration

Once connected to the aggregator container, recompute the certificates hashes:
Expand Down
2 changes: 1 addition & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.6.2"
version = "0.6.3"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion mithril-aggregator/src/tools/certificates_hash_migrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl CertificatesHashMigrator {

debug!(
self.logger,
"Updating signed entities certificate_ids to new computed hash and migrated signed entities in the database"
"Updating signed entities certificate hash in the database"
);
let old_hashes_chunk_size = 250;
for old_hashes_chunk in old_hashes.chunks(old_hashes_chunk_size) {
Expand Down

0 comments on commit 12c09d8

Please sign in to comment.