ava-labs/avalanche-docs

Add a template for manual configuration of avalanchego.service file

socopower opened this issue · 1 comments

The Problem...
People who choose to deploy a validator node manually need to set up a ".service" file to allow the node to run in the background of the server and not from the terminal directly. This would not be a problem, except that in the official documentation there is no template or example anywhere that gives you a main idea of how to configure said .service file.

The Solution
The ideal solution would be to add a template in a section of the official avalanche documentation like this:

[Unit]
Description=Avalanche Node service
After=network.target

[Service]
User='YourUserHere'
Group='YourUserHere'
Restart=always
PrivateTmp=true
TimeoutStopSec=60s
TimeoutStartSec=10s
StartLimitInterval=120s
StartLimitBurst=5
WorkingDirectory=/usr/local/bin/avalanchego
ExecStart=/usr/local/bin/avalanchego/./avalanchego \  
   --network-id=fuji   <---Delete this entire line (including this warning itself) if you want to start the node on mainnet---

[Install]
WantedBy=multi-user.target

With a basic configuration that allows you to start running the node from the background and thus start the synchronization process.