Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,64 @@ If you decide to stop running the off-chain bot indefinitely, follow the steps b

By following these steps, you'll terminate the bot and retrieve your setup UTXOs.

## Running Duckpools Off-Chain Bot as a Systemd Service
These steps will setup the off-chain-bot to run in the background upon startup and reboot automatically, unless you shut it down.

To ensure the Duckpools Off-Chain Bot starts automatically on system boot, you can set it up as a systemd service (Note: this is for a Linux setup). Follow these steps:

1. **Create a systemd Service File**

Create a new service file named `duckpools-bot.service` in the `/etc/systemd/system/` directory.

```bash
sudo nano /etc/systemd/system/duckpools-bot.service
```

2. **Configure the Service File**

Add the following configuration to the service file. Be sure to replace <your-username> with your actual username and /path/to/your/off-chain-bot with the full path to your bot's directory.

```bash
[Unit]
Description=Duckpools Off-Chain Bot
After=network.target

[Service]
User=<your-username>
WorkingDirectory=/path/to/your/off-chain-bot
ExecStart=/usr/bin/python3 main.py
Restart=always
Environment="API_KEY=your_api_key_value"
Environment="WALLET_PASS=your_wallet_pass_value"

[Install]
WantedBy=multi-user.target
```
3. **Reload, Enable, Start**

After saving the service file, reload the systemd daemon to apply the new service. Enable the service to start on boot, and then start the service immediately.

```bash
sudo systemctl daemon-reload
sudo systemctl enable duckpools-bot.service
sudo systemctl start duckpools-bot.service
```

4. **Verify the system is running**

```bash
sudo systemctl status duckpools-bot.service
```

**Note:** Ensure that python3 is the correct path for Python 3.x on your system. Adjust the ExecStart path as needed. The service file assumes that your main.py script is set up to run continuously or as a daemon.

5. **Check The Logs Realtime**
To check the main.py output realtime, check the live logs using:

```bash
sudo journalctl -fu duckpools-bot.service
```

### Disclaimer
By running this software, you assume all responsibility and risk associated with its operation. Users are to exercise caution and perform their own due diligence when running the bot, especially in a live environment.

Expand Down