Skip to content

Commit 7ca7c5b

Browse files
committed
Update re-compute certificates hashes runbook
1 parent 4a1bee6 commit 7ca7c5b

File tree

2 files changed

+69
-8
lines changed

2 files changed

+69
-8
lines changed

docs/runbook/recompute-certificates-hash/README.md

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ Export the environment variables:
55
```bash
66
export MITHRIL_VM=**MITHRIL_VM**
77
export CARDANO_NETWORK=**CARDANO_NETWORK**
8+
export MITHRIL_DISTRIBUTION_LINUX_PKG=**MITHRIL_DISTRIBUTION_LINUX_PKG**
89
```
910

1011
Here is an exmaple for the `release-mainnet` network:
1112
```bash
1213
export MITHRIL_VM=aggregator.release-mainnet.api.mithril.network
1314
export CARDANO_NETWORK=mainnet
15+
export MITHRIL_DISTRIBUTION_LINUX_PKG=https://github.com/input-output-hk/mithril/releases/download/2342.0/mithril-2342.0-linux-x64.tar.gz
1416
```
1517

1618
## Make a backup of the aggregator database
@@ -30,29 +32,64 @@ And copy the SQLite database file `aggregator.sqlite3`:
3032
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)
3133
```
3234

33-
And connect to the aggregator container:
35+
## Create a temp directory
36+
37+
Create a temp directory:
3438
```bash
35-
docker exec -it mithril-aggregator bash
39+
rm -rf /home/curry/temp
40+
mkdir -p /home/curry/temp/config
41+
cd /home/curry/temp
3642
```
3743

38-
Once connected to the aggregator container, recompute the certificates hashes:
44+
And download the configuration file for tools:
3945
```bash
40-
/app/bin/mithril-aggregator -vvvv tools recompute-certificates-hash
46+
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
4147
```
4248

43-
Then disconnect from the aggregator container:
49+
## Download the pre-compiled aggregator binary
50+
51+
Download the mithril pre-compiled binaries package:
4452
```bash
45-
exit
53+
wget $MITHRIL_DISTRIBUTION_LINUX_PKG -O mithril-bin.tar.gz
54+
```
55+
56+
Unpack the mithril aggregator binary:
57+
```bash
58+
tar xzf mithril-bin.tar.gz mithril-aggregator
59+
```
60+
61+
Make mithril aggregator binary executable:
62+
```bash
63+
chmod u+x mithril-aggregator
64+
```
65+
66+
Make sure you are running the expected version of the aggregator:
67+
```bash
68+
./mithril-aggregator --version
69+
```
70+
71+
## Stop the aggregator
72+
73+
Stop the aggregator container:
74+
```bash
75+
docker stop mithril-aggregator
76+
```
77+
78+
## Run the migration
79+
80+
Once connected to the aggregator container, recompute the certificates hashes:
81+
```bash
82+
DATA_STORES_DIRECTORY=/home/curry/data/$CARDANO_NETWORK/mithril-aggregator/mithril/stores/ ./mithril-aggregator --run-mode tools -vvv tools recompute-certificates-hash
4683
```
4784

4885
## Restart the aggregator
4986

5087
Restart the aggregator to make sure that the certificate chain is valid:
5188
```bash
52-
docker restart mithril-aggregator
89+
docker start mithril-aggregator
5390
```
5491

55-
Make sure that the certificate chain is valid (wait for the state machiene to go into the state `READY`):
92+
Make sure that the certificate chain is valid (wait for the state machine to go into the `READY` state):
5693
```bash
5794
docker logs -f --tail 1000 mithril-aggregator
5895
```
@@ -62,6 +99,13 @@ Then disconnect from the aggregator VM:
6299
exit
63100
```
64101

102+
## Cleanup the temp directory
103+
104+
Remove the temp directory:
105+
```bash
106+
rm -rf /home/curry/temp
107+
```
108+
65109
## Rollback procedure
66110

67111
If the recomputation fails, you can rollback the database.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"cardano_cli_path": "-",
3+
"cardano_node_socket_path": "-",
4+
"network": "-",
5+
"network_magic": 0,
6+
"run_interval": 0,
7+
"protocol_parameters": {
8+
"k": 0,
9+
"m": 0,
10+
"phi_f": 0
11+
},
12+
"snapshot_store_type": "local",
13+
"snapshot_uploader_type": "local",
14+
"genesis_verification_key": "-",
15+
"era_adapter_type": "bootstrap",
16+
"cardano_node_version": "-"
17+
}

0 commit comments

Comments
 (0)