Skip to content

Instantly share code, notes, and snippets.

@veox
Created September 17, 2018 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veox/d1ff3f3ac4f3e013b1f03e7077b47add to your computer and use it in GitHub Desktop.
Save veox/d1ff3f3ac4f3e013b1f03e7077b47add to your computer and use it in GitHub Desktop.
systemd service files to run Trinity as user
[Unit]
Description=ethstats snitch
After=network.target
Requires=trinity.service jsonrpcproxy.service
[Service]
Type=forking
WorkingDirectory=/home/veox/src/eth-net-intelligence-api
ExecStart=/home/veox/src/eth-net-intelligence-api/node_modules/pm2/bin/pm2 start processes.json
ExecReload=/home/veox/src/eth-net-intelligence-api/node_modules/pm2/bin/pm2 reload all
ExecStop=/home/veox/src/eth-net-intelligence-api/node_modules/pm2/bin/pm2 kill
TimeoutStopSec=15
Restart=on-failure
[Install]
WantedBy=default.target
[Unit]
Description=JSON-RPC proxy to ethereum node IPC socket
After=network.target
Requires=trinity.service
[Service]
Type=simple
WorkingDirectory=/home/veox/src/jsonrpcproxy
ExecStart=/home/veox/src/jsonrpcproxy/jsonrpcproxy.py /home/veox/.local/share/trinity/ropsten/jsonrpc.ipc
Restart=on-failure
[Install]
WantedBy=default.target
[Unit]
Description=trinity ethereum node
After=network.target
[Service]
Type=simple
WorkingDirectory=/home/veox/src/py-evm
ExecStartPre=/home/veox/src/py-evm/.virtualenv/py-evm/bin/python /home/veox/src/py-evm/.virtualenv/py-evm/bin/trinity --network-id=3 fix-unclean-shutdown
# ===== ropsten =====
ExecStart=/home/veox/src/py-evm/.virtualenv/py-evm/bin/python /home/veox/src/py-evm/.virtualenv/py-evm/bin/trinity --network-id=3 --sync-mode=full --log-level=info
# ===== ropsten /w profiling =====
#ExecStart=/home/veox/src/py-evm/.virtualenv/py-evm/bin/python /home/veox/src/py-evm/.virtualenv/py-evm/bin/trinity --network-id=3 --sync-mode=full --log-level=info --profile
TimeoutStopSec=60
Restart=on-failure
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment