200 lines
4.9 KiB
YAML
200 lines
4.9 KiB
YAML
# Billing & Payment Service Configuration
|
|
|
|
# Server Configuration
|
|
server:
|
|
port: 8080
|
|
read_timeout: "30s"
|
|
write_timeout: "30s"
|
|
idle_timeout: "60s"
|
|
shutdown_timeout: "30s"
|
|
|
|
# Logging Configuration
|
|
log_level: "info" # debug, info, warn, error
|
|
|
|
# Database Configuration
|
|
database:
|
|
url: "postgresql://dante_user:dante_password@postgres:5432/dante_billing?sslmode=disable"
|
|
max_connections: 25
|
|
min_connections: 5
|
|
connection_timeout: "30s"
|
|
idle_timeout: "15m"
|
|
max_lifetime: "1h"
|
|
|
|
# ClawChain Blockchain Configuration
|
|
clawchain:
|
|
rest_url: "http://localhost:1317"
|
|
rpc_url: "http://localhost:26657"
|
|
chain_id: "clawchain-1"
|
|
denom: "uclaw"
|
|
platform_address: "claw1platformaddresshere"
|
|
mnemonic_path: "/secrets/clawchain_mnemonic"
|
|
timeout: "30s"
|
|
max_retries: 3
|
|
|
|
# Pricing Configuration
|
|
pricing:
|
|
# Base hourly rates in CLAW tokens
|
|
base_rates:
|
|
# NVIDIA GPUs
|
|
"nvidia-geforce-rtx-4090": 0.50
|
|
"nvidia-geforce-rtx-4080": 0.40
|
|
"nvidia-geforce-rtx-4070": 0.30
|
|
"nvidia-geforce-rtx-3090": 0.45
|
|
"nvidia-geforce-rtx-3080": 0.35
|
|
"nvidia-tesla-a100": 2.00
|
|
"nvidia-tesla-v100": 1.50
|
|
"nvidia-tesla-h100": 4.00
|
|
"nvidia-tesla-l40": 1.80
|
|
|
|
# AMD GPUs
|
|
"amd-radeon-rx-7900-xtx": 0.35
|
|
"amd-radeon-rx-6900-xt": 0.30
|
|
"amd-instinct-mi250x": 1.75
|
|
|
|
# Apple Silicon
|
|
"apple-m1-max": 0.25
|
|
"apple-m1-ultra": 0.45
|
|
"apple-m2-max": 0.30
|
|
"apple-m2-ultra": 0.55
|
|
"apple-m3-max": 0.35
|
|
"apple-m3-ultra": 0.65
|
|
|
|
# Intel GPUs
|
|
"intel-arc-a770": 0.20
|
|
"intel-data-center-gpu-max": 1.20
|
|
|
|
# Default rate for unknown GPUs
|
|
"default": 0.25
|
|
|
|
# VRAM pricing (CLAW tokens per GB per hour)
|
|
vram_rate_per_gb: 0.02
|
|
|
|
# Power consumption multiplier (additional cost per watt per hour)
|
|
power_multiplier: 0.001
|
|
|
|
# Platform fee percentage (taken from each transaction)
|
|
platform_fee_percent: 5.0
|
|
|
|
# Minimum session duration for billing (minutes)
|
|
minimum_session_minutes: 1
|
|
|
|
# Maximum session duration (hours)
|
|
maximum_session_hours: 24
|
|
|
|
# Dynamic pricing factors
|
|
demand_multiplier_max: 2.0 # Maximum price increase due to high demand
|
|
supply_bonus_max: 0.5 # Maximum price decrease due to high supply
|
|
|
|
# NATS Configuration
|
|
nats:
|
|
address: "nats://nats:4222"
|
|
cluster_id: "dante-cluster"
|
|
client_id: "billing-payment-service"
|
|
|
|
# Subjects for communication
|
|
subjects:
|
|
usage_updates: "dante.billing.usage"
|
|
payment_events: "dante.billing.payments"
|
|
session_events: "dante.billing.sessions"
|
|
provider_payouts: "dante.billing.payouts"
|
|
|
|
# JetStream configuration
|
|
jetstream:
|
|
enabled: true
|
|
stream_name: "DANTE_BILLING"
|
|
max_age: "168h" # 7 days in hours
|
|
max_msgs: 1000000
|
|
|
|
# Consul Configuration
|
|
consul:
|
|
address: "consul:8500"
|
|
service_name: "billing-payment-service"
|
|
service_id: "billing-payment-service-1"
|
|
health_check_interval: "10s"
|
|
health_check_timeout: "5s"
|
|
health_check_deregister_critical_after: "30s"
|
|
|
|
# Wallet Configuration
|
|
wallet:
|
|
# Minimum balance required to start a session (CLAW tokens)
|
|
minimum_balance: 1.0
|
|
|
|
# Low balance warning threshold (CLAW tokens)
|
|
low_balance_threshold: 5.0
|
|
|
|
# Auto-refill settings
|
|
auto_refill_enabled: false
|
|
auto_refill_threshold: 2.0
|
|
auto_refill_amount: 10.0
|
|
|
|
# Security Configuration
|
|
security:
|
|
# API rate limiting
|
|
rate_limit:
|
|
requests_per_minute: 100
|
|
burst_size: 20
|
|
|
|
# Transaction limits
|
|
max_transaction_amount: 1000.0 # CLAW tokens
|
|
daily_withdrawal_limit: 5000.0 # CLAW tokens
|
|
|
|
# Encryption
|
|
encryption_key_path: "/secrets/encryption_key"
|
|
|
|
# Monitoring Configuration
|
|
monitoring:
|
|
metrics_enabled: true
|
|
metrics_port: 9090
|
|
health_check_enabled: true
|
|
|
|
# Prometheus metrics
|
|
prometheus:
|
|
namespace: "dante_billing"
|
|
subsystem: "payment_service"
|
|
|
|
# Billing Configuration
|
|
billing:
|
|
# Minimum balance required to start a session (CLAW tokens)
|
|
minimum_balance: 1.0
|
|
|
|
# Low balance threshold for warnings (CLAW tokens)
|
|
low_balance_threshold: 5.0
|
|
|
|
# How often to calculate and charge for ongoing sessions
|
|
billing_interval: "1m"
|
|
|
|
# Grace period before terminating sessions due to insufficient funds
|
|
insufficient_funds_grace_period: "5m"
|
|
|
|
# Auto-provision wallet for first-time users submitting jobs via scheduler flow.
|
|
auto_provision_user_wallets: true
|
|
auto_provision_initial_balance: 10.0
|
|
|
|
# Safety limits
|
|
max_transaction_amount: 1000.0
|
|
daily_withdrawal_limit: 5000.0
|
|
|
|
# Batch size for processing billing records
|
|
batch_size: 100
|
|
|
|
# Retention period for billing records
|
|
retention_period: "1y"
|
|
|
|
# Provider Payout Configuration
|
|
payouts:
|
|
# Minimum amount required for payout (CLAW tokens)
|
|
minimum_payout_amount: 10.0
|
|
|
|
# Payout processing schedule (cron format)
|
|
payout_schedule: "0 0 * * *" # Daily at midnight
|
|
|
|
# Payout fee (percentage)
|
|
payout_fee_percent: 1.0
|
|
|
|
# Development/Testing Configuration
|
|
development:
|
|
mock_chain: false
|
|
mock_database: false
|
|
enable_debug_endpoints: false
|
|
log_sql_queries: false
|