-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint-avian.sh
More file actions
62 lines (50 loc) · 1.26 KB
/
entrypoint-avian.sh
File metadata and controls
62 lines (50 loc) · 1.26 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
#!/bin/bash
set -e
# Avian Node Entrypoint Script
echo "Starting Avian Node..."
# Create config directory if it doesn't exist
mkdir -p /home/avian/.avian
# Determine network and ports
if [ "${TESTNET}" = "true" ]; then
NETWORK_FLAG="-testnet"
RPC_PORT="${AVN_RPC_PORT:-18766}"
P2P_PORT="${AVN_P2P_PORT:-18770}"
ZMQ_PORT="${AVN_ZMQ_PORT:-28332}"
echo "Network: Testnet"
else
NETWORK_FLAG=""
RPC_PORT="${AVN_RPC_PORT:-7896}"
P2P_PORT="${AVN_P2P_PORT:-7895}"
ZMQ_PORT="${AVN_ZMQ_PORT:-28332}"
echo "Network: Mainnet"
fi
echo "RPC Port: ${RPC_PORT}"
echo "P2P Port: ${P2P_PORT}"
echo "ZMQ Port: ${ZMQ_PORT}"
# Generate avian.conf
cat > /home/avian/.avian/avian.conf << EOF
# Avian Configuration (Docker)
server=1
listen=1
daemon=0
printtoconsole=1
# RPC Settings
rpcuser=${AVN_RPC_USER}
rpcpassword=${AVN_RPC_PASS}
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0:${RPC_PORT}
rpcport=${RPC_PORT}
# P2P Network
port=${P2P_PORT}
# ZMQ Settings
zmqpubhashblock=tcp://0.0.0.0:${ZMQ_PORT}
# Performance
maxconnections=50
dbcache=512
# Dual Algorithm Support
# Avian automatically handles both X16RT and MinotaurX
EOF
echo "Configuration file created"
echo "Starting aviand..."
# Start aviand
exec aviand ${NETWORK_FLAG} -conf=/home/avian/.avian/avian.conf