Browse Source

Clean up Bitcoin Core config (#152)

mention-security-issues
Luke Childs 4 years ago
committed by GitHub
parent
commit
8a5da00748
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      scripts/configure
  2. 25
      templates/bitcoin-sample.conf
  3. 4
      templates/torrc-sample

13
scripts/configure

@ -107,10 +107,8 @@ if [ "$BITCOIN_NETWORK" == "testnet" ]; then
# Set testnet ports
BITCOIN_RPC_PORT=18332
BITCOIN_P2P_PORT=18333
# Uncomment "test" block
sed -i "s/\#\[test\]/\[test\]/g;" "$BITCOIN_CONF_FILE"
# Enable testnet
sed -i "s/\#testnet=1/testnet=1/g" "$BITCOIN_CONF_FILE"
# Switch Bitcoin Core to testnet
sed -i '1s/^/testnet=1\n[test]\n\n/' "$BITCOIN_CONF_FILE"
# Switch LND to testnet
sed -i "s/bitcoin.mainnet=1/bitcoin.testnet=1/g;" "$LND_CONF_FILE"
# Uncomment testnet neutrino block and peers
@ -124,10 +122,8 @@ if [ "$BITCOIN_NETWORK" == "regtest" ]; then
# Set regtest ports
BITCOIN_RPC_PORT=18443
BITCOIN_P2P_PORT=18444
# Uncomment "regtest" block
sed -i "s/\#\[regtest\]/\[regtest\]/g;" "$BITCOIN_CONF_FILE"
# Enable regtest
sed -i "s/\#regtest=1/regtest=1/g" "$BITCOIN_CONF_FILE"
# Switch Bitcoin Core to regtest
sed -i '1s/^/regtest=1\n[regtest]\n\n/' "$BITCOIN_CONF_FILE"
# Switch LND to regtest
sed -i "s/bitcoin.mainnet=1/bitcoin.regtest=1/g;" "$LND_CONF_FILE"
# Use bitcoind as the node
@ -137,6 +133,7 @@ fi
# Update RPC and P2P Ports
sed -i "s/rpcport=<port>/rpcport=$BITCOIN_RPC_PORT/g;" "$BITCOIN_CONF_FILE"
sed -i "s/port=<port>/port=$BITCOIN_P2P_PORT/g;" "$BITCOIN_CONF_FILE"
sed -i "s/<bitcoin-p2p-port>/$BITCOIN_P2P_PORT/g;" "$TOR_CONF_FILE"
sed -i "s/BITCOIN_RPC_PORT=<port>/BITCOIN_RPC_PORT=$BITCOIN_RPC_PORT/g;" "$ENV_FILE"
sed -i "s/BITCOIN_P2P_PORT=<port>/BITCOIN_P2P_PORT=$BITCOIN_P2P_PORT/g;" "$ENV_FILE"

25
templates/bitcoin-sample.conf

@ -1,22 +1,7 @@
# Bitcoin daemon
server=1
rest=1
# Automatically uncommented if Umbrel
# is configured for testnet
#testnet=1
#[test]
# Automatically uncommented if Umbrel
# is configured for regtest
#regtest=1
#[regtest]
# Tor
onion=10.11.5.1:29050
torcontrol=10.11.5.1:29051
torpassword=<password>
proxy=10.11.5.1:29050
listen=1
bind=10.11.1.1
# Connections
port=<port>
@ -29,9 +14,7 @@ rpcauth=<rpcauth>
# Optimizations
dbcache=<size>
maxconnections=40
maxmempool=300
maxorphantx=10
maxconnections=40
maxuploadtarget=1000
minrelaytxfee=0.00000001
prune=0

4
templates/torrc-sample

@ -6,4 +6,8 @@ ControlPort 10.11.5.1:29051
HiddenServiceDir /var/lib/tor/web
HiddenServicePort 80 10.11.0.2:80
# Bitcoin Core P2P Hidden Service
HiddenServiceDir /var/lib/tor/bitcoin-p2p
HiddenServicePort <bitcoin-p2p-port> 10.11.1.1:<bitcoin-p2p-port>
HashedControlPassword <password>

Loading…
Cancel
Save