To create a service file using the nano text editor, follow these steps:
- Navigate to the "/etc/systemd/system" directory using the command: cd /etc/systemd/system.
- Start editing the "gear-node.service" file with the command: sudo nano gear-node.service.
- In the nano editor, you will see an empty document. Paste the following code, replacing "NODE_NAME" with your desired node name:
[Unit]
Description=Gear Node
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root/
ExecStart=/root/gear-node --name 'NODE_NAME' --telemetry-url 'ws://telemetry-backend-shard.gear-tech.io:32001/submit 0'
Restart=always
RestartSec=3
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
After making the necessary changes, save the file by pressing
CTRL + S.
Exit the nano editor by pressing
CTRL + X.
You have now created the service file for the Gear node.