forked from nbd-wtf/bitcoin_signet
-
Notifications
You must be signed in to change notification settings - Fork 16
/
gen-bitcoind-conf.sh
executable file
·67 lines (57 loc) · 1.37 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
64
65
66
67
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]
rest=1
daemon=1
listen=1
server=1
acceptnonstdtxn=1
v2transport=1
discover=1
signetblocktime=$BLOCKPRODUCTIONDELAY
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