-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
54 lines (44 loc) · 1.25 KB
/
entrypoint.sh
File metadata and controls
54 lines (44 loc) · 1.25 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
#!/bin/bash
# Docker entrypoint script for stratum proxy
# Handles conditional argument passing based on environment variables
ARGS=(
"python" "-m" "avn_proxy.main"
"--ip=0.0.0.0"
"--port=${STRATUM_PORT:-54321}"
"--rpcip=avian"
"--rpcport=${AVN_RPC_PORT:-7896}"
"--rpcuser=${AVN_RPC_USER}"
"--rpcpass=${AVN_RPC_PASS}"
)
# Add conditional arguments
if [ -n "${PROXY_SIGNATURE}" ]; then
ARGS+=("--proxy-signature=${PROXY_SIGNATURE}")
fi
# Add log level if specified (takes precedence over VERBOSE)
if [ -n "${LOG_LEVEL}" ]; then
ARGS+=("--log-level=${LOG_LEVEL}")
fi
# Add conditional flags only if they are explicitly set to "true"
if [ "${TESTNET,,}" = "true" ]; then
ARGS+=("--testnet")
fi
if [ "${VERBOSE,,}" = "true" ]; then
ARGS+=("--verbose")
fi
if [ "${SHOW_JOBS,,}" = "true" ]; then
ARGS+=("--jobs")
fi
if [ "${USE_EASIER_TARGET,,}" = "true" ]; then
ARGS+=("--use-easier-target")
fi
# ZMQ arguments
if [ "${ENABLE_ZMQ,,}" = "true" ]; then
ARGS+=("--enable-zmq")
if [ -n "${AVN_ZMQ_ENDPOINT}" ]; then
ARGS+=("--avn-zmq-endpoint=${AVN_ZMQ_ENDPOINT}")
fi
elif [ "${ENABLE_ZMQ,,}" = "false" ]; then
ARGS+=("--disable-zmq")
fi
echo "Starting with arguments: ${ARGS[@]}"
exec "${ARGS[@]}"