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/9dc8cbeb4e2d61aa4c3139ed91b50f27 to your computer and use it in GitHub Desktop.
Save Wondertan/9dc8cbeb4e2d61aa4c3139ed91b50f27 to your computer and use it in GitHub Desktop.
Lotus Worker PC2 `systemd` Service
# /etc/systemd/system/lotus-worker-pc2.service
[Unit]
Description=Lotus PC2 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=false --unseal=false --precommit2=true --commit=false --parallel-fetch-limit 10 --listen 192.168.88.102:3456
Restart=always
RestartSec=10
LimitNOFILE=1048576:1048576
# 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
# PC2 related env vars
Environment=BELLMAN_CUSTOM_GPU="GeForce RTX 3090:10496" # Set your GPU here
Environment=BELLMAN_CPU_UTILIZATION=0 # Zero means no CPU utilization. Keep it zero if you want you GPU to be fully utilized.
Environment=FIL_PROOFS_MAXIMIZE_CACHING=1
Environment=FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1
Environment=FIL_PROOFS_USE_GPU_TREE_BUILDER=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