mempool/production/mempool-start-all
2024-01-26 10:40:21 -05:00

37 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env zsh
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
nvm use v20.7.0
# start all mempool backends that exist
for site in mainnet mainnet-lightning testnet testnet-lightning signet signet-lightning bisq liquid liquidtestnet;do
cd "${HOME}/${site}/backend/" && \
echo "starting mempool backend: ${site}" && \
screen -dmS "${site}" sh -c 'while true;do npm run start-production;sleep 1;done'
done
export DISPLAY=:0
screen -dmS x startx
sleep 3
# start unfurlers for each frontend
for site in mainnet liquid bisq;do
cd "$HOME/${site}/unfurler" && \
echo "starting mempool unfurler: ${site}" && \
screen -dmS "unfurler-${site}" sh -c 'while true;do npm run unfurler;sleep 2;done'
done
# start nginx warm cacher
for site in mainnet;do
echo "starting mempool cache warmer: ${site}"
screen -dmS "warmer-${site}" $HOME/mempool/production/nginx-cache-warmer
done
# start nginx hot cacher
for site in mainnet;do
echo "starting mempool cache heater: ${site}"
screen -dmS "heater-${site}" $HOME/mempool/production/nginx-cache-heater
done
exit 0