cd
git clone https://github.com/apotdevin/thunderhub.git
cd thunderhub
npm install
npm run build
ln -s /data/lnd /home/thunderhub/.lnd
cd /home/thunderhub/thunderhub
cp .env .env.local
cat << EOF | tee /home/thunderhub/thunderhub/.env.local
# -----------
# Server Configs
# -----------
LOG_LEVEL='debug'
TOR_PROXY_SERVER=socks://127.0.0.1:9050
NODE_ENV=production
PORT=3010

# -----------
# Account Configs
# -----------
ACCOUNT_CONFIG_PATH='/home/thunderhub/thunderhub/thubConfig.yaml'
EOF

cat << EOF | tee /home/thunderhub/thunderhub/thubConfig.yaml
masterPassword: 'PASSWORD' # Default password unless defined in account
accounts:
  - name: 'RaspiBolt'
    serverUrl: '127.0.0.1:10009'
    macaroonPath: '/home/thunderhub/admin.macaroon'
    certificatePath: '/home/thunderhub/.lnd/tls.cert'
    password: 'accountpassword'
EOF

cd
rm thunderhub2.sh
cd /home/thunderhub/thunderhub/
