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 Hardware and Software page.

System service setup

Run the following commands to create the service configuration file:

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

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

full.service
sudo tee /etc/systemd/system/full.service > /dev/null << EOF
[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 \
  --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --name <NODE_NAME>
 
[Install]
WantedBy=multi-user.target
EOF

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.

full.service
sudo tee /etc/systemd/system/full.service > /dev/null << EOF
[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
EOF

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:

enable service
sudo systemctl daemon-reload
sudo systemctl enable full
sudo systemctl start full

Check the status of the service:

status
sudo 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:

logs
sudo 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.