From 9fb9c8bf5761f031f19fc1fd09402504b85cb0e9 Mon Sep 17 00:00:00 2001 From: Guy Davis Date: Tue, 19 Dec 2023 16:16:20 -0700 Subject: [PATCH] Better support for integrations. --- CHANGELOG.md | 8 ++++++++ VERSION | 2 +- docker/dockerfile | 1 + scripts/forks/chia_install.sh | 8 +++++++- scripts/forks/chia_launch.sh | 4 ++++ scripts/forks/gigahorse_launch.sh | 4 ++++ 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3921f8a7..b9ef0b3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased +### Added + - Optionally launch `chia-exporter` [metrics endpoint](https://github.com/Chia-Network/chia-exporter) for Prometheus reporting if env var `chia_exporter=true` is set. +### Changed + - Optionally launch of Gigahorse recompute server when in harvester mode if env var `gigahorse_recompute_server=true` is set. +### Updated + - TBD + ## [2.1.3] - 2023-12-19 ### Updated - [Chia](https://github.com/Chia-Network/chia-blockchain/releases/tag/2.1.3) to v2.1.3 - fix for unforunate bug CNI released in 2.1.2 diff --git a/VERSION b/VERSION index abae0d9a..c346e7a0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.3 \ No newline at end of file +2.1.4 \ No newline at end of file diff --git a/docker/dockerfile b/docker/dockerfile index 78b2182e..d62c888e 100644 --- a/docker/dockerfile +++ b/docker/dockerfile @@ -101,6 +101,7 @@ ENV keys="/root/.chia/mnemonic.txt" ENV plots_dir="/plots" # One of fullnode, farmer, harvester, plotter, farmer+plotter, harvester+plotter. Default is fullnode ENV mode="fullnode" +ENV chia_exporter="false" ENV chives_masternode="false" ENV gigahorse_recompute_server="false" # The single blockchain to run: chia, flax, nchain, hddcoin, chives, etc diff --git a/scripts/forks/chia_install.sh b/scripts/forks/chia_install.sh index 19500998..32b8561d 100644 --- a/scripts/forks/chia_install.sh +++ b/scripts/forks/chia_install.sh @@ -10,7 +10,7 @@ if [ -z ${CHIA_BRANCH} ]; then else cd /tmp rm -rf /root/.cache - apt-get update && apt-get install -y dialog apt-utils + apt-get update && apt-get install -y dialog apt-utils ca-certificates curl gnupg /usr/bin/bash /machinaris/scripts/gpu_drivers_install.sh git clone --branch ${CHIA_BRANCH} --recurse-submodules=mozilla-ca https://github.com/Chia-Network/chia-blockchain.git /chia-blockchain @@ -33,4 +33,10 @@ else curl -sLJO https://github.com/Chia-Network/chia-blockchain/releases/download/2.1.3/chia-blockchain-cli_2.1.3-1_arm64.deb apt-get install ./chia-blockchain-cli*.deb fi + + # Also include "chia-exporter" for Prometheus reporting endpoints. + curl -sL https://repo.chia.net/FD39E6D3.pubkey.asc | sudo gpg --dearmor -o /usr/share/keyrings/chia.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/chia.gpg] https://repo.chia.net/chia-exporter/debian/ stable main" | tee /etc/apt/sources.list.d/chia-exporter.list > /dev/null + apt-get update + apt-get install -y chia-exporter fi diff --git a/scripts/forks/chia_launch.sh b/scripts/forks/chia_launch.sh index d8962bb6..bfa1371a 100644 --- a/scripts/forks/chia_launch.sh +++ b/scripts/forks/chia_launch.sh @@ -95,6 +95,10 @@ if [[ ${mode} =~ ^fullnode.* ]]; then else chia start farmer fi + if [[ ${chia_exporter} == "true" ]]; then + echo "Starting Chia Exporter service for Prometheus reporting..." + sleep 20 && /usr/local/bin/chia-exporter serve 2>&1 > /root/.chia/mainnet/log/chia-exporter.log & + fi if [[ ${mode} =~ .*timelord$ ]]; then if [ ! -f vdf_bench ]; then echo "Building timelord binaries..." diff --git a/scripts/forks/gigahorse_launch.sh b/scripts/forks/gigahorse_launch.sh index 8f5766f0..8a2c78d1 100644 --- a/scripts/forks/gigahorse_launch.sh +++ b/scripts/forks/gigahorse_launch.sh @@ -129,6 +129,10 @@ elif [[ ${mode} =~ ^harvester.* ]]; then /chia-gigahorse-farmer/chia.bin configure --set-farmer-peer ${farmer_address}:${farmer_port} 2>&1 >> /root/.chia/mainnet/log/init.log /chia-gigahorse-farmer/chia.bin configure --enable-upnp false 2>&1 >> /root/.chia/mainnet/log/init.log /chia-gigahorse-farmer/chia.bin start harvester -r + if [[ ${gigahorse_recompute_server} == "true" ]]; then + echo "Starting Gigahorse recompute_server shortly..." + sleep 20 && /chia-gigahorse-farmer/chia_recompute_server 2>&1 > /root/.chia/mainnet/log/recompute.log & + fi fi elif [[ ${mode} == 'plotter' ]]; then echo "Starting in Plotter-only mode. Run Plotman from either CLI or WebUI."