forked from nbd-wtf/bitcoin_signet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-bitcoind-conf.sh
executable file
·63 lines (53 loc) · 1.29 KB
/
gen-bitcoind-conf.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
52
53
54
55
56
57
58
59
60
61
62
63
SIGNETCHALLENGE=${SIGNETCHALLENGE:-$(cat ~/.bitcoin/SIGNETCHALLENGE.txt)}
RPCAUTH=$(/usr/local/bin/rpcauth.py $RPCUSER $RPCPASSWORD | tr -d '\n')
echo "signet=1"
if [[ "$COOKIEFILE" == "true" ]]; then
echo "rpccookiefile=/root/.bitcoin/.cookie
rpcauth=$RPCAUTH"
else
echo "rpcauth=$RPCAUTH
rpcuser=$RPCUSER
rpcpassword=$RPCPASSWORD"
fi
echo "txindex=1
blockfilterindex=1
peerblockfilters=1
coinstatsindex=1
dnsseed=0
persistmempool=1
uacomment=$UACOMMENT"
if [[ "$EXTERNAL_IP" != "" ]]; then
echo $EXTERNAL_IP | tr ',' '\n' | while read ip; do
echo "externalip=$ip"
done
fi
echo "[signet]
daemon=1
listen=1
server=1
discover=1
signetchallenge=$SIGNETCHALLENGE
zmqpubrawblock=$ZMQPUBRAWBLOCK
zmqpubrawtx=$ZMQPUBRAWTX
zmqpubhashblock=$ZMQPUBHASHBLOCK
rpcbind=$RPCBIND
rpcallowip=$RPCALLOWIP
whitelist=$WHITELIST
fallbackfee=0.0002"
if [[ "$ADDNODE" != "" ]]; then
echo $ADDNODE | tr ',' '\n' | while read node; do
echo "addnode=$node"
done
fi
if [[ "$I2PSAM" != "" ]]; then
echo "i2psam=$I2PSAM"
fi
if [[ "$ONIONPROXY" != "" ]]; then
echo "onion=$ONIONPROXY" # unless have static IP won't resolve the control port as domain
fi
if [[ "$TORPASSWORD" != "" ]]; then
echo "torpassword=$TORPASSWORD"
fi
if [[ "$TORCONTROL" != "" ]]; then
echo "torcontrol=$TORCONTROL"
fi