You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Mithril infrastructure comes with some scripts that help handle common tasks.
99
+
100
+
### Utils
101
+
102
+
This script is mainly used by the GitHub Actions workflows in the terraform deployments.
103
+
104
+
| Script | Description | Usage |
105
+
|--------|-------------|-------|
106
+
|`google-credentials-public-key.sh`| Extract a public key from a GCP credentials file and adds it to an authorized `ssh_keys` file for a specific user. |`./google-credentials-public-key.sh credentials.json ssh_keys username`|
107
+
108
+
### Pool
109
+
110
+
These scripts are used to create and maintain a **Cardano Stake Pool Operator (SPO)** on a Mithril network, for**Tests only**.
111
+
112
+
Connect to the VM and selectthe Cardano node and the Mithril signer node:
113
+
```
114
+
# Show debug output
115
+
export DEBUG=1
116
+
117
+
# Select Cardano network
118
+
export NETWORK=preview
119
+
export NETWORK_MAGIC=2
120
+
121
+
# Selet Cardano node
122
+
export CARDANO_NODE=cardano-node-signer-1
123
+
124
+
# Select Mithril signer node
125
+
export SIGNER_NODE=mithril-signer-1
126
+
```
127
+
128
+
In order to create a stake pool from scratch:
129
+
* Create keys with `create-keys.sh`
130
+
* Register the stake address of the pool with `register-stake-address.sh`
131
+
* Register the stake pool with `register-stake-pool.sh`
132
+
133
+
In order to query a stake pool information:
134
+
* Query the stake pool with `query-stake-pool.sh`
135
+
136
+
In order to maintain the stake pool:
137
+
* Renew the operational certificate of the stake pool with `renew-opcert.sh`
138
+
139
+
In order to retire a stake pool:
140
+
* Retire a stake poool with `retire-stake-pool.sh`
141
+
142
+
| Script | Description | Usage |
143
+
|--------|-------------|-------|
144
+
|`create-keys.sh`| Script for creating keys for a Cardano pool (SPO) |`./tools/pool/create-keys.sh`|
145
+
|`query-stake-pool.sh`| Script for querying info about a Cardano pool (SPO) |`./tools/pool/query-stake-pool.sh`|
146
+
|`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`|
147
+
|`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`|
148
+
|`renew-opcert.sh`| Script for renewing Operational Certificate for a Cardano pool (SPO) |`./tools/pool/renew-opcert.sh`|
149
+
|`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`|
150
+
151
+
### Genesis
152
+
153
+
These scripts are used to fast bootstrap the genesis cerificates of a Mithril network, for**Tests only**.
154
+
The principle is to antedate the databases of the signers and aggregators so that we can bootstrap then a valid genesis certificate.
155
+
156
+
:warning: This process is experimental and recommended for expert users only.
157
+
158
+
| Script | Description | Usage |
159
+
|--------|-------------|-------|
160
+
|`fast-genesis-aggregator.sh`| Script for antedating an aggregator database to run after the first signer registration (create fake `2` previous epochs with current epoch data for`stake`, `verification_key` and `protocol_parameters`) |`./tools/genesis/fast-genesis-aggregators.sh`|
161
+
|`fast-genesis-signer.sh`| Script for antedating a signer database to run after the first signer registration (create fake `2` previous epochs with current epoch data for`stake`, `protocol_initializer`) |`./tools/genesis/fast-genesis-signer.sh`|
162
+
|`update-genesis-certificate.sh`| Script forupdating the content of the genesis certificatein the aggregator database |`./tools/genesis/update-genesis-certificate.sh`|
163
+
|`update-stake-distribution-aggregator.sh`| Script foradding a Pool Id to an existing stake distributionin the aggregator database |`./tools/genesis/update-stake-distribution-aggregator.sh`|
164
+
|`update-stake-distribution-signer.sh`| Script foradding a Pool Id to an existing stake distributionin the signer database |`./tools/genesis/update-stake-distribution-signer.sh`|
165
+
166
+
Here is an example process to fast bootstrap a Mithril network on preview with `2` signer nodes:
docker exec mithril-aggregator /app/bin/cardano-cli query tip --testnet-magic $NETWORK_MAGIC
175
+
docker exec mithril-signer-1 /app/bin/cardano-cli query tip --testnet-magic $NETWORK_MAGIC
176
+
docker exec mithril-signer-2 /app/bin/cardano-cli query tip --testnet-magic $NETWORK_MAGIC
177
+
178
+
## Clean signer db
179
+
sqlite3 data/$NETWORK/mithril-signer-1/mithril/stores/signer.sqlite3 "DELETE FROM protocol_initializer; DELETE FROM stake;"
180
+
sqlite3 data/$NETWORK/mithril-signer-2/mithril/stores/signer.sqlite3 "DELETE FROM protocol_initializer; DELETE FROM stake;"
181
+
182
+
## Clean aggregator db
183
+
sqlite3 data/$NETWORK/mithril-aggregator/mithril/stores/aggregator.sqlite3 "DELETE FROM certificate; DELETE FROM single_signature; DELETE FROM verification_key; DELETE FROM pending_certificate; DELETE FROM snapshot; DELETE FROM stake;"
184
+
185
+
## Restart nodes
186
+
docker restart mithril-aggregator
187
+
docker restart mithril-signer-1
188
+
docker restart mithril-signer-2
189
+
190
+
## If with certified signer
191
+
### Create certified signer and retrieve its pool id
0 commit comments