Skip to content

Instantly share code, notes, and snippets.

@appleseed-iii
Last active November 1, 2021 21:52
Show Gist options
  • Save appleseed-iii/06dfc9752f994a02a0bb351f42e2e2de to your computer and use it in GitHub Desktop.
Save appleseed-iii/06dfc9752f994a02a0bb351f42e2e2de to your computer and use it in GitHub Desktop.
geth service systemctl
# sudo nano /etc/systemd/system/geth.service
# run with:
# sudo systemctl start geth.service
# sudo systemctl status geth.service
# debugging:
sudo runuser -l ubuntu -c "geth --http --http.addr "127.0.0.1" --http.corsdomain "*" --http.port "8545" --syncmode "light" 2>/home/ubuntu/.ethereum/geth.log"
# could also use screen
# type screen
# then launch node and hit ctrl + a + d itll detach and hide
# if you want to reconnect you do screen -r
# not working...
[Unit]
Description=geth light node service
[Service]
Type=simple
Restart=always
RestartSec=15
User=ubuntu
# start command from gethcommand.bash
ExecStart=geth --http --http.addr "127.0.0.1" --http.corsdomain "*" --http.port "8545" --syncmode "light" 2>/home/ubuntu/.ethereum/geth.log
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment