|
| 1 | +# Chia Healthcheck |
| 2 | + |
| 3 | +Chia Healthcheck is an application that is intended to run alongside a chia installation and return a simple healthy or unhealthy response for supported chia services. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +Download the correct executable file from the release page and run. If you are on debian/ubuntu, you can install using the apt repo, documented below. |
| 8 | + |
| 9 | +### Apt Repo Installation |
| 10 | + |
| 11 | +#### Set up the repository |
| 12 | + |
| 13 | +1. Update the `apt` package index and install packages to allow apt to use a repository over HTTPS: |
| 14 | + |
| 15 | +```shell |
| 16 | +sudo apt-get update |
| 17 | + |
| 18 | +sudo apt-get install ca-certificates curl gnupg |
| 19 | +``` |
| 20 | + |
| 21 | +2. Add Chia's official GPG Key: |
| 22 | + |
| 23 | +```shell |
| 24 | +curl -sL https://repo.chia.net/FD39E6D3.pubkey.asc | sudo gpg --dearmor -o /usr/share/keyrings/chia.gpg |
| 25 | +``` |
| 26 | + |
| 27 | +3. Use the following command to set up the stable repository. |
| 28 | + |
| 29 | +```shell |
| 30 | +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/chia.gpg] https://repo.chia.net/chia-healthcheck/debian/ stable main" | sudo tee /etc/apt/sources.list.d/chia-healthcheck.list > /dev/null |
| 31 | +``` |
| 32 | + |
| 33 | +#### Install Chia Healthcheck |
| 34 | + |
| 35 | +1. Update the apt package index and install the latest version of Chia Healthcheck |
| 36 | + |
| 37 | +```shell |
| 38 | +sudo apt-get update |
| 39 | + |
| 40 | +sudo apt-get install chia-healthcheck |
| 41 | +``` |
| 42 | + |
| 43 | +## Usage |
| 44 | + |
| 45 | +First, install [chia-blockchain](https://github.com/Chia-Network/chia-blockchain). Chia healthcheck expects to be run on the same machine as the chia blockchain installation, and will use either the default chia config (`~/.chia/mainnet/`) or else the config located at `CHIA_ROOT`, if the environment variable is set. |
| 46 | + |
| 47 | +`chia-healthcheck serve` will start the healthcheck service on the default port of `9915`. |
| 48 | + |
| 49 | +You can check the status of the full node at `<hostname>:9915/full_node`. A response code `200` indicates the full node is receiving new blocks, while a response code of `500` would indicate that a new block has not been received within the healthcheck interval (5 minutes by default). |
| 50 | + |
| 51 | +### Configuration |
| 52 | + |
| 53 | +Configuration options can be passed using command line flags, environment variables, or a configuration file, except for `--config`, which is a CLI flag only. For a complete listing of options, run `chia-healthcheck --help`. |
| 54 | + |
| 55 | +To set a config value as an environment variable, prefix the name with `CHIA_HEALTHCHECK_`, convert all letters to uppercase, and replace any dashes with underscores (`healthcheck-port` becomes `CHIA_HEALTHCHECK_HEALTHCHECK_PORT`). |
| 56 | + |
| 57 | +To use a config file, create a new yaml file and place any configuration options you want to specify in the file. The config file will be loaded by default from `~/.chia-healthcheck.yaml`, but the location can be overridden with the `--config` flag. |
| 58 | + |
| 59 | +```yaml |
| 60 | +healthcheck-port: 9915 |
| 61 | +``` |
0 commit comments