-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathentrypoint.sh
executable file
·51 lines (43 loc) · 1.1 KB
/
entrypoint.sh
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
#!/bin/bash
set -euo pipefail
_RPC_PORT=${RPC_PORT}
_NODE_PORT=${NODE_PORT}
_DAPP_URL=${DAPP_URL}
if [ $REGTEST = true ]; then
_RPC_PORT=$RPC_PORT_REGTEST
_NODE_PORT=$NODE_PORT_REGTEST
fi
if [ $TESTNET = true ]; then
_RPC_PORT=$RPC_PORT_TESTNET
_NODE_PORT=$NODE_PORT_TESTNET
fi
if [ -z ${RPC_USER} ]; then
RPC_USER='admin'
echo "RPC_USER was not set, using "$RPC_USER
fi
if [ -z ${RPC_PASSWORD} ]; then
#echo "generating password"
RPC_PASSWORD=$(xxd -l 30 -p /dev/urandom)
echo "RPC_PASSWORD was not set, generated: "$RPC_PASSWORD
fi
if [ -z ${DAPP_URL} ]; then
_DAPP_URL=$DAPP_URL
fi
DOICHAIN_CONF_FILE=/home/doichain/data/doichain/doichain.conf
if [ ! -f "$DOICHAIN_CONF_FILE" ]; then
echo "DOICHAIN_CONF_FILE not found - generating new!"
echo "
daemon=1
server=1
rpcuser=${RPC_USER}
rpcpassword=${RPC_PASSWORD}
rpcallowip=${RPC_ALLOW_IP}
rpcport=${_RPC_PORT}
txindex=1
fallbackfee=0.0002
rpcworkqueue=2048
blocknotify=curl -X GET ${_DAPP_URL}/api/v1/blocknotify?tx=%s
walletnotify=curl -X GET ${_DAPP_URL}/api/v1/walletnotify?tx=%s
port=${_NODE_PORT}" > $DOICHAIN_CONF_FILE
fi
exec "$@"