Browse Source

Add RPCPORT autoconfigure

patch-1
nolim1t 5 years ago
parent
commit
90869bf8eb
No known key found for this signature in database GPG Key ID: F6287B82CC84BCBD
  1. 10
      configure-box.sh
  2. 2
      docker-compose.yml

10
configure-box.sh

@ -33,6 +33,8 @@ if [ ! -z $TESTNET ] && [ -z $REGTEST ]; then
# Update bitcoin.conf
sed -i 's/\#\[test\]/\[test\]/g;' bitcoin/bitcoin.conf
sed -i 's/\#testnet=1/testnet=1/g' bitcoin/bitcoin.conf
echo "Setting testnet port"
sed -i 's/RPCPORT/18332/g; ' docker-compose.yml
# Update docker-compose
sed -i 's/mainnet/testnet/g; ' docker-compose.yml
# lnd.conf
@ -51,13 +53,19 @@ if [ -z $TESTNET ] && [ ! -z $REGTEST ]; then
sed -i 's/\#\[regtest\]/\[regtest\]/g;' bitcoin/bitcoin.conf
sed -i 's/\#regtest=1/regtest=1/g' bitcoin/bitcoin.conf
sed -i 's/mainnet/regtest/g; ' docker-compose.yml
echo "Setting regtest port"
sed -i 's/RPCPORT/18443/g; ' docker-compose.yml
# Update LND
echo "Changing LND to regtest mode"
sed -i 's/bitcoin.mainnet=1/bitcoin.regtest=1/g; ' lnd/lnd.conf
echo "Updating LND if regtest is set"
sed -i 's/bitcoin.node=neutrino/bitcoin.node=bitcoind/g; ' lnd/lnd.conf
fi
# if neither set
if [ -z $TESTNET ] && [ -z $REGTEST ]; then
echo "Setting mainnet RPC port in docker-compose"
sed -i 's/RPCPORT/18443/g; ' docker-compose.yml
fi
echo "Adding tor password"
SAVE_PASSWORD=`tor --hash-password "${RPCPASS}"`
echo "HashedControlPassword ${SAVE_PASSWORD}" >> tor/torrc

2
docker-compose.yml

@ -108,7 +108,7 @@ services:
environment:
PORT: "3005"
BITCOIN_HOST: "10.11.1.1"
RPC_PORT: "8332"
RPC_PORT: "RPCPORT"
RPC_USER: "lncm"
RPC_PASSWORD: "RPCPASS"
LND_NETWORK: "mainnet"

Loading…
Cancel
Save