Export the environment variables:
export MITHRIL_VM=**MITHRIL_VM**
export CARDANO_NETWORK=**CARDANO_NETWORK**
export MITHRIL_DISTRIBUTION=**MITHRIL_DISTRIBUTION**
Here is an example for the release-mainnet
network:
export MITHRIL_VM=aggregator.release-mainnet.api.mithril.network
export CARDANO_NETWORK=mainnet
export MITHRIL_DISTRIBUTION=latest
Connect to the aggregator VM:
ssh curry@$MITHRIL_VM
Stop the aggregator container:
docker stop mithril-aggregator
Export the environment variables:
export CARDANO_NETWORK=**CARDANO_NETWORK**
export MITHRIL_DISTRIBUTION=**MITHRIL_DISTRIBUTION**
Truncate WAL and SHM files:
sqlite3 /home/curry/data/$CARDANO_NETWORK/mithril-aggregator/mithril/stores/aggregator.sqlite3 "PRAGMA wal_checkpoint(TRUNCATE);"
And copy the SQLite database file aggregator.sqlite3
:
cp /home/curry/data/$CARDANO_NETWORK/mithril-aggregator/mithril/stores/aggregator.sqlite3 /home/curry/data/$CARDANO_NETWORK/mithril-aggregator/mithril/stores/aggregator.sqlite3.bak.$(date +%Y-%m-%d)
Create a temp directory:
rm -rf /home/curry/temp
mkdir -p /home/curry/temp/config
cd /home/curry/temp
And download the configuration file for tools:
wget https://raw.githubusercontent.com/input-output-hk/mithril/main/docs/runbook/recompute-certificates-hash/config/tools.json -O /home/curry/temp/config/tools.json
Download the mithril pre-compiled binaries package:
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:
./mithril-aggregator --version
Once connected to the aggregator container, recompute the certificates hashes:
DATA_STORES_DIRECTORY=/home/curry/data/$CARDANO_NETWORK/mithril-aggregator/mithril/stores/ ./mithril-aggregator --run-mode tools -vvv tools recompute-certificates-hash
Restart the aggregator to make sure that the certificate chain is valid:
docker start mithril-aggregator
Make sure that the certificate chain is valid (wait for the state machine to go into the READY
state):
docker logs -f --tail 1000 mithril-aggregator
Remove the temp directory:
rm -rf /home/curry/temp
Then disconnect from the aggregator VM:
exit
If the recomputation fails, you can rollback the database,and try again the process.
First, stop the aggregator:
docker stop mithril-aggregator
Then, restore the backed up database:
cp /home/curry/data/$CARDANO_NETWORK/mithril-aggregator/mithril/stores/aggregator.sqlite3.bak.$(date +%Y-%m-%d) /home/curry/data/$CARDANO_NETWORK/mithril-aggregator/mithril/stores/aggregator.sqlite3
Then, start the aggregator:
docker start mithril-aggregator
Then disconnect from the aggregator VM:
exit