systemd

Create a Unit for hydradx service:

nano /etc/systemd/system/hydradx.service

Paste this (check node path, user and node name):

[Unit]
Description=HydraDX

[Service]
User=root
ExecStart=/root/HydraDX-node/target/release/hydra-dx --chain lerna --name "NODE_NAME #NodeBook"
Restart=always
RestartSec=100

[Install]
WantedBy=multi-user.target

I will really appreciate it if you include the #NodeBook hashtag in the node name :)

Save it (Control+X, Y, Enter)

Enable and start service:

systemctl enable hydradx
systemctl start hydradx

Check status:

systemctl -l status hydradx -n100

If it's running smooth you will see result like this:

hydradx.service - HydraDX
   Loaded: loaded (/etc/systemd/system/hydradx.service; enabled; vendor preset: enabled)
   Active: active (running)

If you want to change unit you should reload daemon after this:

systemctl daemon-reload

Stop service:

systemctl stop hydradx

Restart service:

systemctl restart hydradx

Last updated