modified btc_init to be freshly generated on each launch
This commit is contained in:
parent
1f14273887
commit
f21d5b4f9d
@ -2,50 +2,61 @@
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# This shouldn't be in the Dockerfile or containers built from the same image
|
mkdir -p $HOME/.bitcoin
|
||||||
# will have the same credentials.
|
|
||||||
if [ ! -e "$HOME/.bitcoin/bitcoin.conf" ]; then
|
|
||||||
mkdir -p $HOME/.bitcoin
|
|
||||||
|
|
||||||
echo "Creating bitcoin.conf"
|
if [ -f "$HOME/.bitcoin/bitcoin.conf" ];
|
||||||
|
then
|
||||||
|
echo "Backing up bitcoin.conf"
|
||||||
|
TMPEXT=$(date +%Y.%m.%d.%H.%M.%S)
|
||||||
|
mv $HOME/.bitcoin/bitcoin.conf $HOME/.bitcoin/bitcoin.conf.bak.$TMPEXT
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Creating bitcoin.conf"
|
||||||
|
|
||||||
|
# Seed a random password for JSON RPC server
|
||||||
|
cat <<EOF > $HOME/.bitcoin/bitcoin.conf
|
||||||
|
#
|
||||||
|
#Do not modify this file as it is autogenerated.
|
||||||
|
#You can either (a) Modify this template "btc_init" in build or
|
||||||
|
# (b) You can pass a variable name as env variable during container launch
|
||||||
|
# The variable names are printed to right of each item
|
||||||
|
#
|
||||||
|
|
||||||
# Seed a random password for JSON RPC server
|
|
||||||
cat <<EOF > $HOME/.bitcoin/bitcoin.conf
|
|
||||||
# network
|
# network
|
||||||
mainnet=${MAINNET:-1}
|
mainnet=${MAINNET:-1} # MAINNET
|
||||||
testnet=${TESTNET:-0}
|
testnet=${TESTNET:-0} # TESTNET
|
||||||
regtest=${REGTEST:-0}
|
regtest=${REGTEST:-0} # REGTEST
|
||||||
|
|
||||||
# server
|
# server
|
||||||
server=${SERVER:-1}
|
server=${SERVER:-1} # SERVER
|
||||||
listen=${LISTEN:-1}
|
listen=${LISTEN:-1} # LISTEN
|
||||||
listenonion=${LISTENONION:-0}
|
listenonion=${LISTENONION:-0} # LISTENONION
|
||||||
daemon=${DAEMON:-0}
|
daemon=${DAEMON:-0} # DAEMON
|
||||||
txindex=${TXINDEX=-1}
|
txindex=${TXINDEX=-1} # TXINDEX
|
||||||
prune=${PRUNE=-0}
|
prune=${PRUNE=-0} # PRUNE
|
||||||
disablewallet=${DISABLEWALLET:-1}
|
disablewallet=${DISABLEWALLET:-1} # DISABLEWALLET
|
||||||
printtoconsole=${PRINTTOCONSOLE:-1}
|
printtoconsole=${PRINTTOCONSOLE:-1} # PRINTCONSOLE
|
||||||
|
|
||||||
# rpc
|
# rpc
|
||||||
rpcuser=${RPCUSER:-bitcoinrpc}
|
rpcuser=${RPCUSER:-bitcoinrpc} # RPCUSER
|
||||||
rpcpassword=${RPCPASSWORD:-`dd if=/dev/urandom bs=33 count=1 2>/dev/null | base64`}
|
rpcpassword=${RPCPASSWORD:-`dd if=/dev/urandom bs=33 count=1 2>/dev/null | base64`} # RPCPASSWORD
|
||||||
#rpcconnect=${RPCCONNECT:-127.0.0.1}
|
#rpcconnect=${RPCCONNECT:-127.0.0.1} # RPCCONNECT
|
||||||
#rpcport=${RPCPORT:-8332}
|
#rpcport=${RPCPORT:-8332} # RPCPORT
|
||||||
#rpcauth=${RPCAUTH:-xxx}
|
#rpcauth=${RPCAUTH:-xxx} # RPCPORT
|
||||||
|
|
||||||
# performance
|
# performance
|
||||||
dbcache=${DBCACHE=-2000}
|
dbcache=${DBCACHE=-2000} # DBCACHE
|
||||||
maxconnections=${MAXCONNECTIONS=-40}
|
maxconnections=${MAXCONNECTIONS=-40} # MAXCONNECTIONS
|
||||||
maxuploadtarget=${MAXUPLOADTARGET=-5000}
|
maxuploadtarget=${MAXUPLOADTARGET=-5000} # MAXUPLOADTARGET
|
||||||
|
|
||||||
# tor
|
# tor
|
||||||
#proxy=${PROXY:-127.0.0.1:9050}
|
#proxy=${PROXY:-127.0.0.1:9050} # PROXY
|
||||||
#seednode=${SEEDNODE1:-nkf5e6b7pl4jfd4a.onion}
|
#seednode=${SEEDNODE1:-nkf5e6b7pl4jfd4a.onion} # SEEDNODE1
|
||||||
#seednode=${SEEDNODE2:-xqzfakpeuvrobvpj.onion}
|
#seednode=${SEEDNODE2:-xqzfakpeuvrobvpj.onion} # SEEDNODE2
|
||||||
#seednode=${SEEDNODE3:-tsyvzsqwa2kkf6b2.onion}
|
#seednode=${SEEDNODE3:-tsyvzsqwa2kkf6b2.onion} # SEEDNODE3
|
||||||
|
|
||||||
# validation
|
# validation
|
||||||
reindex-chainstate=${REINDEXCHAINSTATE=-0}
|
reindex-chainstate=${REINDEXCHAINSTATE=-0} # REINDEXCHAINSTATE
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user