You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can run lotus in any way you are familiar with, such as screen, tmux, nohup, systemd, but it is important to make it easy to operate and to keep a good log for debugging purposes.
The following are two of the more commonly used methods,Let's take the example of running lotus-miner and explain how to run the program
1. nohup
You can run lotus via nohup and redirect the logs to a file. Before running this command you need to configure your environment variables
nohup lotus-miner run >> /var/log/lotus/my-miner.log 2>&1&
Here's a little tip:
When you have finished running the program, try to exit by typing exit instead of closing the terminal. Some community members have reported that closing the terminal directly causes lotus-worker to exit (assuming you run lotus-worker this way) . You can see this discussion
2. systemd
Related docs here , you can install service (in the lotus source code directory) by run
sudo make install-services
But you need to modify the service file according to the following tips.
Tip 1:
Always specify the running user in the service file.And the system will not read the user's environment variables, so you have to configure all the environment variables in the service file for the application to run.
You can either configure it directly in the service file or have the service file read the environment variable file. And remember to import the program runtime environment variables into the user environment variables.
Usually you can import to ~/.bashrc /etc/profile
Tip 2:
You need to create the log directory manually, usually /var/log/lotus, and specify the owner of the directory as the user running the service
examples
[Unit]
Description=Lotus MinerAfter=network.targetAfter=lotus-daemon.serviceWants=lotus-daemon.service
[Service]
ExecStart=/usr/local/bin/lotus-miner runEnvironmentFile=~/filecoin/miner.envUser=fil-user # you should replace fil-user with your user hereLimitNOFILE=1048576:1048576 #ulimt
[Install]
WantedBy=multi-user.target
content of ~/filecoin/miner.env
RUST_LOG=infoGOLOG_FILE="/var/log/lotus/miner.log"GOLOG_LOG_FMT="json"BELLMAN_CPU_UTILIZATION=0.875#this value could change depend on your task typeFIL_PROOFS_MAXIMIZE_CACHING=1FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1FIL_PROOFS_USE_GPU_TREE_BUILDER=1TMPDIR=/you-tmp-dir# Used when sealing.RUSTFLAGS="-C target-cpu=native -g"FFI_BUILD_FROM_SOURCE=1# buil time envLOTUS_BACKUP_BASE_PATH=~/backups#Used when backup miner
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How to start the program
You can run lotus in any way you are familiar with, such as screen, tmux, nohup, systemd, but it is important to make it easy to operate and to keep a good log for debugging purposes.
The following are two of the more commonly used methods,Let's take the example of running lotus-miner and explain how to run the program
1. nohup
You can run lotus via nohup and redirect the logs to a file. Before running this command you need to configure your environment variables
Here's a little tip:
When you have finished running the program, try to exit by typing exit instead of closing the terminal. Some community members have reported that closing the terminal directly causes lotus-worker to exit (assuming you run lotus-worker this way) . You can see this discussion
2. systemd
Related docs here , you can install service (in the lotus source code directory) by run
But you need to modify the service file according to the following tips.
Tip 1:
Always specify the running user in the service file.And the system will not read the user's environment variables, so you have to configure all the environment variables in the service file for the application to run.
You can either configure it directly in the service file or have the service file read the environment variable file. And remember to import the program runtime environment variables into the user environment variables.
Usually you can import to ~/.bashrc /etc/profile
Tip 2:
You need to create the log directory manually, usually /var/log/lotus, and specify the owner of the directory as the user running the service
examples
content of ~/filecoin/miner.env
Beta Was this translation helpful? Give feedback.
All reactions