rwadurian/backend/services/blockchain-service/.env.example

111 lines
4.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# =============================================================================
# Blockchain Service - Production Environment Configuration
# =============================================================================
#
# Deployment: Server B (192.168.1.111)
# Role: Blockchain address derivation, balance queries, transaction monitoring
#
# Responsibilities:
# - Derive multi-chain addresses from public keys (KAVA, DST, BSC)
# - Monitor blockchain transactions for deposit detection
# - Publish WalletAddressCreated events to Kafka
# - Query wallet balances across supported chains
#
# Flow: mpc-service → blockchain-service → Kafka → identity-service
# (publicKey) (derive addresses) (event) (save addresses)
#
# Setup:
# 1. Copy to .env: cp .env.example .env
# 2. In Docker Compose mode, most values are overridden by docker-compose.yml
# =============================================================================
# =============================================================================
# Application
# =============================================================================
NODE_ENV=production
PORT=3012
SERVICE_NAME=blockchain-service
API_PREFIX=api/v1
# =============================================================================
# Database (PostgreSQL on Server B)
# =============================================================================
# Docker Compose: postgresql://rwa_user:xxx@postgres:5432/rwa_blockchain
# Direct access: postgresql://rwa_user:xxx@192.168.1.111:5432/rwa_blockchain
DATABASE_URL=postgresql://rwa_user:your_password@192.168.1.111:5432/rwa_blockchain?schema=public
# =============================================================================
# Redis (on Server B)
# =============================================================================
# Docker Compose: redis / Direct: 192.168.1.111
REDIS_HOST=192.168.1.111
REDIS_PORT=6379
REDIS_DB=11
REDIS_PASSWORD=
# =============================================================================
# Kafka (on Server B)
# =============================================================================
# Docker Compose: kafka:29092 / Direct: 192.168.1.111:9092
KAFKA_BROKERS=192.168.1.111:9092
KAFKA_CLIENT_ID=blockchain-service
KAFKA_GROUP_ID=blockchain-service-group
# =============================================================================
# Blockchain - KAVA (EVM-compatible Cosmos chain)
# =============================================================================
# Official KAVA EVM RPC endpoint
KAVA_RPC_URL=https://evm.kava.io
KAVA_CHAIN_ID=2222
# KAVA USDT contract address
KAVA_USDT_CONTRACT=0x919C1c267BC06a7039e03fcc2eF738525769109c
# =============================================================================
# Blockchain - BSC (Binance Smart Chain)
# =============================================================================
# Public BSC RPC endpoint (consider using paid RPC for production)
BSC_RPC_URL=https://bsc-dataseed.binance.org
BSC_CHAIN_ID=56
# BSC USDT (Binance-Peg) contract address
BSC_USDT_CONTRACT=0x55d398326f99059fF775485246999027B3197955
# =============================================================================
# Blockchain - DST (Cosmos chain, placeholder)
# =============================================================================
# DST_RPC_URL=https://rpc.dst.network
# DST_CHAIN_ID=dst-1
# =============================================================================
# Block Scanner Configuration
# =============================================================================
# Interval between block scans (milliseconds)
BLOCK_SCAN_INTERVAL_MS=5000
# Number of confirmations required before considering transaction final
BLOCK_CONFIRMATIONS_REQUIRED=12
# Maximum blocks to process in one batch
BLOCK_SCAN_BATCH_SIZE=100
# =============================================================================
# MPC Hot Wallet (用于提现转账)
# =============================================================================
# MPC 服务地址
# Docker Compose: http://mpc-service:3013 / Direct: http://192.168.1.111:3013
MPC_SERVICE_URL=http://192.168.1.111:3013
# 热钱包用户名MPC 系统中的标识,需要预先通过 keygen 创建)
# 示例: system-hot-wallet
HOT_WALLET_USERNAME=system-hot-wallet
# 热钱包地址(从 MPC 公钥派生的 EVM 地址)
# 在 MPC keygen 完成后,从公钥计算得出
# 示例: 0x1234567890abcdef1234567890abcdef12345678
HOT_WALLET_ADDRESS=
# =============================================================================
# Logging
# =============================================================================
# Options: debug, info, warn, error
LOG_LEVEL=info