-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
115 lines (93 loc) · 2.68 KB
/
setup.sh
File metadata and controls
115 lines (93 loc) · 2.68 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
#!/bin/bash
# Avian Stratum Proxy Setup Script
set -e
echo "🚀 Setting up Avian Stratum Proxy..."
# Check if Docker and Docker Compose are installed
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed. Please install Docker first."
exit 1
fi
if ! docker compose version &> /dev/null; then
echo "❌ Docker Compose is not installed. Please install Docker Compose first."
exit 1
fi
# Function to generate random password
generate_password() {
openssl rand -base64 32 | tr -d "=+/" | cut -c1-25
}
# Create .env file if it doesn't exist
if [ ! -f .env ]; then
echo "📝 Creating .env file..."
# Generate secure password
AVN_PASS=$(generate_password)
cat > .env << EOF
# Avian Node Configuration
AVN_RPC_USER=avian_user
AVN_RPC_PASS=${AVN_PASS}
AVN_RPC_PORT=7896
AVN_P2P_PORT=7895
AVN_ZMQ_PORT=28332
AVN_ZMQ_RAW_PORT=28333
# Stratum Proxy Configuration
STRATUM_PORT_X16RT=54321
STRATUM_PORT_MINOTAURX=54322
TESTNET=false
LOG_LEVEL=INFO
SHOW_JOBS=false
USE_EASIER_TARGET=true
# ZMQ Configuration
ENABLE_ZMQ=true
AVN_ZMQ_ENDPOINT=tcp://avian:28332
# Dashboard Configuration
ENABLE_DASHBOARD=true
DASHBOARD_PORT=8080
# Database Configuration (for historical data)
ENABLE_DATABASE=true
# Variable Difficulty (optional)
ENABLE_VARDIFF=false
VARDIFF_TARGET_SHARE_TIME=15.0
VARDIFF_MIN_DIFFICULTY_X16RT=0.001
VARDIFF_MAX_DIFFICULTY_X16RT=10.0
VARDIFF_MIN_DIFFICULTY_MINOTAURX=0.00001
VARDIFF_MAX_DIFFICULTY_MINOTAURX=0.1
# Notifications (optional - fill in to enable)
# DISCORD_WEBHOOK_URL=
# TELEGRAM_BOT_TOKEN=
# TELEGRAM_CHAT_ID=
EOF
echo "✅ .env file created with random password"
else
echo "✅ .env file already exists"
fi
# Create data directories
mkdir -p submit_history data
echo "✅ Data directories created"
# Check binaries
echo "🔍 Checking binaries..."
if [ -f ./check-binaries.sh ]; then
./check-binaries.sh
fi
# Build and start services
echo "🔨 Building and starting services..."
docker compose build --no-cache
docker compose up -d
echo ""
echo "🎉 Setup complete!"
echo ""
echo "📊 Service Status:"
docker compose ps
echo ""
echo "📝 Next Steps:"
echo "1. Wait for blockchain sync (check with: docker compose logs -f avian)"
echo "2. Connect X16RT miners to localhost:54321"
echo "3. Connect MinotaurX miners to localhost:54322"
echo "4. View dashboard at http://localhost:8080"
echo ""
echo "📖 Commands:"
echo " View logs: docker compose logs -f"
echo " Stop services: docker compose down"
echo " Restart: docker compose restart"
echo ""
echo "🔧 Monitoring:"
echo " AVN status: docker compose exec avian avian-cli getblockchaininfo"
echo " Proxy logs: docker compose logs -f stratum-proxy"