#!/bin/bash # # LND (Lightning Network Daemon) Setup Script for Archipelago # Sets up LND in a Podman container # set -e echo "" echo "╔═══════════════════════════════════════════════════════════╗" echo "║ ⚡ LND (LIGHTNING) SETUP ║" echo "╚═══════════════════════════════════════════════════════════╝" echo "" # Check for Podman if ! command -v podman >/dev/null 2>&1; then echo "❌ Podman not found. Please run setup-bitcoin.sh first." exit 1 fi # Check if Bitcoin Core is running if ! podman ps | grep -q bitcoind; then echo "⚠️ Bitcoin Core is not running." echo " LND requires a synced Bitcoin Core node." read -p "Continue anyway? [y/N]: " CONTINUE if [[ ! "$CONTINUE" =~ ^[Yy]$ ]]; then exit 1 fi fi # Create data directory LND_DATA="${HOME}/.lnd" mkdir -p "$LND_DATA" echo "📍 LND data directory: $LND_DATA" echo "" # Get Bitcoin RPC credentials BITCOIN_CONF="${HOME}/.bitcoin/bitcoin.conf" if [ -f "$BITCOIN_CONF" ]; then RPC_USER=$(grep "^rpcuser=" "$BITCOIN_CONF" | cut -d= -f2) RPC_PASS=$(grep "^rpcpassword=" "$BITCOIN_CONF" | cut -d= -f2) else read -p "Bitcoin RPC username: " RPC_USER read -p "Bitcoin RPC password: " RPC_PASS fi # Ask for LND configuration echo "LND Configuration:" echo "" read -p "Node alias (public name): " LND_ALIAS LND_ALIAS=${LND_ALIAS:-archipelago-node} # Create lnd.conf cat > "$LND_DATA/lnd.conf" < ~/.config/systemd/user/lnd.service <