madMAx43v3r / chia-gigahorse

221 stars 31 forks source link

chia start farmer fails if the cwd is not set to gigahorse's directory #11

Open aa15032261 opened 1 year ago

aa15032261 commented 1 year ago

Screenshot from 2023-02-13 22-31-24

Screenshot from 2023-02-13 22-30-02

madMAx43v3r commented 1 year ago

yes, that's expected, it only works that way currently

aramod commented 1 year ago

Tell me what to do to run chia.bin as systemctl? Gives the same error as in the screenshot above

aa15032261 commented 1 year ago

Tell me what to do to run chia.bin as systemctl? Gives the same error as in the screenshot above

This is what I have:

[Unit]
Description=Chia Daemon Service
After=network.target

[Service]
WorkingDirectory=/opt/chia-gigahorse-farmer
ExecStart=/opt/chia-gigahorse-farmer/chia.bin run_daemon
ExecStartPost=sleep 5
ExecStartPost=/opt/chia-gigahorse-farmer/chia.bin start farmer
Restart=always
RestartSec=10
User=[your username]

[Install]
WantedBy=multi-user.target

Don't forget to change the path and username

aramod commented 1 year ago

Thank you! It worked

aramod commented 1 year ago
 systemd[1]: Starting Chia Daemon Service...
 chia.bin[5903]: Chia directory /home/ch/.chia/mainnet
 chia.bin[5903]: WARNING: using a farmer address which we might not have the private keys for. We searched the first 50 >
 chia.bin[5903]: /home/ch/.chia/mainnet already exists, no migration action taken
 chia.bin[5903]: {"ca_crt": "/home/ch/.chia/mainnet/config/ssl/ca/private_ca.crt", "cert": /home/ch/.chia/mainnet/config/ssl/daemon/private_da>
chia.bin[6634]: Daemon not started yet
chia.bin[6634]: Starting daemon
chia.bin[6634]: Daemon not started yet
chia.bin[6634]: Failed to create the chia daemon
systemd[1]: Started Chia Daemon Service.

After the restart, there was such an error, help me solve it

Here is my task

[Unit]
Description=Chia Daemon Service
After=network.target

[Service]
WorkingDirectory=/opt/chia-gigahorse-farmer
ExecStart=/opt/chia-gigahorse-farmer/chia.bin run_daemon
ExecStartPost=sleep 5
ExecStartPost=/opt/chia-gigahorse-farmer/chia.bin start farmer
Restart=always
RestartSec=10
User=ch

[Install]
WantedBy=multi-user.target