[HOWTO] Monitor your farm, setup Chiadog inside a docker

I think a tool like Chiadog is very essential in everyone’s farming. In this how-to, I will show you guys a step-by-step of how to set it up inside a docker container (for obvious security reasons) with Telegram notification so you can forget your farm and do something else :sweat_smile:

  1. Change the log level to INFO in Chia by running:
    ./chia configure -log-level=INFO

  2. Pull Chiadog from Github:
    git clone https://github.com/martomi/chiadog.git

  3. Install Docker. Please note that my farm is running on Raspberry Pi 4 B 8GB with Ubuntu 21.04. Therefore I will pull the docker image corresponding to my system - arm64v8/ubuntu. You can pull a different image as it doesn’t matter, but I recommend anything Ubuntu :sweat_smile:

sudo apt install docker.io
sudo docker pull arm64v8/ubuntu
  1. Create a docker container for Chiadog
  • First, create an empty file called “chiadog_docker_setup.sh”. It will be used only once but it’s easier to carefully create and then run the edited script as a file later. Inside a script file, enter this code:
docker run -it \
 --mount type=bind,source=/home/your_username/chiadog,target=/home/your_username/chiadog \
 --mount type=bind,source=/home/your_username/.chia/mainnet/log,target=/home/your_username/.chia/mainnet/log \
arm64v8/ubuntu
  • The above script assumes that everything is installed in its default location/directory. The source path is the actual location in your system. The target path is the location you want it to appear inside a docker container. In order to avoid confusion, I use the same path for both of them.
  • Save the script file and run it in the terminal:
    sudo sh chiadog_docker_setup.sh
  1. Setup the prerequisites for Chiadog inside the container
apt update
apt upgrade
apt install python3
apt install python3-pip
pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --upgrade --proxy=127.0.0.1:3128 wheel
  1. Install Chiadog inside the container
cd /home/your_username/chiadog
./install.sh
cp config-example.yaml config.yaml
  1. Setup Telegram Bot for Chiadog’s notification (you can use other services but I prefer Telegram)
  • Visit BotFather and kindly ask him to make you a new bot by typing /newbot in the chat room. He will help you set up a new bot. Follow his instructions and you will get your bot token at the end of the process.
  • Get your ID by asking the IDBot by typing /getid in the chat room.
  1. Setup Chiadog’s config.yaml file inside the container:
apt install nano
nano config.yaml
  • In the log section, change file_path in to your Chia’s log location
chia_logs:
  file_log_consumer:
    enable: true
    file_path: '/home/your_username/.chia/mainnet/log/debug.log'
  • In the notifier section, enable Telegram
telegram:
  enable: true
  daily_stats: true
  wallet_events: true
  credentials:
    bot_token: 'your_bot_token'
    chat_id: 'your_telegram_id'
  1. Run Chiadog inside the container:
    ./start.sh
    If everything goes well, you should see something like Detected new plots. Farming with 42 plots.

  2. To stop the container, open a new terminal then list (to get the container’s ID) and stop your running container by:

sudo docker ps
sudo docker stop your_container_id
  1. To start the container again in order to run Chiadog
sudo docker start -i your_container_id
cd /home/your_username/chiadog
./start.sh

You can also put sudo docker start -i your_container_id into a new script file that you will use every time when you want to run this container again in the future so you don’t have to remember your_container_id:

  • Create a new script file called chiadog_docker.sh.
  • Put sudo docker start -i your_container_id inside the script.
  • Run it by sudo sh chiadog_docker.sh.

I hope this helps :sweat_smile:

4 Likes

Anyone checked the code for malicious sections?

Do you actually know how the docker works, right?

:sweat_smile: