### Run HydraPool Server Source: https://context7.com/256foundation/hydrapool/llms.txt This section details how to run the main `hydrapool` binary, which starts the Stratum server, API server, and background processes. Instructions are provided for running with a configuration file, building from source using Cargo, and installing via a release script. ```bash # Run with configuration file ./hydrapool --config /path/to/config.toml # Build from source and run git clone https://github.com/256-foundation/Hydra-Pool/ cd Hydra-Pool cargo build --release ./target/release/hydrapool --config config.toml # Install from release script curl --proto '=https' --tlsv1.2 -LsSf \ https://github.com/256-Foundation/Hydra-Pool/releases/latest/download/hydrapool-installer.sh | sh hydrapool --config config.toml ``` -------------------------------- ### Install Hydra Pool Binaries Source: https://github.com/256foundation/hydrapool/blob/main/README.md Downloads and executes an installation script to install the Hydra Pool binaries (`hydrapool` and `hydrapool_cli`) into the system's PATH. This is the recommended method for installing pre-compiled releases. ```bash curl --proto '=https' --tlsv1.2 -LsSf https://github.com/256-Foundation/Hydra-Pool/releases/latest/download/hydrapool-installer.sh | sh ``` -------------------------------- ### Install Rust using Official Script Source: https://github.com/256foundation/hydrapool/blob/main/README.md Installs or updates Rust and Cargo using the official installation script. This is the recommended method for managing Rust toolchains, especially when encountering version compatibility issues. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Start Hydrapool with Docker Compose (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Starts Hydrapool services using Docker Compose. Can start Hydrapool alone or with monitoring tools like Prometheus and Grafana. ```bash docker compose up -d hydrapool ``` ```bash docker compose up -d ``` -------------------------------- ### Download Docker Compose and Configuration Files Source: https://github.com/256foundation/hydrapool/blob/main/README.md Downloads the latest Docker Compose file and an example configuration file for Hydrapool. These are essential for setting up a new instance of the mining pool. ```bash curl --proto '=https' --tlsv1.2 -LsSf -o docker-compose.yml https://github.com/256foundation/hydrapool/releases/latest/download/docker-compose.yml curl --proto '=https' --tlsv1.2 -LsSf -o config.toml https://github.com/256foundation/hydrapool/releases/latest/download/config-example.toml ``` -------------------------------- ### Install OpenSSL and Clang Development Libraries Source: https://github.com/256foundation/hydrapool/blob/main/README.md Installs necessary development libraries for OpenSSL and Clang on Debian/Ubuntu systems. These libraries are often required for compiling Rust projects that interact with system cryptography or use LLVM features. ```bash sudo apt update sudo apt install libssl-dev pkg-config sudo apt install clang libclang-dev ``` -------------------------------- ### Remove Rust Snap Installation Source: https://github.com/256foundation/hydrapool/blob/main/README.md Commands to remove Rust installations managed by Snap. This is necessary if a Snap version of Rust is causing conflicts or if you intend to use the official installer. ```bash snap list sudo snap remove rust ``` -------------------------------- ### Copy and Edit Configuration File (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Copies the example configuration file and instructs on editing key parameters for Hydrapool. Requires a Bitcoin node with RPC and ZMQ enabled. ```bash cd docker cp config-example.toml config.toml ``` -------------------------------- ### Configure Custom Docker Network (YAML) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Example of how to create a custom Docker network and integrate it with Hydrapool's Docker Compose configuration. ```yaml services: hydrapool: image: hydrapool/hydrapool:latest # ... rest of config ``` -------------------------------- ### Start Hydrapool Instance with Docker Compose Source: https://github.com/256foundation/hydrapool/blob/main/README.md Starts the Hydrapool stratum server and monitoring dashboard using Docker Compose. The stratum server runs on port 3333 and the dashboard on port 3000. ```bash docker compose -f docker-compose.yml up ``` -------------------------------- ### Build Hydra Pool from Source Source: https://github.com/256foundation/hydrapool/blob/main/README.md Instructions to clone the repository and build the Hydra Pool project using Cargo. This process requires Git and Rust to be installed on the system. The output binary will be located in the 'target/release' directory. ```bash git clone https://github.com/256-foundation/Hydra-Pool/ cargo build --release ``` -------------------------------- ### Deploy Hydrapool with Docker Compose Source: https://context7.com/256foundation/hydrapool/llms.txt This bash script demonstrates how to deploy Hydrapool using Docker Compose. It involves downloading the `docker-compose.yml` and `config.toml` files, editing the configuration for your Bitcoin node, and then starting the full stack or just the mining pool. It also shows how to check the status and view logs. ```bash # Download docker compose and configuration files curl --proto '=https' --tlsv1.2 -LsSf -o docker-compose.yml \ https://github.com/256foundation/hydrapool/releases/latest/download/docker-compose.yml curl --proto '=https' --tlsv1.2 -LsSf -o config.toml \ https://github.com/256foundation/hydrapool/releases/latest/download/config-example.toml # Edit config.toml with your Bitcoin node settings # Required: bootstrap_address, zmqpubhashblock, bitcoinrpc.url, network # Start the full stack (hydrapool + prometheus + grafana) docker compose up -d # Or start only the mining pool docker compose up -d hydrapool # Check status docker compose ps # NAME SERVICE STATUS # hydrapool hydrapool running (healthy) # grafana grafana running # prometheus prometheus running (healthy) # View logs docker compose logs -f hydrapool ``` -------------------------------- ### Backup Hydrapool Data Volume (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Creates a tar archive of the Hydrapool data volume for backup purposes. Requires Docker to be installed and running. ```bash docker run --rm -v hydrapool_data:/data -v $(pwd):/backup alpine tar czf /backup/hydrapool-backup.tar.gz /data ``` -------------------------------- ### Clean Old Rust Configuration Files Source: https://github.com/256foundation/hydrapool/blob/main/README.md Removes old configuration and installation directories for Cargo and Rustup. This ensures a clean state before reinstalling Rust, preventing potential conflicts from previous installations. ```bash rm -rf "$HOME/.cargo" "$HOME/.rustup" exec $SHELL ``` -------------------------------- ### Configure Bitcoin Node for Dockerized Hydrapool Source: https://github.com/256foundation/hydrapool/blob/main/README.md Example configuration for a Bitcoin node's bitcoin.conf file to allow RPC access from Hydrapool running in Docker. It specifies binding to all interfaces and allowing connections from Docker's bridged network subnet. ```ini # bitcoin.conf .... # allow connections from all interfaces, not just localhost rpcbind=0.0.0.0 # allow Docker's bridged networks (for Hydrapool) rpcallowip=172.16.0.0/12 ``` -------------------------------- ### Generate Authentication Token with hydrapool_cli Source: https://context7.com/256foundation/hydrapool/llms.txt The `hydrapool_cli gen-auth` command generates salted and hashed API credentials. The output is designed for direct insertion into the `config.toml` file. This process can be done using Docker or an installed binary. ```bash # Using Docker docker compose run --rm hydrapool-cli gen-auth myusername mysecurepassword # Output: # auth_user = "myusername" # auth_token = "a1b2c3d4e5f6....$9f8e7d6c5b4a..." # Using installed binary hydrapool_cli gen-auth myusername mysecurepassword # After generating, update config.toml with the new credentials # Then update prometheus.yml and docker-compose.yml healthcheck to match ``` -------------------------------- ### Hydrapool API PPLNS Shares Download Source: https://context7.com/256foundation/hydrapool/llms.txt This bash command demonstrates how to download PPLNS (Pay Per Last N Shares) accounting data from the Hydrapool API. By sending a GET request to the `/pplns_shares` endpoint, users can obtain share accounting data in JSON format, which is useful for verifying payout calculations. ```bash # Fetch PPLNS shares data curl -u hydrapool:hydrapool http://localhost:46884/pplns_shares ``` -------------------------------- ### Run Prometheus in Docker Source: https://github.com/256foundation/hydrapool/blob/main/README.md Starts the Prometheus monitoring service in detached mode using Docker Compose. Prometheus is used to collect metrics from the Hydra Pool for dashboarding. ```bash docker compose up -d ghcr.io/256foundation/hydrapool-prometheus ``` -------------------------------- ### Run Grafana in Docker Source: https://github.com/256foundation/hydrapool/blob/main/README.md Starts the Grafana visualization service in detached mode using Docker Compose. Grafana is used to display the metrics collected by Prometheus, providing a dashboard for the mining pool. ```bash docker compose up -d ghcr.io/256foundation/hydrapool-grafana ``` -------------------------------- ### Upgrade Hydrapool using Docker Compose Source: https://context7.com/256foundation/hydrapool/llms.txt These bash commands outline the process for upgrading Hydrapool. A standard upgrade involves pulling the latest Docker images and recreating the containers with minimal downtime. A breaking upgrade, such as from v1.x to v2.x, requires stopping the containers, removing associated volumes (to reset the database), and then starting them again. ```bash # Standard upgrade - minimal downtime docker compose pull docker compose up -d --force-recreate # Breaking upgrade from v1.x to v2.x (resets database) docker compose pull docker compose down -v docker compose up -d ``` -------------------------------- ### Check Rust Version Source: https://github.com/256foundation/hydrapool/blob/main/README.md Command to check the currently installed Rust compiler version. This is a troubleshooting step to ensure compatibility with the Hydra Pool project, which requires at least Rust version 1.88.0. ```bash rustc --version ``` -------------------------------- ### Clean and Rebuild Hydra Pool Source: https://github.com/256foundation/hydrapool/blob/main/README.md Cleans the build artifacts and recompiles the Hydra Pool project in release mode. This is typically done after installing new dependencies or resolving build issues. ```bash cargo clean cargo build --release ``` -------------------------------- ### Remove Older Rust Versions (Ubuntu) Source: https://github.com/256foundation/hydrapool/blob/main/README.md Commands to remove pre-installed or older versions of Rust, Cargo, and related development libraries from Ubuntu systems. This is a prerequisite for a clean installation of the latest Rust toolchain using the official script. ```bash sudo apt remove rustc cargo libstd-rust-dev sudo apt autoremove ``` -------------------------------- ### Hydrapool API Prometheus Metrics Source: https://context7.com/256foundation/hydrapool/llms.txt This bash script shows how to retrieve Prometheus metrics from the Hydrapool API. It uses `curl` with basic authentication to query the `/metrics` endpoint. The example response illustrates the format of the exported metrics, including pool hashrate, total accepted shares, and active user counts. ```bash # Fetch metrics curl -u hydrapool:hydrapool http://localhost:46884/metrics # Example response (truncated): # # HELP hydrapool_pool_hashrate_gh Pool hashrate in GH/s # # TYPE hydrapool_pool_hashrate_gh gauge # hydrapool_pool_hashrate_gh 125.4 # # HELP hydrapool_total_shares_accepted Total accepted shares # # TYPE hydrapool_total_shares_accepted counter # hydrapool_total_shares_accepted 1523847 # # HELP hydrapool_active_users Number of active users # # TYPE hydrapool_active_users gauge # hydrapool_active_users 15 ``` -------------------------------- ### Connect Mining Hardware via Stratum Protocol Source: https://context7.com/256foundation/hydrapool/llms.txt Miners connect to Hydrapool using the standard Stratum protocol on port 3333. The username format includes your Bitcoin payout address and an optional worker name, separated by a dot. An example miner configuration for cgminer/bfgminer is provided. ```bash # Stratum connection URL format stratum+tcp://your-pool-server:3333 # Miner configuration example (cgminer/bfgminer format) # Pool URL: stratum+tcp://localhost:3333 # Username: bc1qyourbitcoinaddress (your payout address) # Password: x (or any value, typically ignored) # Worker name: append to username with a dot # Full username format: bc1qyourbitcoinaddress.worker1 # Example miner configuration { "pools": [ { "url": "stratum+tcp://pool.example.com:3333", "user": "bc1qyourbitcoinaddress.rig1", "pass": "x" } ] } ``` -------------------------------- ### Hydrapool API Health Check Source: https://context7.com/256foundation/hydrapool/llms.txt This bash script demonstrates how to perform a health check on the Hydrapool API. It shows how to generate base64 encoded credentials from the API username and token, and then use `curl` to send a GET request to the `/health` endpoint. An alternative method using inline authentication is also provided. ```bash # Generate base64 credentials AUTH=$(echo -n 'hydrapool:hydrapool' | base64) # Check health curl -H "Authorization: Basic $AUTH" http://localhost:46884/health # Response: OK # Alternative with inline auth curl -u hydrapool:hydrapool http://localhost:46884/health ``` -------------------------------- ### Verify HydraPool Docker Image Signatures with Cosign Source: https://context7.com/256foundation/hydrapool/llms.txt This section demonstrates how to verify the signatures of HydraPool Docker images using Sigstore cosign. It provides commands to verify the `hydrapool`, `hydrapool-prometheus`, and `hydrapool-grafana` images, ensuring their authenticity and integrity. ```bash # Install cosign # See: https://docs.sigstore.dev/cosign/system_config/installation/ # Verify hydrapool image cosign verify \ --certificate-identity-regexp=github.com/256foundation \ ghcr.io/256-foundation/hydrapool:latest # Verify prometheus image cosign verify \ --certificate-identity-regexp=github.com/256foundation \ ghcr.io/256-foundation/hydrapool-prometheus:latest # Verify grafana image cosign verify \ --certificate-identity-regexp=github.com/256foundation \ ghcr.io/256-foundation/hydrapool-grafana:latest ``` -------------------------------- ### View Hydrapool Logs with Docker Compose (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Commands to view Hydrapool container logs, either following in real-time or displaying a specific number of recent lines. ```bash # Follow logs docker compose logs -f hydrapool # Last 100 lines docker compose logs --tail=100 hydrapool ``` -------------------------------- ### Troubleshoot Bitcoin Node Connection (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Provides steps to resolve connection issues between Hydrapool and a Bitcoin node, focusing on RPC and ZMQ configuration. ```bash # Example bitcoin.conf setting # zmqpubhashblock=tcp://0.0.0.0:28334 ``` -------------------------------- ### Run Hydra Pool Binary Source: https://github.com/256foundation/hydrapool/blob/main/README.md Command to execute the compiled Hydra Pool binary after building from source. Ensure you have configured the 'config.toml' file with your node settings before running. ```bash ./target/release/hydrapool ``` -------------------------------- ### PPLNS Shares Download API Source: https://context7.com/256foundation/hydrapool/llms.txt The /pplns_shares endpoint allows users to download share accounting data in JSON format for verifying payout calculations. ```APIDOC ## GET /pplns_shares ### Description Allows users to download share accounting data in JSON format for verifying payout calculations. ### Method GET ### Endpoint /pplns_shares ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash # This endpoint requires authentication, similar to other API endpoints. # Replace 'hydrapool' and 'hydrapool' with your actual API credentials if different. curl -u hydrapool:hydrapool http://localhost:46884/pplns_shares ``` ### Response #### Success Response (200) - **body** (JSON) - A JSON object containing share accounting data. #### Response Example ```json { "user_shares": [ { "user_id": "user123", "shares": 10000, "last_share_time": 1678886400 }, { "user_id": "user456", "shares": 5000, "last_share_time": 1678886300 } ], "total_shares": 15000, "payout_period_start": 1678800000, "payout_period_end": 1678886400 } ``` ``` -------------------------------- ### Build and Run Hydrapool with Local Changes (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Builds Hydrapool Docker images from local source code and runs the services, suitable for development and testing. ```bash # Build and run with local changes docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build # Or rebuild specific service docker compose -f docker-compose.yml -f docker-compose.dev.yml build hydrapool docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d hydrapool ``` -------------------------------- ### Check Hydrapool Status with Docker Compose (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Commands to view the logs and running status of Hydrapool containers managed by Docker Compose. ```bash docker compose logs -f hydrapool ``` ```bash docker compose ps ``` -------------------------------- ### PPLNS Shares API Source: https://context7.com/256foundation/hydrapool/llms.txt Endpoints for downloading PPLNS shares from the HydraPool API. ```APIDOC ## GET /pplns_shares ### Description Retrieves PPLNS (Pay Per Last N Shares) data. This endpoint can be used to download all shares or a specific range. ### Method GET ### Endpoint /pplns_shares ### Query Parameters - **start_time** (string) - Optional - The start of the time range for shares in RFC3339 format (e.g., 2025-01-01T00:00:00Z). - **end_time** (string) - Optional - The end of the time range for shares in RFC3339 format (e.g., 2025-01-15T23:59:59Z). ### Request Example ```bash curl -u hydrapool:hydrapool "http://localhost:46884/pplns_shares?start_time=2025-01-01T00:00:00Z&end_time=2025-01-15T23:59:59Z" ``` ### Response #### Success Response (200) - **user** (string) - The user's payout address. - **worker** (string) - The name of the worker. - **difficulty** (integer) - The difficulty of the share. - **timestamp** (string) - The timestamp when the share was found in RFC3339 format. - **share_hash** (string) - The hash of the share. #### Response Example ```json [ { "user": "bc1q...", "worker": "worker1", "difficulty": 65536, "timestamp": "2025-01-10T14:30:00Z", "share_hash": "00000000..." } ] ``` ``` -------------------------------- ### Download PPLNS Shares from HydraPool API Source: https://context7.com/256foundation/hydrapool/llms.txt These commands use `curl` to download PPLNS shares from the HydraPool API. You can download all shares or specify a time range using RFC3339 formatted timestamps. The output is saved to a JSON file. ```bash # Download all PPLNS shares curl -u hydrapool:hydrapool http://localhost:46884/pplns_shares > shares.json # Download shares within a time range (RFC3339 format) curl -u hydrapool:hydrapool \ "http://localhost:46884/pplns_shares?start_time=2025-01-01T00:00:00Z&end_time=2025-01-15T23:59:59Z" \ > shares_january.json ``` -------------------------------- ### Configure Bitcoin Core for Hydrapool Source: https://context7.com/256foundation/hydrapool/llms.txt This configuration snippet for `bitcoin.conf` enables RPC access and ZMQ block notifications required by Hydrapool. It includes settings for RPC user, password, binding, allowed IPs, ZMQ publisher, and `blockmaxweight` which should be adjusted based on the number of users. ```ini # bitcoin.conf # RPC settings server=1 rpcuser=hydrapool rpcpassword=hydrapool rpcbind=0.0.0.0 callowip=172.16.0.0/12 # ZMQ block notification (required) zmqpubhashblock=tcp://0.0.0.0:28334 # Reserve block weight for coinbase outputs # Adjust based on number of users (see table below) # 20 users: 3997000, 100 users: 3986000, 500 users: 3930000 blockmaxweight=3986000 ``` -------------------------------- ### Hydrapool Configuration (config.toml) Source: https://context7.com/256foundation/hydrapool/llms.txt This TOML configuration file defines all operational parameters for the Hydrapool mining pool, including storage, stratum server settings, Bitcoin RPC connection details, logging levels, and API authentication credentials. It specifies payout addresses, donation settings, network parameters, and ZMQ endpoints for block notifications. ```toml [store] path = "/var/lib/hydrapool/store.db" background_task_frequency_hours = 24 pplns_ttl_days = 7 [stratum] hostname = "0.0.0.0" port = 3333 start_difficulty = 1 minimum_difficulty = 1 # Your Bitcoin address for bootstrap payouts bootstrap_address = "bc1qypskemx80lznv4tjpnmpw9c5pgpy32fpkk3sw2" # Optional donation to developers (in basis points, 100 = 1%) donations_address = "bc1qce93hy5rhg02s6aeu7mfdvxg76x66pqqtrvzs3" donations = 50 # Optional pool operator fee fee_address = "" fee = 200 # ZMQ endpoint for block notifications zmqpubhashblock = "tcp://host.docker.internal:28334" # Network: "main", "testnet4", or "signet" network = "main" version_mask = "1fffe000" difficulty_multiplier = 1.0 pool_signature = "hydrapool" [bitcoinrpc] url = "http://host.docker.internal:8332" username = "hydrapool" password = "hydrapool" [logging] level = "info" stats_dir = "/var/lib/hydrapool/stats" [api] hostname = "0.0.0.0" port = 46884 auth_user = "hydrapool" auth_token = "28a556ceb0b24c9b664d1e35a81239ed$5c9fb3271b22be05eb87272ce11c3cad55242d045eb379873ce0dc821586204a" ``` -------------------------------- ### Run Hydrapool CLI Tools with Docker Compose (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Executes Hydrapool command-line interface tools within a Docker container, useful for administrative tasks. ```bash docker compose run --rm hydrapool-cli --help ``` ```bash docker compose run --rm hydrapool-cli gen-auth myuser mypassword ``` -------------------------------- ### Prometheus Metrics API Source: https://context7.com/256foundation/hydrapool/llms.txt The /metrics endpoint exports pool statistics in Prometheus format, including hashrates, share counts, and user statistics. ```APIDOC ## GET /metrics ### Description Exports pool statistics in Prometheus format, including hashrates, share counts, user counts, and worker statistics. ### Method GET ### Endpoint /metrics ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -u hydrapool:hydrapool http://localhost:46884/metrics ``` ### Response #### Success Response (200) - **body** (string) - Prometheus-formatted metrics. #### Response Example ``` # HELP hydrapool_pool_hashrate_gh Pool hashrate in GH/s # TYPE hydrapool_pool_hashrate_gh gauge hydrapool_pool_hashrate_gh 125.4 # HELP hydrapool_total_shares_accepted Total accepted shares # TYPE hydrapool_total_shares_accepted counter hydrapool_total_shares_accepted 1523847 # HELP hydrapool_active_users Number of active users # TYPE hydrapool_active_users gauge hydrapool_active_users 15 ``` ``` -------------------------------- ### PPLNS Shares Download Source: https://github.com/256foundation/hydrapool/blob/main/README.md This endpoint allows you to download a JSON file containing all PPLNS shares tracked by the pool. This data is crucial for validating accounting and payouts. The request accepts optional `start_time` and `end_time` query parameters in RFC3339 format to filter the shares by a specific time range. ```APIDOC ## GET /pplns_shares ### Description Retrieves a JSON file of all PPLNS shares tracked by the pool for block reward distribution. ### Method GET ### Endpoint `/pplns_shares` ### Parameters #### Query Parameters - **start_time** (string) - Optional - The start of the time range for shares, in RFC3339 format (e.g., `1996-12-19T16:39:57-08:00`). - **end_time** (string) - Optional - The end of the time range for shares, in RFC3339 format (e.g., `1996-12-19T16:39:57-08:00`). ### Request Example ```bash curl -H "Authorization: Basic " "http://:/pplns_shares?start_time=1996-12-19T16:39:57-08:00&end_time=1996-12-19T17:39:57-08:00" ``` ### Response #### Success Response (200) - **shares** (array) - A list of PPLNS share objects. - **timestamp** (string) - The timestamp of the share. - **block_height** (integer) - The block height associated with the share. - **worker_id** (string) - The ID of the worker that submitted the share. - **difficulty** (number) - The difficulty of the share. #### Response Example ```json { "shares": [ { "timestamp": "2023-10-27T10:00:00Z", "block_height": 123456, "worker_id": "worker1", "difficulty": 1000000000000 } ] } ``` ``` -------------------------------- ### Configure Prometheus for Hydrapool Metrics Scraping Source: https://context7.com/256foundation/hydrapool/llms.txt This `prometheus.yml` configuration sets up Prometheus to scrape metrics from the Hydrapool API server. It specifies the target, metrics path, and uses basic authentication with the provided username and password. A `metric_relabel_configs` rule is included to drop metrics with empty names. ```yaml # prometheus.yml global: scrape_interval: 15s external_labels: monitor: 'hydrapool-monitor' scrape_configs: - job_name: 'Hydrapool' scrape_interval: 15s static_configs: - targets: ['host.docker.internal:46884'] metrics_path: "/metrics" basic_auth: username: 'hydrapool' password: 'hydrapool' metric_relabel_configs: - source_labels: [__name__] regex: '' action: drop ``` -------------------------------- ### Validate Docker Compose Configuration (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Checks the validity of the Docker Compose configuration file for Hydrapool. ```bash docker compose config ``` -------------------------------- ### Upgrade Hydrapool Docker Images Source: https://github.com/256foundation/hydrapool/blob/main/README.md Pulls the latest Docker images for Hydrapool while services are running and then recreates the containers to apply the updates with minimal downtime. ```bash cd # Pull latest images while services are still running docker compose pull # Recreate containers with new images docker compose up -d --force-recreate ``` -------------------------------- ### Update Hydrapool to Latest Release (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Pulls the latest Docker images for Hydrapool and restarts the services to update to the newest version. ```bash docker compose pull docker compose up -d ``` -------------------------------- ### Restart Hydrapool After Configuration Changes (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Restarts the Hydrapool service to apply changes made to the configuration file. ```bash docker compose restart hydrapool ``` -------------------------------- ### Stop Hydrapool Services with Docker Compose (Bash) Source: https://github.com/256foundation/hydrapool/blob/main/docker/README.md Commands to stop and remove Hydrapool services and optionally their associated Docker volumes. ```bash # Stop all services docker compose down # Stop and remove volumes (WARNING: deletes all data) docker compose down -v ``` -------------------------------- ### Health Check API Source: https://context7.com/256foundation/hydrapool/llms.txt The /health endpoint checks if the Hydrapool server is running and responsive. It's useful for monitoring systems and Docker healthchecks. ```APIDOC ## GET /health ### Description Verifies the pool server is running and responsive. Used by Docker healthchecks and monitoring systems. ### Method GET ### Endpoint /health ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash # Generate base64 credentials AUTH=$(echo -n 'hydrapool:hydrapool' | base64) # Check health curl -H "Authorization: Basic $AUTH" http://localhost:46884/health # Alternative with inline auth curl -u hydrapool:hydrapool http://localhost:46884/health ``` ### Response #### Success Response (200) - **body** (string) - "OK" indicating the server is healthy. #### Response Example ``` OK ``` ``` -------------------------------- ### Generate API Authorization Token Source: https://github.com/256foundation/hydrapool/blob/main/README.md Generates a Base64 encoded string of your username and password, which is used for authenticating API requests to the Hydra Pool server. This token is required for accessing secured API endpoints. ```bash echo -n 'YOUR_USERNAME:YOUR_PASSWORD' | base64 ``` -------------------------------- ### Health Check Source: https://github.com/256foundation/hydrapool/blob/main/README.md This endpoint provides a basic health check for the API server. It requires an 'Authorization' header with a Base64 encoded string of the username and password configured for the API. ```APIDOC ## GET /health ### Description Checks the health status of the API server. ### Method GET ### Endpoint `/health` ### Parameters #### Request Headers - **Authorization** (string) - Required - Base64 encoded string of 'USERNAME:PASSWORD'. ### Request Example ```bash curl -H "Authorization: Basic " http://localhost:46884/health ``` ### Response #### Success Response (200) - **status** (string) - The health status of the API server (e.g., "ok"). #### Response Example ```json { "status": "ok" } ``` ``` -------------------------------- ### Test API Health Endpoint Source: https://github.com/256foundation/hydrapool/blob/main/README.md Uses curl to send a request to the pool's health API endpoint, including the generated Authorization header. This is a basic test to verify the API server is running and accessible. ```bash curl -H "Authorization: Basic " http://localhost:46884/health ``` -------------------------------- ### Reset Hydrapool Database Schema on Major Upgrade Source: https://github.com/256foundation/hydrapool/blob/main/README.md Resets the Hydrapool database schema when upgrading from v1.x.x to v2.x.x or higher. This involves pulling new images, stopping and removing volumes, and then restarting the services. ```bash cd docker compose pull docker compose down -v docker compose up -d ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.