Run node as a systemd service
The runner.sh script automatically downloads and installs the latest version of the Witnet node software (witnet-rust). It can also be used to update to the latest version, since it will keep all the block chain data and the configuration file in the hidden .witnet directory.
For Testnet 7.3 and greater, the configuration file needs to be customized with the public IP and port of the node, which must be set at the public_addr field in witnet.toml .
Install latest version of ca-certificates to download safely from GitHub:
sudo apt install ca-certificates
sudo update-ca-certificatesCreate the
witnetuser dedicated to running the node:
sudo adduser witnetClone the project's GitHub repository into your home directory and enter it:
cd
git clone https://github.com/witnet/witnet-operator-tools.git
cd witnet-operator-toolsInstall latest version with the
witnetuser dedicated to running the node:
sudo -u witnet ./systemd/runner.shCopy the
witnet.servicefile into/lib/systemd/system/:
sudo cp systemd/witnet.service /lib/systemd/system/witnet.serviceEvery time you change the
witnet.servicefile, you need to reload thesystemddaemon:
sudo systemctl daemon-reloadEnable the service:
sudo systemctl enable witnet.serviceStart the service:
sudo systemctl start witnet.serviceSee the logs of the service:
journalctl -f -u witnet.serviceWhen you want to restart the service:
sudo systemctl restart witnet.serviceLast updated
Was this helpful?
