# PoCX Aggregator Configuration
#
# The aggregator sits between miners and the upstream pool/wallet, providing:
#   - Mining info caching (reduces upstream load)
#   - Submission deduplication and best-quality filtering
#   - Per-miner statistics and capacity tracking
#
# Transport Types (upstream):
#   - http:  HTTP transport (default)
#   - https: HTTPS transport (for remote pools)
#
# Authentication Types (upstream):
#   - none:      No authentication
#   - user_pass: Username/password (Basic auth)
#   - cookie:    Bitcoin Core cookie file (requires cookie_path)
#
# Submission Modes:
#   - pool:   Per-account best tracking (for pool mining)
#   - wallet: Global best tracking (for solo mining via wallet)

# Server configuration for downstream miner connections
server:
  # Address to listen on for miner connections
  # Default: 0.0.0.0:8080
  listen_address: "0.0.0.0:8080"

  # Optional authentication for downstream connections
  # When enabled, miners must provide Basic auth credentials
  auth:
    enabled: false
    # basic_auth:
    #   username: "aggregator"
    #   password: "secret"

# Upstream pool or wallet configuration
upstream:
  name: "primary_pool"

  # HTTP/HTTPS upstream (pool)
  rpc_transport: http
  rpc_host: "pool.example.com"
  rpc_port: 8080
  rpc_auth:
    type: none
  submission_mode: pool

  # Expected block time in seconds (used for capacity estimation and poc_time)
  # PoCX: 120, Burst: 240
  # Default: 120
  block_time_secs: 120

  # HTTPS upstream with Basic auth
  # rpc_transport: https
  # rpc_host: "pool.pocx.io"
  # rpc_port: 443
  # rpc_auth:
  #   type: user_pass
  #   username: "aggregator"
  #   password: "your-password"
  # submission_mode: pool

# Cache settings
cache:
  # How long to cache mining info (in seconds)
  # Lower values = more upstream requests, higher values = stale data risk
  # Default: 5
  mining_info_ttl_secs: 5

  # Upstream request timeout (in seconds)
  # Default: 30
  pool_timeout_secs: 30

# Database settings
database:
  # Database file path
  # Default: aggregator.db
  path: "aggregator.db"

  # Database retention period in days (0 = keep forever)
  # Submissions older than this will be automatically deleted
  # Default: 7 days
  # Example: 7 days at 120s blocks = 5,040 blocks retained
  retention_days: 7

# Dashboard settings (optional)
dashboard:
  # Enable dashboard
  # Default: true
  enabled: true
  # Dashboard listen address
  # Default: 0.0.0.0:8081
  listen_address: "0.0.0.0:8081"

# Logging configuration
logging:
  # Log level: trace, debug, info, warn, error
  # Default: info
  level: "info"
  # Log file path
  # Default: aggregator.log
  file: "aggregator.log"
