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/12fecf90ea00578987d02359f1fbbc1b to your computer and use it in GitHub Desktop.
Save Wondertan/12fecf90ea00578987d02359f1fbbc1b to your computer and use it in GitHub Desktop.
Lotus Miner `systemd` Service
# /etc/systemd/system/lotus-miner.service
[Unit]
Description=Lotus Miner Service
After=network.target
After=lotus-daemon.service
Wants=lotus-daemon.service
[Service]
User=lotus # or any other user
ExecStart=/usr/local/bin/lotus-miner run
ExecStop=/usr/local/bin/lotus-miner stop
Restart=always
RestartSec=10
LimitNOFILE=1048576:1048576
# Most paths below relies on /lotus path, but you can use any path, though I generally recommend using my package structure
Environment=LOTUS_PATH=/lotus/daemon-repo
Environment=LOTUS_MINER_PATH=/lotus/miner-repo
Environment=FIL_PROOFS_PARAMETER_CACHE=/lotus/params
Environment=FIL_PROOFS_PARENT_CACHE=/lotus/parents
Environment=TMPDIR=/lotus/tmp
Environment=BELLMAN_CUSTOM_GPU="GeForce RTX 2080 Ti:4352" # 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=GOLOG_OUTPUT=file
Environment=GOLOG_FILE=/lotus/logs/miner.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/miner_rust.log
Environment=FULLNODE_API_INFO= # sensetive info, should be gathered from lotus 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