Docs
Ecosystem Roles
Validator
Running with Systemd
Full Node

Running with Systemd

You can run your full node as a systemd process so that it will automatically restart on server reboots or crashes (and helps to avoid getting slashed!).

Before following this guide you should have already set up your machines environment, installed the dependencies, and compiled the Tangle binary. If you have not done so, please refer to the Requirements (opens in a new tab) page.

System service setup

Run the following commands to create the service configuration file:

# Move the tangle-standalone binary to the bin directory (assumes you are in repo root directory)
sudo mv ./target/release/tangle-standalone /usr/bin/

# navigate to /etc
cd /etc/systemd/system

# create the service configuration file
sudo touch full.service

Add the following contents to the service configuration file. Make sure to replace the USERNAME with the username you created in the previous step, add your own node name, and update any paths or ports to your own preference.

Note: The below configuration assumes you are targeting the Tangle Network chainspec.

Full Node

[Unit]
Description=Tangle Full Node
After=network-online.target
StartLimitIntervalSec=0

[Service]
User=<USERNAME>
Restart=always
RestartSec=3
ExecStart=/usr/bin/tangle-standalone \
  --base-path /data/full-node \
  --name <NODE-NAME> \
  --chain tangle-testnet \
  --node-key-file "/home/<USERNAME>/node-key" \
  --rpc-cors all \
  --port 9946 \
  --no-mdns

[Install]
WantedBy=multi-user.target

Full Node with evm trace

Note: To run with evm trace, you should use a binary built with txpool flag, refer requirements page for more details.

[Unit]
Description=Tangle Full Node
After=network-online.target
StartLimitIntervalSec=0

[Service]
User=<USERNAME>
Restart=always
RestartSec=3
ExecStart=/usr/bin/tangle-standalone \
  --base-path /data/full-node \
  --name <NODE-NAME> \
  --chain tangle-testnet \
  --node-key-file "/home/<USERNAME>/node-key" \
  --rpc-cors all \
  --port 9946 \
  --no-mdns --ethapi trace,debug,txpool

[Install]
WantedBy=multi-user.target

Enable the services

Double check that the config has been written to /etc/systemd/system/full.service correctly. If so, enable the service so it runs on startup, and then try to start it now:

sudo systemctl enable full

sudo systemctl start full

Check the status of the service:

systemctl status full

You should see the node connecting to the network and syncing the latest blocks. If you need to tail the latest output, you can use:

journalctl -u full.service -f

Congratulations! You have officially setup a Tangle Network node using Systemd. If you are interested in learning how to setup monitoring for your node, please refer to the monitoring page.