|
@ -48,6 +48,9 @@ if [ "$BITCOIN_NETWORK" != "mainnet" ] && [ "$BITCOIN_NETWORK" != "testnet" ] && |
|
|
exit 1 |
|
|
exit 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Get current Umbrel version |
|
|
|
|
|
UMBREL_VERSION="$(cat ${UMBREL_ROOT}/info.json | jq -r .version)" |
|
|
|
|
|
|
|
|
echo |
|
|
echo |
|
|
echo "======================================" |
|
|
echo "======================================" |
|
|
if [[ -f "${STATUS_DIR}/configured" ]]; then |
|
|
if [[ -f "${STATUS_DIR}/configured" ]]; then |
|
@ -125,6 +128,8 @@ if [ "$BITCOIN_NETWORK" == "testnet" ]; then |
|
|
sed -i "s/\# \[neutrino\]/\[neutrino\]/g;" "$LND_CONF_FILE" |
|
|
sed -i "s/\# \[neutrino\]/\[neutrino\]/g;" "$LND_CONF_FILE" |
|
|
sed -i "s/\# neutrino.addpeer=testnet1-btcd.zaphq.io/neutrino.addpeer=testnet1-btcd.zaphq.io/g;" "$LND_CONF_FILE" |
|
|
sed -i "s/\# neutrino.addpeer=testnet1-btcd.zaphq.io/neutrino.addpeer=testnet1-btcd.zaphq.io/g;" "$LND_CONF_FILE" |
|
|
sed -i "s/\# neutrino.addpeer=testnet2-btcd.zaphq.io/neutrino.addpeer=testnet2-btcd.zaphq.io/g;" "$LND_CONF_FILE" |
|
|
sed -i "s/\# neutrino.addpeer=testnet2-btcd.zaphq.io/neutrino.addpeer=testnet2-btcd.zaphq.io/g;" "$LND_CONF_FILE" |
|
|
|
|
|
# Set electrs to testnet |
|
|
|
|
|
sed -i "s/network = \"bitcoin\"/network = \"testnet\"/g;" "$ELECTRS_CONF_FILE" |
|
|
|
|
|
|
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -138,12 +143,15 @@ if [ "$BITCOIN_NETWORK" == "regtest" ]; then |
|
|
sed -i "s/bitcoin.mainnet=1/bitcoin.regtest=1/g;" "$LND_CONF_FILE" |
|
|
sed -i "s/bitcoin.mainnet=1/bitcoin.regtest=1/g;" "$LND_CONF_FILE" |
|
|
# Use bitcoind as the node |
|
|
# Use bitcoind as the node |
|
|
sed -i "s/bitcoin.node=neutrino/bitcoin.node=bitcoind/g;" "$LND_CONF_FILE" |
|
|
sed -i "s/bitcoin.node=neutrino/bitcoin.node=bitcoind/g;" "$LND_CONF_FILE" |
|
|
|
|
|
# Set electrs to regtest |
|
|
|
|
|
sed -i "s/network = \"bitcoin\"/network = \"regtest\"/g;" "$ELECTRS_CONF_FILE" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Update RPC and P2P Ports |
|
|
# Update RPC and P2P Ports |
|
|
sed -i "s/rpcport=<port>/rpcport=$BITCOIN_RPC_PORT/g;" "$BITCOIN_CONF_FILE" |
|
|
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/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-p2p-port>/$BITCOIN_P2P_PORT/g;" "$TOR_CONF_FILE" |
|
|
|
|
|
sed -i "/daemon_rpc_addr/s/<port>/$BITCOIN_RPC_PORT/g;" "$ELECTRS_CONF_FILE" |
|
|
sed -i "s/BITCOIN_RPC_PORT=<port>/BITCOIN_RPC_PORT=$BITCOIN_RPC_PORT/g;" "$ENV_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" |
|
|
sed -i "s/BITCOIN_P2P_PORT=<port>/BITCOIN_P2P_PORT=$BITCOIN_P2P_PORT/g;" "$ENV_FILE" |
|
|
|
|
|
|
|
@ -166,6 +174,9 @@ sed -i "s/tor.password=<password>/tor.password=$TOR_PASS/g;" "$LND_CONF_FILE" |
|
|
sed -i "s/TOR_PASSWORD=<password>/TOR_PASSWORD=$TOR_PASS/g;" "$ENV_FILE" |
|
|
sed -i "s/TOR_PASSWORD=<password>/TOR_PASSWORD=$TOR_PASS/g;" "$ENV_FILE" |
|
|
sed -i "s/TOR_HASHED_PASSWORD=<password>/TOR_HASHED_PASSWORD=$TOR_HASHED_PASS/g;" "$ENV_FILE" |
|
|
sed -i "s/TOR_HASHED_PASSWORD=<password>/TOR_HASHED_PASSWORD=$TOR_HASHED_PASS/g;" "$ENV_FILE" |
|
|
|
|
|
|
|
|
|
|
|
# Set Umbrel version in electrs banner |
|
|
|
|
|
sed -i "/server_banner/s/<version>/$UMBREL_VERSION/g;" "$ELECTRS_CONF_FILE" |
|
|
|
|
|
|
|
|
# If node is already synced, do not reset to neutrino |
|
|
# If node is already synced, do not reset to neutrino |
|
|
if [[ -f "${STATUS_DIR}/node-status-bitcoind-ready" ]]; then |
|
|
if [[ -f "${STATUS_DIR}/node-status-bitcoind-ready" ]]; then |
|
|
sed -i "s/bitcoin.node=.*/bitcoin.node=bitcoind/g;" "$LND_CONF_FILE" |
|
|
sed -i "s/bitcoin.node=.*/bitcoin.node=bitcoind/g;" "$LND_CONF_FILE" |
|
|