Skip to content

Commit

Permalink
README: Update instructions to use scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
martomi committed Apr 27, 2021
1 parent b8368df commit 65c9f68
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 30 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ config.yaml
# dev files
.idea
venv
.venv

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
52 changes: 30 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,18 @@ For detailed guide on how to test and configure, please refer to [INTEGRATIONS.m

## Pre-requisites

- UNIX-based OS (Linux/Mac) - for
Windows, [try this](https://github.com/martomi/chiadog/issues/7#issuecomment-815544302).
- Linux, MacOS, Windows
- Python 3.7+
- Enabled `INFO` logs on your chia farmer

### How to enable INFO logs on chia farmer?

First configure the log level to `INFO`. This ensures that all logs necessary for chiadog to operate are available
under `~/.chia/mainnet/log/debug.log`.
under `~/.chia/mainnet/log/debug.log`. (Windows: `C:\Users\<username>\.chia\mainnet\log\debug.log`)

Windows: The below commands are equivalent on Windows. But you need go to this
folder `cd C:\Users\<username>\AppData\Local\chia-blockchain\app-1.1.0\resources\app.asar.unpacked\daemon` and execute
with `.\chia.exe ...`

```
chia configure -log-level=INFO
Expand Down Expand Up @@ -88,46 +91,36 @@ git clone https://github.com/martomi/chiadog.git
cd chiadog
```

2. Create virtual env (Recommended)
2. Run the install script.

```
python3 -m venv venv
. ./venv/bin/activate
```
# Linux & MacOS
./install.sh
3. Update `pip3` to latest version

```
python3 -m pip install --upgrade pip
# Windows
./install.ps1
```

4. Install the dependencies:

```
pip3 install wheel && pip3 install -r requirements.txt
```

5. Copy the example config file
3. Copy the example config file

```
cp config-example.yaml config.yaml
```

6. Open up `config.yaml` in your editor and configure it to your preferences.
4. Open up `config.yaml` in your editor and configure it to your preferences.

## Updating to the latest release

_Skip this if you followed the above section_.

```
cd chiadog
. ./venv/bin/activate
git fetch
git checkout main
git pull
pip3 install -r requirements.txt
./install.sh
```

> Important: Automated migration of config is not supported. Please check that your `config.yaml` has all new fields introduced in `config-example.yaml` and add anything missing. If correctly migrated, you shouldn't get any ERROR logs.
Expand All @@ -141,7 +134,11 @@ pip3 install -r requirements.txt
2. Start the watchdog

```
python3 main.py --config config.yaml
# Linux / MacOS
./start.sh
# Windows
./start.ps1
```

3. Verify that your plots are detected. Within a few seconds you should see INFO log:
Expand All @@ -158,6 +155,7 @@ advanced section of the README.
The best way to check that everything works on your system is to run the unit tests:

```
. ./venv/bin/activate
python3 -m unittest
```

Expand Down Expand Up @@ -185,6 +183,7 @@ every 10 minutes. If it does not, it will notify you. It has integrations with P
## Running `chiadog` in the background

```
. ./venv/bin/activate
nohup python3 -u main.py --config config.yaml > output.log &
```

Expand Down Expand Up @@ -256,8 +255,17 @@ ssh -i "~/.ssh/id_ed25519" <user>@<ip_address>
as it allows you to split your terminal in multiple windows and have a cockpit-like overview.

```
. ./venv/bin/activate
python3 main.py --config config-harvester-1.yaml
```

```
. ./venv/bin/activate
python3 main.py --config config-harvester-2.yaml
```

```
. ./venv/bin/activate
python3 main.py --config config-harvester-3.yaml
```

Expand Down
4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ elseif (Get-Command python3 -errorAction SilentlyContinue) {
}

# Create virtual environment
Invoke-expression "$($command) -m venv .venv"
Invoke-expression "$($command) -m venv venv"

# Activate the virtual environment
./.venv/Scripts/activate.ps1
./venv/Scripts/activate.ps1

# Update pip to latest version
Invoke-expression "$($command) -m pip install --upgrade pip"
Expand Down
4 changes: 2 additions & 2 deletions install.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Create virtual environment
python3 -m venv .venv
python3 -m venv venv

# Activate virtual environment
. ./.venv/bin/activate
. ./venv/bin/activate

# Update pip3 to latest version
python3 -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ elseif (Get-Command python3 -errorAction SilentlyContinue) {
}

# Activate the virtual environment
./.venv/Scripts/activate.ps1
./venv/Scripts/activate.ps1

# Start the ChiaDog
Invoke-expression "$($command) main.py --config config.yaml"
4 changes: 2 additions & 2 deletions start.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Activate the virtual environment
. ./.venv/bin/activate
. ./venv/bin/activate

# Start the ChiaDog
python3 main.py --config config.yaml
python3 main.py --config config.yaml

0 comments on commit 65c9f68

Please sign in to comment.