From f0fcfbd01775c0769edbca4f44e1d8ccd760f46c Mon Sep 17 00:00:00 2001 From: Michal Zukowski Date: Thu, 26 Feb 2026 12:03:15 +0100 Subject: [PATCH 1/4] Allow configuration of worker_id overrides in IHP miner installer --- installer/README.md | 2 +- installer/miner_install.sh | 42 +++++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/installer/README.md b/installer/README.md index 8ec711e..34dd0c7 100644 --- a/installer/README.md +++ b/installer/README.md @@ -82,7 +82,7 @@ In `braiins` mode, the installer provisions Braiins Farm Proxy (`farm-proxy` and - APS miner updates subnet allocation by pool `name` in `proxy/pools.toml` (`[[pools.main]]` entry), not by host/port. - The miner container uses `APS_MINER_SUBNET_POOL_NAME` (default: `central-proxy`) to select which pool gets absolute `target_hashrate`. - The selected pool name must exist in `proxy/pools.toml`; otherwise no subnet target update is applied. -- During installation, if `proxy/pools.toml` does not exist yet, the script asks for backup/private pool host/port and writes those values to `pools.backup`. +- During installation, if `proxy/pools.toml` does not exist yet, the script asks for backup/private pool host/port, optional backup `worker_id` override, and for `central-proxy` asks whether to use suggested identity format or set `worker_id` manually (manual input may be empty for no override), then writes provided values to `pools.backup`/`[[pools.main]]`. - Installer default sets `[extranonce].extranonce2_size = 2`. - After updating `proxy/pools.toml`, APS miner touches reload sentinel `APS_MINER_IHP_RELOAD_SENTINEL` (default: `/root/src/proxy/.reload-ihp`); sidecar `ihp-proxy-reloader` then runs `kill -HUP 1` in `ihp-proxy` PID namespace. diff --git a/installer/miner_install.sh b/installer/miner_install.sh index 22d4762..ec68b2d 100644 --- a/installer/miner_install.sh +++ b/installer/miner_install.sh @@ -49,6 +49,8 @@ write_default_ihp_pools() { local destination="$1" local backup_pool_host="$2" local backup_pool_port="$3" + local backup_pool_worker_id="${4:-}" + local main_pool_worker_id="${5:-}" cat > "${destination}" <> "${destination}" <> "${destination}" <> "${destination}" <> "${destination}" < Date: Thu, 26 Feb 2026 12:22:49 +0100 Subject: [PATCH 2/4] Pull newst images after install --- installer/miner_install.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/installer/miner_install.sh b/installer/miner_install.sh index ec68b2d..d91d6bb 100644 --- a/installer/miner_install.sh +++ b/installer/miner_install.sh @@ -446,6 +446,23 @@ if ! /tmp/update_miner_compose.sh "${ENV_NAME}" "${WORKING_DIRECTORY}"; then fi echo "update_miner_compose.sh ran successfully." +echo "Pulling latest images and recreating services..." +if command -v docker &> /dev/null && docker compose version &> /dev/null; then + if ! (cd "${WORKING_DIRECTORY}" && docker compose pull && docker compose up -d --remove-orphans); then + echo "Error: docker compose pull/up failed." + exit 1 + fi +elif command -v docker-compose &> /dev/null; then + if ! (cd "${WORKING_DIRECTORY}" && docker-compose pull && docker-compose up -d --remove-orphans); then + echo "Error: docker-compose pull/up failed." + exit 1 + fi +else + echo "Error: Neither docker compose nor docker-compose is available." + exit 1 +fi +echo "Latest images applied successfully." + CRON_CMD="*/15 * * * * cd ${WORKING_DIRECTORY} && curl -s ${GITHUB_URL}/deploy-config-${ENV_NAME}/installer/update_miner_compose.sh > /tmp/update_miner_compose.sh && chmod +x /tmp/update_miner_compose.sh && /tmp/update_miner_compose.sh ${ENV_NAME} ${WORKING_DIRECTORY} # INFINITE_HASH_APS_MINER_UPDATE" (crontab -l 2>/dev/null || echo "") | grep -v "INFINITE_HASH_APS_MINER_UPDATE" | { cat; echo "${CRON_CMD}"; } | crontab - From e3b3250872169d402a8fd8f2f8d446e3a0a87233 Mon Sep 17 00:00:00 2001 From: Michal Zukowski Date: Thu, 26 Feb 2026 12:36:16 +0100 Subject: [PATCH 3/4] Correct wallet path --- installer/README.md | 2 +- installer/miner_install.sh | 27 ++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/installer/README.md b/installer/README.md index 34dd0c7..2c19f53 100644 --- a/installer/README.md +++ b/installer/README.md @@ -66,7 +66,7 @@ An installer for the APS miner (APScheduler-based miner) is also available: curl -s https://raw.githubusercontent.com/backend-developers-ltd/InfiniteHash/refs/heads/deploy-config-prod/installer/miner_install.sh | bash ``` -This script prompts for `WORKING_DIRECTORY` (default: `~/InfiniteHash-miner/`), then prompts for TOML configuration values and proxy mode. Worker configuration uses v2 grouped input (`hashratePHxcount`, e.g. `0.45x10,0.25x4`) and is written to `[workers.worker_sizes]` in `config.toml`. The installer then deploys the miner stack with Docker Compose and installs a cron job that keeps the compose file up to date by calling `installer/update_miner_compose.sh`. +This script prompts for `WORKING_DIRECTORY` (default: `~/InfiniteHash-miner/`), then prompts for TOML configuration values and proxy mode. Wallet directory prompt is host-side (used for local hotkey lookup), while `config.toml` wallet directory is normalized for container runtime (`/root/.bittensor/wallets`). Worker configuration uses v2 grouped input (`hashratePHxcount`, e.g. `0.45x10,0.25x4`) and is written to `[workers.worker_sizes]` in `config.toml`. The installer then deploys the miner stack with Docker Compose and installs a cron job that keeps the compose file up to date by calling `installer/update_miner_compose.sh`. For `ihp` mode, default proxy template files (`proxy/.env` and `proxy/pools.toml`) are generated directly by the installer script (inline templates), not downloaded from external template files. diff --git a/installer/miner_install.sh b/installer/miner_install.sh index d91d6bb..d73ab86 100644 --- a/installer/miner_install.sh +++ b/installer/miner_install.sh @@ -13,6 +13,8 @@ fi GITHUB_URL="https://raw.githubusercontent.com/backend-developers-ltd/InfiniteHash/refs/heads" MAX_V2_WORKER_SIZE_PH="0.45" MAX_V2_TOTAL_WORKERS=1000 +DEFAULT_HOST_WALLET_DIRECTORY="~/.bittensor/wallets" +CONTAINER_WALLET_DIRECTORY="/root/.bittensor/wallets" mkdir -p "${WORKING_DIRECTORY}" WORKING_DIRECTORY=$(realpath "${WORKING_DIRECTORY}") @@ -113,8 +115,9 @@ if [ ! -f "${CONFIG_FILE}" ]; then BITTENSOR_NETUID=${BITTENSOR_NETUID:-89} BITTENSOR_NETUID=$(echo "${BITTENSOR_NETUID}" | tr -d '[:space:]') - read -r -p "Enter BITTENSOR_WALLET_DIRECTORY [~/.bittensor/wallets]: " BITTENSOR_WALLET_DIRECTORY ${CONTAINER_WALLET_DIRECTORY}" + sed -i "/^\\[wallet\\]/,/^\\[/{s|^directory = \".*\"|directory = \"${CONTAINER_WALLET_DIRECTORY}\"|}" "${CONFIG_FILE}" + BITTENSOR_WALLET_DIRECTORY="${CONTAINER_WALLET_DIRECTORY}" + fi fi expand_path() { @@ -267,8 +277,19 @@ expand_path() { fi } -WALLET_DIR_EXPANDED=$(expand_path "${BITTENSOR_WALLET_DIRECTORY}") +if [ -z "${HOST_WALLET_DIRECTORY:-}" ] || [ "${HOST_WALLET_DIRECTORY}" = "${CONTAINER_WALLET_DIRECTORY}" ]; then + HOST_WALLET_DIRECTORY="${DEFAULT_HOST_WALLET_DIRECTORY}" +fi + +WALLET_DIR_EXPANDED=$(expand_path "${HOST_WALLET_DIRECTORY}") HOTKEY_PUB_FILE="${WALLET_DIR_EXPANDED}/${BITTENSOR_WALLET_NAME}/hotkeys/${BITTENSOR_WALLET_HOTKEY_NAME}pub.txt" +if [ ! -f "${HOTKEY_PUB_FILE}" ]; then + FALLBACK_WALLET_DIR="${HOME}/.bittensor/wallets" + FALLBACK_HOTKEY_PUB_FILE="${FALLBACK_WALLET_DIR}/${BITTENSOR_WALLET_NAME}/hotkeys/${BITTENSOR_WALLET_HOTKEY_NAME}pub.txt" + if [ -f "${FALLBACK_HOTKEY_PUB_FILE}" ]; then + HOTKEY_PUB_FILE="${FALLBACK_HOTKEY_PUB_FILE}" + fi +fi HOTKEY_SS58="" if [ -f "${HOTKEY_PUB_FILE}" ]; then HOTKEY_SS58=$(sed -n 's/.*"ss58Address":"\([^"]*\)".*/\1/p' "${HOTKEY_PUB_FILE}") From edc9938888a4a6d73d0c14743deb5bb76d9301fa Mon Sep 17 00:00:00 2001 From: Michal Zukowski Date: Thu, 26 Feb 2026 12:40:12 +0100 Subject: [PATCH 4/4] Bash lint fixup --- installer/miner_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/miner_install.sh b/installer/miner_install.sh index d73ab86..eb0ca44 100644 --- a/installer/miner_install.sh +++ b/installer/miner_install.sh @@ -13,7 +13,7 @@ fi GITHUB_URL="https://raw.githubusercontent.com/backend-developers-ltd/InfiniteHash/refs/heads" MAX_V2_WORKER_SIZE_PH="0.45" MAX_V2_TOTAL_WORKERS=1000 -DEFAULT_HOST_WALLET_DIRECTORY="~/.bittensor/wallets" +DEFAULT_HOST_WALLET_DIRECTORY="${HOME}/.bittensor/wallets" CONTAINER_WALLET_DIRECTORY="/root/.bittensor/wallets" mkdir -p "${WORKING_DIRECTORY}"