|
| 1 | +# Environment Configuration Template for Redis Caching Layer |
| 2 | +# Copy this to .env and adjust values for your environment |
| 3 | + |
| 4 | +# ============================================ |
| 5 | +# Database Configuration |
| 6 | +# ============================================ |
| 7 | +DATABASE_URL=postgresql://postgres:postgres@localhost:5432/web3-student-lab?schema=public |
| 8 | + |
| 9 | +# ============================================ |
| 10 | +# Redis Configuration - Choose one mode |
| 11 | +# ============================================ |
| 12 | + |
| 13 | +# Redis Mode: standalone, sentinel, or cluster |
| 14 | +REDIS_MODE=standalone |
| 15 | + |
| 16 | +# ============================================ |
| 17 | +# STANDALONE MODE (Development) |
| 18 | +# ============================================ |
| 19 | +REDIS_HOST=localhost |
| 20 | +REDIS_PORT=6379 |
| 21 | +REDIS_PASSWORD= |
| 22 | + |
| 23 | +# ============================================ |
| 24 | +# SENTINEL MODE (High Availability) |
| 25 | +# ============================================ |
| 26 | +# Uncomment these and set REDIS_MODE=sentinel to use Sentinel |
| 27 | +# REDIS_SENTINELS=localhost:26379,localhost:26380,localhost:26381 |
| 28 | +# REDIS_SENTINEL_NAME=mymaster |
| 29 | +# REDIS_SENTINEL_PASSWORD= |
| 30 | + |
| 31 | +# ============================================ |
| 32 | +# CLUSTER MODE (Distributed) |
| 33 | +# ============================================ |
| 34 | +# Uncomment these and set REDIS_MODE=cluster to use Cluster |
| 35 | +# REDIS_CLUSTER_NODES=localhost:6381,localhost:6382,localhost:6383 |
| 36 | +# REDIS_CLUSTER_PASSWORD= |
| 37 | + |
| 38 | +# ============================================ |
| 39 | +# Cache Warming Configuration |
| 40 | +# ============================================ |
| 41 | + |
| 42 | +# Interval (in milliseconds) for periodic cache warming |
| 43 | +CACHE_WARMING_INTERVAL=300000 # 5 minutes |
| 44 | + |
| 45 | +# Interval (in milliseconds) for polling new blocks |
| 46 | +BLOCK_POLL_INTERVAL=10000 # 10 seconds |
| 47 | + |
| 48 | +# ============================================ |
| 49 | +# Instance Configuration |
| 50 | +# ============================================ |
| 51 | + |
| 52 | +# Unique identifier for this backend instance (used in clustering) |
| 53 | +INSTANCE_ID=backend-1 |
| 54 | + |
| 55 | +# Node environment |
| 56 | +NODE_ENV=development |
| 57 | + |
| 58 | +# ============================================ |
| 59 | +# JWT Configuration |
| 60 | +# ============================================ |
| 61 | +JWT_SECRET=your-secret-key-change-in-production |
| 62 | + |
| 63 | +# ============================================ |
| 64 | +# Application Configuration |
| 65 | +# ============================================ |
| 66 | + |
| 67 | +# Stellar Network: testnet, mainnet, or local |
| 68 | +STELLAR_NETWORK=testnet |
| 69 | + |
| 70 | +# Soroban RPC URL |
| 71 | +SOROBAN_RPC_URL=https://soroban-testnet.stellar.org |
| 72 | + |
| 73 | +# Horizon API URL |
| 74 | +HORIZON_URL=https://horizon-testnet.stellar.org |
| 75 | + |
| 76 | +# Certificate Contract ID |
| 77 | +CERTIFICATE_CONTRACT_ID= |
| 78 | + |
| 79 | +# API Base URL |
| 80 | +API_BASE_URL=http://localhost:8080 |
| 81 | + |
| 82 | +# Certificate Metadata Base URL |
| 83 | +CERT_METADATA_BASE_URL=http://localhost:8080 |
| 84 | + |
| 85 | +# Certificate Image Base Path |
| 86 | +CERT_IMAGE_BASE_PATH= |
| 87 | + |
| 88 | +# Verification URL |
| 89 | +VERIFICATION_URL=http://localhost:8080/api/v1/certificates/verify |
| 90 | + |
| 91 | +# Issuer DID |
| 92 | +ISSUER_DID=did:stellar:GBRPYHIL2CI3FYQMWVUGE62KMGOBQKLCYJ3HLKBUBIW5VZH4S4MNOWT |
| 93 | + |
| 94 | +# Issuer Name |
| 95 | +ISSUER_NAME=Web3 Student Lab |
| 96 | + |
| 97 | +# ============================================ |
| 98 | +# Logging Configuration |
| 99 | +# ============================================ |
| 100 | + |
| 101 | +# Log level: debug, info, warn, error |
| 102 | +LOG_LEVEL=info |
| 103 | + |
| 104 | +# ============================================ |
| 105 | +# Cache Configuration (Advanced) |
| 106 | +# ============================================ |
| 107 | + |
| 108 | +# Maximum memory for Redis (used in docker-compose) |
| 109 | +# Examples: 256mb, 512mb, 1gb |
| 110 | +REDIS_MAX_MEMORY=256mb |
| 111 | + |
| 112 | +# Memory eviction policy |
| 113 | +# Options: noeviction, allkeys-lru, allkeys-lfu, volatile-lru, volatile-lfu, volatile-ttl, volatile-random, allkeys-random |
| 114 | +REDIS_MAX_MEMORY_POLICY=allkeys-lru |
| 115 | + |
| 116 | +# Enable Redis persistence |
| 117 | +REDIS_APPEND_ONLY=yes |
| 118 | + |
| 119 | +# ============================================ |
| 120 | +# Performance Tuning |
| 121 | +# ============================================ |
| 122 | + |
| 123 | +# Database connection pool size |
| 124 | +DB_POOL_MIN=5 |
| 125 | +DB_POOL_MAX=20 |
| 126 | + |
| 127 | +# Request timeout (milliseconds) |
| 128 | +REQUEST_TIMEOUT=30000 |
| 129 | + |
| 130 | +# RPC call timeout (milliseconds) |
| 131 | +RPC_TIMEOUT=10000 |
| 132 | + |
| 133 | +# ============================================ |
| 134 | +# Development/Debugging |
| 135 | +# ============================================ |
| 136 | + |
| 137 | +# Enable debug logging for cache operations |
| 138 | +DEBUG_CACHE=false |
| 139 | + |
| 140 | +# Enable debug logging for RPC calls |
| 141 | +DEBUG_RPC=false |
| 142 | + |
| 143 | +# Enable CORS for development |
| 144 | +CORS_ENABLED=true |
| 145 | +CORS_ORIGIN=http://localhost:3000 |
0 commit comments