Skip to content

Commit 1262fb7

Browse files
committed
docs: make next doc website current
1 parent 426c7a0 commit 1262fb7

File tree

1 file changed

+117
-16
lines changed

1 file changed

+117
-16
lines changed

docs/website/versioned_docs/version-maintained/manual/getting-started/run-signer-node.md

Lines changed: 117 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Note that this guide works on a Linux machine only.
101101

102102
* Install a recent version of `jq` (version 1.6+). You can install it by running `apt install jq`.
103103

104-
* Only for the **production** deployment, install a recent version of [`squid-cache`](http://www.squid-cache.org/) (version 6.8+).
104+
* Only for the **production** deployment, install a recent version of [`squid-cache`](http://www.squid-cache.org/) (version 6.9+).
105105

106106
## Set up the Mithril signer node
107107

@@ -429,7 +429,7 @@ systemctl status mithril-signer.service
429429
Finally, monitor the logs of the service:
430430

431431
```bash
432-
tail /var/log/syslog
432+
tail -f /var/log/syslog | grep mithril-signer
433433
```
434434

435435
### Activate Prometheus endpoint
@@ -507,20 +507,73 @@ sudo systemctl restart mithril-signer
507507
508508
:::
509509
510-
### Configuring the Squid service
510+
### Building Squid from source
511511
512512
:::info
513513
514-
The **Mithril relay** node serves as a forward proxy, relaying traffic between the **Mithril signer** and the **Mithril aggregator**. When appropriately configured, it facilitates the security of the **block-producing** node. You can use `squid` to operate this forward proxy, and this section presents a recommended configuration.
514+
- If you have already installed `Squid` via `apt` package manager, we recommend that you delete it before manually building it from source by running the commands: `sudo apt remove squid` and `sudo apt autoremove`.
515+
516+
- The FAQ for compiling `Squid` is available [here](https://wiki.squid-cache.org/SquidFaq/CompilingSquid).
517+
518+
- You will need a C++ compiler that can be installed with `sudo apt install build-essential` command.
515519
516520
:::
517521
518-
Verify that the service was correctly configured at installation:
522+
On the [Squid page listing released versions](https://www.squid-cache.org/Versions/) identify the latest stable released version (currently `6.9`) and download it:
523+
524+
```bash
525+
wget https://www.squid-cache.org/Versions/v6/squid-6.9.tar.gz
526+
```
527+
528+
Uncompress the downloaded archive, and change directory:
529+
```bash
530+
tar xzf squid-6.9.tar.gz
531+
cd squid-6.9
532+
```
533+
534+
Then, configure the compilation:
535+
```bash
536+
./configure \
537+
--prefix=/opt/squid \
538+
--localstatedir=/opt/squid/var \
539+
--libexecdir=/opt/squid/lib/squid \
540+
--datadir=/opt/squid/share/squid \
541+
--sysconfdir=/etc/squid \
542+
--with-default-user=squid \
543+
--with-logdir=/opt/squid/var/log/squid \
544+
--with-pidfile=/opt/squid/var/run/squid.pid
545+
```
546+
547+
Compile the sources:
548+
```bash
549+
make
550+
```
551+
552+
And install `squid` binary:
553+
```bash
554+
sudo make install
555+
```
519556
557+
Optionally, verify that the version is correct:
520558
```bash
521-
sudo systemctl status squid
559+
/opt/squid/sbin/squid -v
522560
```
523561
562+
You should see a result like this:
563+
```bash
564+
Squid Cache: Version 6.9
565+
Service Name: squid
566+
configure options: '--prefix=/opt/squid' '--localstatedir=/opt/squid/var' '--libexecdir=/opt/squid/lib/squid' '--datadir=/opt/squid/share/squid' '--sysconfdir=/etc/squid' '--with-default-user=squid' '--with-logdir=/opt/squid/var/log/squid' '--with-pidfile=/opt/squid/var/run/squid.pid'
567+
```
568+
569+
### Configuring the Squid proxy
570+
571+
:::info
572+
573+
The **Mithril relay** node serves as a forward proxy, relaying traffic between the **Mithril signer** and the **Mithril aggregator**. When appropriately configured, it facilitates the security of the **block-producing** node. You can use `squid` to operate this forward proxy, and this section presents a recommended configuration.
574+
575+
:::
576+
524577
Make a copy of the original configuration:
525578
526579
```bash
@@ -577,6 +630,7 @@ cache deny all
577630
578631
# Deny everything else
579632
http_access deny all
633+
580634
EOF'
581635
```
582636
@@ -632,6 +686,7 @@ cache deny all
632686
633687
# Deny everything else
634688
http_access deny all
689+
635690
EOF'
636691
```
637692
@@ -657,33 +712,79 @@ With this configuration, the proxy will:
657712
- anonymize completely the traffic and avoid disclosing any information about the block-producing machine
658713
- deny all other traffic
659714
660-
Restart the service:
715+
:::info
716+
717+
:::
718+
719+
### Installing the service
720+
721+
Create (or re-use) an unpriviledged system user on the machine:
722+
```bash
723+
sudo adduser --system --no-create-home --group squid
724+
```
661725
726+
Change ownership of `/opt/squid/var` directory:
662727
```bash
663-
sudo systemctl restart squid
728+
sudo chown squid -R /opt/squid/var/
729+
sudo chgrp squid -R /opt/squid/var/
730+
```
731+
732+
Create a `/etc/systemd/system/squid.service` description file for the service:
733+
```bash
734+
sudo bash -c 'cat > /etc/systemd/system/squid.service << EOF
735+
[Unit]
736+
Description=Squid service
737+
StartLimitIntervalSec=0
738+
739+
[Service]
740+
Type=simple
741+
Restart=always
742+
RestartSec=60
743+
User=squid
744+
Group=squid
745+
ExecStart=/opt/squid/sbin/squid -f /etc/squid/squid.conf
746+
PIDFile=/opt/squid/var/run/squid.pid
747+
748+
[Install]
749+
WantedBy=multi-user.target
750+
EOF'
664751
```
665752
666-
Ensure it runs properly:
753+
Reload the service configuration (optional):
667754
668755
```bash
669-
sudo systemctl status squid
756+
sudo systemctl daemon-reload
670757
```
671758
672-
Finally, monitor service logs:
759+
Then, start the service:
673760
674761
```bash
675-
tail /var/log/syslog
762+
sudo systemctl start squid
676763
```
677764
678-
:::info
765+
Register the service to start on boot:
679766
680-
Here is the command to see squid access logs:
767+
```bash
768+
sudo systemctl enable squid
769+
```
770+
771+
Monitor the status of the service:
681772
682773
```bash
683-
tail /var/log/squid/access.log
774+
systemctl status squid
684775
```
685776
686-
:::
777+
Finally, monitor the logs of the service:
778+
779+
```bash
780+
tail -f /var/log/syslog | grep squid
781+
```
782+
783+
And monitor squid access logs:
784+
785+
```bash
786+
sudo tail -f /opt/squid/var/log/squid/access.log
787+
```
687788
688789
### Firewall configuration
689790

0 commit comments

Comments
 (0)