forked from Nickel5-Inc/Gaia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidator_template.env
More file actions
128 lines (111 loc) · 5.83 KB
/
validator_template.env
File metadata and controls
128 lines (111 loc) · 5.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Gaia Validator Configuration Template
# Rename this file to .env and fill in your specific values.
# --- Database Configuration ---
DB_USER=postgres
DB_PASSWORD=<YOUR_DB_PASSWORD> # Replace with your actual database password - default is configured to 'postgres'
DB_HOST=localhost
DB_PORT=5432
DB_NAME=validator_db
DB_TARGET=validator
DB_CONNECTION_TYPE=socket
ALEMBIC_AUTO_UPGRADE=True
# --- Application Environment ---
# Set to 'prod' for production or 'dev' for development (enables more verbose logging)
ENV=prod
# --- Subtensor/Blockchain Configuration ---
WALLET_NAME=default # Your Bittensor wallet name
HOTKEY_NAME=default # Your validator's hotkey name
NETUID=237 # Network UID (e.g., 237 for testnet, 57 for mainnet)
SUBTENSOR_NETWORK=test # Bittensor network ('test' or 'finney')
SUBTENSOR_ADDRESS=wss://test.finney.opentensor.ai:443/ # Subtensor chain endpoint
# --- NASA Earthdata Credentials (Sensitive - DO NOT COMMIT ACTUAL VALUES TO PUBLIC REPOS) ---
# These are required for downloading data from NASA.
# Create an account at https://urs.earthdata.nasa.gov/
# Accept EULAs for: GESDISC Test Data Archive, OB.DAAC Data Access, Sentinel EULA
EARTHDATA_USERNAME=<YOUR_EARTHDATA_USERNAME>
EARTHDATA_PASSWORD=<YOUR_EARTHDATA_PASSWORD>
EARTHDATA_API_KEY=<YOUR_EARTHDATA_API_KEY> # This refers to your Earthdata login credentials used by the application.
# --- Miner Score Sender (Optional) ---
# Set to "true" to enable sending miner scores to an external API (if applicable)
SCORE_SENDER_ON=False
# =============================================================================
# --- Database Synchronization (pgBackRest + R2) - AutoSyncManager ---
# =============================================================================
# The validator uses AutoSyncManager with pgBackRest for automated database backup/restore via R2.
# Features: Automated setup, coordinated scheduling, R2 upload verification, network-aware stanzas.
# --- General Sync Settings ---
# Globally enable/disable database sync features
DB_SYNC_ENABLED=True
# Set to `True` for the primary/source validator that performs backups
# Set to `False` for replica validators that download and restore from backups
# PRIMARY SCHEDULE: Full backup daily at 8:30 AM UTC, differential backups hourly at :24 minutes
# REPLICA SCHEDULE: Downloads hourly at :39 minutes (15-minute buffer after primary backup)
IS_SOURCE_VALIDATOR_FOR_DB_SYNC=False
# --- pgBackRest & R2 Configuration ---
# These variables configure pgBackRest to connect to the Cloudflare R2 bucket.
# The base name for the pgBackRest backup set (stanza)
# AutoSyncManager automatically appends network suffix based on SUBTENSOR_NETWORK:
# - If SUBTENSOR_NETWORK=test: stanza becomes "gaia-test"
# - If SUBTENSOR_NETWORK=finney: stanza becomes "gaia-finney"
# This prevents accidental mixing of test/finney backups
PGBACKREST_STANZA_NAME=gaia-finney
# R2 Bucket Details
PGBACKREST_R2_BUCKET=gaia-db-sync
PGBACKREST_R2_ENDPOINT=https://<YOUR_CLOUDFLARE_ACCOUNT_ID>.r2.cloudflarestorage.com
PGBACKREST_R2_REGION=auto # 'auto' is typically sufficient for R2
# R2 API Credentials
# Validators must reach out to the gaia team with a signed message proving hotkey ownership
# to receive appropriate access credentials (read-only for replicas, read-write for primaries)
PGBACKREST_R2_ACCESS_KEY_ID=<YOUR_R2_ACCESS_KEY_ID>
PGBACKREST_R2_SECRET_ACCESS_KEY=<YOUR_R2_SECRET_ACCESS_KEY>
# --- pgBackRest PostgreSQL Connection Settings ---
# These should match your PostgreSQL server configuration.
PGBACKREST_PGDATA=/var/lib/postgresql/14/main
PGBACKREST_PGPORT=5432
PGBACKREST_PGUSER=postgres
# PostgreSQL password for authentication (this should match DB_PASSWORD and/or PGPASSWORD)
PGBACKREST_PGPASSWORD=<YOUR_POSTGRES_PASSWORD>
# --- AutoSyncManager Advanced Settings (Optional) ---
# These are automatically configured but can be overridden if needed
# Force clean transition when switching networks (use with caution)
# Set to true to delete existing stanza when transitioning between networks
# PGBACKREST_FORCE_CLEAN_TRANSITION=false
# =============================================================================
# --- Network Transition Guide ---
# =============================================================================
# When transitioning from test to finney:
#
# RECOMMENDED APPROACH:
# 1. Change SUBTENSOR_NETWORK from "test" to "finney"
# 2. Change NETUID to finney value (e.g., 57)
# 3. Update SUBTENSOR_ADDRESS to finney endpoint
# 4. Restart validator
#
# AutoSyncManager will automatically:
# - Create separate "gaia-finney" stanza
# - Keep "gaia-test" backups intact
# - Start fresh backup history for finney
#
# CLEAN SLATE APPROACH (if you want to delete test data):
# 1. Set PGBACKREST_FORCE_CLEAN_TRANSITION=true
# 2. Follow steps above
# 3. Remove PGBACKREST_FORCE_CLEAN_TRANSITION after first startup
# =============================================================================
# =============================================================================
# --- AutoSyncManager Backup Schedule Reference ---
# =============================================================================
# PRIMARY (IS_SOURCE_VALIDATOR_FOR_DB_SYNC=True):
# - Full backup: Daily at 8:30 AM UTC
# - Differential backups: Every hour at :24 minutes (00:24, 01:24, 02:24, etc.)
# - Health checks: Every hour
# - Backup verification: Automatic R2 upload confirmation with size/compression stats
#
# REPLICA (IS_SOURCE_VALIDATOR_FOR_DB_SYNC=False):
# - Download checks: Every hour at :39 minutes (15-minute buffer after primary backup)
# - Health monitoring: Every 5 minutes
# - Automatic restore: Available via restore_from_backup() method
#
# TEST MODE (when --test flag is used):
# - Primary: Differential backups every 15 minutes
# - Replica: Download checks every 30 minutes with 5-minute buffer
# =============================================================================