Skip to content

Commit c661cae

Browse files
committed
feat: update config
1 parent 83582e9 commit c661cae

File tree

2 files changed

+22
-32
lines changed

2 files changed

+22
-32
lines changed

.github/docker/entrypoint.sh

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -e
33

4-
mkdir -p /app/data
5-
64
# Defaults
75
: "${LTC_RPCUSER:=ltcadmin}"
86
: "${LTC_RPCPASSWORD:=supersecurepassword}"
@@ -11,29 +9,20 @@ mkdir -p /app/data
119
: "${LTC_TESTNET:=}"
1210
: "${LTC_PRUNE:=550}"
1311

14-
CONFIG_FILE="/app/litecoin.conf"
15-
16-
# Choose the correct config section
17-
NETWORK_SECTION="[main]"
18-
EXTRA_TESTNET=""
12+
# Build args
13+
ARGS=(
14+
-server=1
15+
-rpcuser="${LTC_RPCUSER}"
16+
-rpcpassword="${LTC_RPCPASSWORD}"
17+
-rpcbind="${LTC_RPCBIND}"
18+
-rpcallowip="${LTC_RPCALLOWIP}"
19+
-prune="${LTC_PRUNE}"
20+
)
1921

22+
# Enable testnet if requested
2023
if [ "$LTC_TESTNET" = "1" ]; then
21-
NETWORK_SECTION="[test]"
22-
EXTRA_TESTNET="testnet=1"
24+
ARGS+=("-testnet=1")
2325
fi
2426

25-
# Write config file
26-
cat > "$CONFIG_FILE" <<EOF
27-
$NETWORK_SECTION
28-
server=1
29-
$EXTRA_TESTNET
30-
rpcuser=${LTC_RPCUSER}
31-
rpcpassword=${LTC_RPCPASSWORD}
32-
rpcbind=${LTC_RPCBIND}
33-
rpcallowip=${LTC_RPCALLOWIP}
34-
prune=${LTC_PRUNE}
35-
EOF
36-
37-
# Launch litecoind with explicit bind (helps in Docker)
38-
exec litecoind -datadir=/app/data -conf="$CONFIG_FILE" \
39-
-rpcbind=0.0.0.0 -rpcallowip=0.0.0.0/0 "$@"
27+
# Start litecoind
28+
exec litecoind "${ARGS[@]}" "$@"

docker-compose.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ networks:
77
driver: bridge
88

99
services:
10-
app-prod:
11-
image: ghcr.io/raznar-lab/litecoin-node-docker:latest
12-
volumes:
13-
- ./data:/app/data
14-
networks:
15-
- litecoin-net
10+
# app-prod:
11+
# image: ghcr.io/raznar-lab/litecoin-node-docker:latest
12+
# volumes:
13+
# - ./data:/app/data
14+
# networks:
15+
# - litecoin-net
1616

1717
app-testnet:
1818
image: ghcr.io/raznar-lab/litecoin-node-docker:latest
@@ -23,4 +23,5 @@ services:
2323
networks:
2424
- litecoin-testnet
2525
expose:
26-
- "9332:9332"
26+
- "19332:19332"
27+
- "19335:19335"

0 commit comments

Comments
 (0)