Skip to content

Instantly share code, notes, and snippets.

@Wondertan
Last active January 1, 2022 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Wondertan/7fbc6653b9ca022ab5dde22f4b1bf77d to your computer and use it in GitHub Desktop.
Save Wondertan/7fbc6653b9ca022ab5dde22f4b1bf77d to your computer and use it in GitHub Desktop.
Lotus PC1 Worker `systemd` service.
# /etc/systemd/system/lotus-worker-pc1.service
[Unit]
Description=Lotus PC1 Worker Service
After=network.target
[Service]
User=lotus # or any other user
ExecStart=/usr/local/bin/lotus-worker run --no-local-storage --addpiece=false --precommit1=true --unseal=true --precommit2=false --commit=false --parallel-fetch-limit 10 --listen 192.168.88.106:3456
Restart=always
RestartSec=10
LimitNOFILE=1048576:1048576
LimitMEMLOCK=1000000000 # Set this acording to amount of RAM you have for a worker.
# Required Paths
# Most paths below relies on /lotus path, but you can use any path, though I generally recommend using my package structure
Environment=LOTUS_WORKER_PATH=/lotus/worker-repo
Environment=FIL_PROOFS_PARAMETER_CACHE=/lotus/params
Environment=FIL_PROOFS_PARENT_CACHE=/lotus/parents
Environment=TMPDIR=/lotus/tmp
# PC1 related env vars
# Fill here vars like SDR related that suits your hardware
# For 7F52 I use that's the only param needed.
Environment=FIL_PROOFS_MAXIMIZE_CACHING=1
# Logging
Environment=GOLOG_OUTPUT=file
Environment=GOLOG_FILE=/lotus/logs/worker.log
#Environment=GOLOG_LOG_FMT=json # Uncomment this in case you want machine readable logs in JSON
Environment=RUST_LOG=info
Environment=RUST_BACKTRACE=full
StandardOutput=append:/lotus/logs/worker_rust.log
# Access to Miner/Daemon
Environment=FULLNODE_API_INFO= # sensetive info, should be gathered from lotus auth api-info --perm admin
Environment=MINER_API_INFO= # sensetive info, should be gathered from lotus-miner auth api-info --perm admin
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment