Skip to content

Commit 2e5e2c5

Browse files
committed
Enhance Run a Mithril Signer as an SPO guide
1 parent e79232f commit 2e5e2c5

File tree

1 file changed

+97
-1
lines changed

1 file changed

+97
-1
lines changed

docs/root/manual/getting-started/run-signer-node.md

+97-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ In this guide, you will learn how to set up a **Mithril Signer** within the stak
2727
- On `mainnet`, you **must** run the **production** deployment where the **Mithril Signer** runs on the **Cardano block producer** machine and the **Mithril relay** runs on the **Cardano relay** machine. **Note** that you can run the **production** deployment on `testnet`.
2828
- You can also run **naive** deployment, where the **Mithril Signer** runs on the **Cardano relay** machine. This is possible in the testnet environment only, and does not require setting up a **Mithril relay**.
2929

30+
In the current setup, you don't need to install a Mithril Aggregator.
3031
:::
3132

3233
:::caution
@@ -231,6 +232,23 @@ Replace this value with the correct user. We assume that the user used to run th
231232
* `RELAY_ENDPOINT=http://192.168.1.50:3128` **(optional)**: this is the endpoint of the **Mithril relay**, which is required for **production** deployment only. For **naive** deployment, do not set this variable in your environment file.
232233
:::
233234

235+
:::tip
236+
237+
You can find below the `ERA_READER_ADAPTER_TYPE` and `ERA_READER_ADAPTER_PARAMS` values for **release-preprod**. Other values must be replaced as explained in the caution box above.
238+
239+
* In the `/opt/mithril/mithril-signer/service.env` env file:
240+
* `KES_SECRET_KEY_PATH=/cardano/keys/kes.skey`
241+
* `OPERATIONAL_CERTIFICATE_PATH=/cardano/cert/opcert.cert`
242+
* `DB_DIRECTORY=/cardano/db`
243+
* `CARDANO_NODE_SOCKET_PATH=/cardano/ipc/node.socket`
244+
* `CARDANO_CLI_PATH=/app/bin/cardano-cli`
245+
* `DATA_STORES_DIRECTORY=/opt/mithril/stores`
246+
* `STORE_RETENTION_LIMIT=5`
247+
* `ERA_READER_ADAPTER_TYPE=cardano-chain`
248+
* `ERA_READER_ADAPTER_PARAMS={"address": "addr_test1qpkyv2ws0deszm67t840sdnruqgr492n80g3y96xw3p2ksk6suj5musy6w8lsg3yjd09cnpgctc2qh386rtxphxt248qr0npnx", "verification_key": "5b35352c3232382c3134342c38372c3133382c3133362c34382c382c31342c3138372c38352c3134382c39372c3233322c3235352c3232392c33382c3234342c3234372c3230342c3139382c31332c33312c3232322c32352c3136342c35322c3130322c39312c3132302c3230382c3134375d"}`
249+
* `RELAY_ENDPOINT=http://192.168.1.50:3128`
250+
:::
251+
234252
First, create an environment file that will be used by the service:
235253

236254
- for **production** deployment:
@@ -270,6 +288,28 @@ ERA_READER_ADAPTER_PARAMS=**YOUR_ERA_READER_ADAPTER_PARAMS**
270288
EOF'
271289
```
272290

291+
:::tip
292+
Here is an example of the env file for **release-preprod** :
293+
294+
```bash
295+
sudo bash -c 'cat > /opt/mithril/mithril-signer.env << EOF
296+
KES_SECRET_KEY_PATH=/cardano/keys/kes.skey
297+
OPERATIONAL_CERTIFICATE_PATH=/cardano/keys/node.cert
298+
NETWORK=preprod
299+
AGGREGATOR_ENDPOINT=https://aggregator.release-preprod.api.mithril.network/aggregator
300+
RUN_INTERVAL=60000
301+
DB_DIRECTORY=/cardano/db
302+
CARDANO_NODE_SOCKET_PATH=/cardano/ipc/node.socket
303+
CARDANO_CLI_PATH=/app/bin/cardano-cli
304+
DATA_STORES_DIRECTORY=/opt/mithril/stores
305+
STORE_RETENTION_LIMIT=5
306+
ERA_READER_ADAPTER_TYPE=cardano-chain
307+
ERA_READER_ADAPTER_PARAMS={"address": "addr_test1qpkyv2ws0deszm67t840sdnruqgr492n80g3y96xw3p2ksk6suj5musy6w8lsg3yjd09cnpgctc2qh386rtxphxt248qr0npnx", "verification_key": "5b35352c3232382c3134342c38372c3133382c3133362c34382c382c31342c3138372c38352c3134382c39372c3233322c3235352c3232392c33382c3234342c3234372c3230342c3139382c31332c33312c3232322c32352c3136342c35322c3130322c39312c3132302c3230382c3134375d"}
308+
RELAY_ENDPOINT=http://192.168.1.50:3128
309+
EOF'
310+
```
311+
:::
312+
273313
Then, create a `/etc/systemd/system/mithril-signer.service` description file for the service:
274314

275315
```bash
@@ -416,6 +456,14 @@ Assuming you are using [`Uncomplicated Firewall`](https://en.wikipedia.org/wiki/
416456
sudo ufw allow from **YOUR_BLOCK_PRODUCER_INTERNAL_IP** to any port **YOUR_RELAY_LISTENING_PORT** proto tcp
417457
```
418458

459+
:::tip
460+
Here is a example of the command to run :
461+
462+
```bash
463+
sudo ufw allow from 123.123.123.123 to any port 3128 proto tcp
464+
```
465+
:::
466+
419467
Assuming you are using [`Iptables`](https://en.wikipedia.org/wiki/Iptables) (`1.8.7+`), the command to open that traffic is:
420468

421469
```bash
@@ -424,10 +472,58 @@ sudo iptables -L -v
424472
sudo service netfilter-persistent save
425473
```
426474

475+
:::tip
476+
Here is a example of the command to run :
477+
478+
```bash
479+
sudo iptables -A INPUT -s 123.123.123.123 -p tcp --dport 3128 -j ACCEPT
480+
sudo iptables -L -v
481+
sudo service netfilter-persistent save
482+
```
483+
:::
484+
427485
## Verify the Mithril Signer deployment
428486

429487
:::tip
488+
You can verify that your signer node is correctly configured and registered by checking your signer node logs or by running this command :
489+
490+
```bash
491+
if grep -q "STATE MACHINE: new cycle: Registered" **YOUR_SIGNER_NODE_LOGS_PATH**; then
492+
echo ">> Your signer node is registered"
493+
else
494+
echo ">> Your signer node is not registered"
495+
fi
496+
```
497+
430498
There is a delay of `2` epochs between the registration of the signer node and its ability to generate individual signatures. This delay is further explained in the [Mithril certificate chain in depth](https://mithril.network/doc/mithril/mithril-protocol/certificates) documentation.
431499

432-
Once this delay has passed, you should be able to observe your `PoolId` listed in some of the certificates accessible on the [`Mithril Explorer`](https://mithril.network/explorer).
500+
Once this delay has passed, you should be able to observe your `PoolId` listed in some of the certificates accessible on the [`Mithril Explorer`](https://mithril.network/explorer) or by running the following command :
501+
502+
```bash
503+
party_id=**YOUR_POOL_ID**
504+
aggregator_endpoint=**YOUR_AGGREGATOR_ENDPOINT**
505+
found=false
506+
507+
curl -s "$aggregator_endpoint/certificates" -H 'accept: application/json' | jq -r '.[] | .hash' | while read -r hash; do
508+
response=$(curl -s "$aggregator_endpoint/certificate/$hash" -H 'accept: application/json')
509+
signer_count=$(echo "$response" | jq '.metadata.signers | length')
510+
for (( i=0; i < signer_count; i++ )); do
511+
party_id_response=$(echo "$response" | jq -r ".metadata.signers[$i].party_id")
512+
if [[ "$party_id_response" == "$party_id" ]]; then
513+
echo ">> You have signed this certificate : $hash"
514+
found=true
515+
break
516+
fi
517+
done
518+
519+
if [ "$found" = true ]; then
520+
break
521+
fi
522+
done
523+
524+
if [ "$found" = false ]; then
525+
echo ">> Your party id was not found in the last certificates"
526+
fi
527+
```
528+
433529
:::

0 commit comments

Comments
 (0)