Starting a Node
To start your Fermah Prover Node, follow the instructions below.
Please make sure you are running Telemetry
Machine Limits
We need to modify the maximum open files and unix socket buffers to increase their limits.
Open Files
sudo echo "fermah soft nofile 65535" >> /etc/security/limits.conf
sudo echo "fermah hard nofile 65535" >> /etc/security/limits.conf
Unix Socket Buffers
sudo sysctl -w net.core.wmem_max=16777216
sudo sysctl -w net.core.rmem_max=16777216
Start
Run the command:
fpn
This command will start the prover-node
binary, which connects you to our network using the provided key and wait for Proof Requests. It will also periodically check for updates and install them in the background.
Daemonization
Service File
Create the file
/etc/systemd/system/fermah.service
Set permissions
sudo chmod 644
/etc/systemd/system/fermah.service
[Unit]
Description=Fermah Prover Node
After=network.target local-fs.target
[Service]
Type=simple
User=%u
Group=%g
ExecStart=/home/%u/.fermah/bin/fpn
ExecStop=/bin/kill -s TERM $MAINPID
Restart=on-failure
KillMode=control-group
ExecStartPost=/bin/sleep 0.5
TimeoutStopSec=20
StartLimitBurst=5
RestartSec=5
StandardOutput=append:/var/log/fermah/pn.log
# Ensure log directory exists
ExecStartPre=/bin/mkdir -p /var/log/fermah
ExecStartPre=/bin/chown %u:%g /var/log/fermah
ExecStartPre=/bin/chmod 755 /var/log/fermah
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
Logrotate
Create the file
/etc/logrotate.d/fermah
Set permissions
sudo chmod 644
/etc/logrotate.d/fermah
/var/log/fermah/pn.log {
su root adm
daily
missingok
rotate 30
maxsize 1G
compress
notifempty
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
Enable service
sudo systemctl daemon-reload
sudo systemctl enable fermah.service
sudo systemctl start fermah.service
Last updated
Was this helpful?