Merge pull request #1346 from mempool/wiz/remove-old-mempool-install-script

Remove old install script, merge remaining stuff into upgrade script
This commit is contained in:
wiz 2022-03-12 11:59:31 +00:00 committed by GitHub
commit 800fff1744
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 65 additions and 58 deletions

View File

@ -12,8 +12,8 @@
"MIN_PRIORITY": "debug"
},
"CORE_RPC": {
"USERNAME": "foo",
"PASSWORD": "bar"
"USERNAME": "__BITCOIN_RPC_USER__",
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4000"
@ -22,9 +22,9 @@
"ENABLED": false,
"HOST": "127.0.0.1",
"PORT": 3306,
"USERNAME": "bmempool",
"PASSWORD": "bmempool",
"DATABASE": "bmempool"
"USERNAME": "mempool_bisq",
"PASSWORD": "mempool_bisq",
"DATABASE": "mempool_bisq"
},
"STATISTICS": {
"ENABLED": true,

View File

@ -13,13 +13,13 @@
},
"CORE_RPC": {
"PORT": 7041,
"USERNAME": "foo",
"PASSWORD": "bar"
"USERNAME": "__ELEMENTS_RPC_USER__",
"PASSWORD": "__ELEMENTS_RPC_PASS__"
},
"SECOND_CORE_RPC": {
"PORT": 8332,
"USERNAME": "foo",
"PASSWORD": "bar"
"USERNAME": "__BITCOIN_RPC_USER__",
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4001"
@ -28,9 +28,9 @@
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"USERNAME": "lmempool",
"PASSWORD": "lmempool",
"DATABASE": "lmempool"
"USERNAME": "mempool_liquid",
"PASSWORD": "mempool_liquid",
"DATABASE": "mempool_liquid"
},
"STATISTICS": {
"ENABLED": true,

View File

@ -13,13 +13,13 @@
},
"CORE_RPC": {
"PORT": 7040,
"USERNAME": "foo",
"PASSWORD": "bar"
"USERNAME": "__ELEMENTS_RPC_USER__",
"PASSWORD": "__ELEMENTS_RPC_PASS__"
},
"SECOND_CORE_RPC": {
"PORT": 8332,
"USERNAME": "foo",
"PASSWORD": "bar"
"USERNAME": "__BITCOIN_RPC_USER__",
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4004"

View File

@ -15,13 +15,13 @@
},
"CORE_RPC": {
"PORT": 8332,
"USERNAME": "foo",
"PASSWORD": "bar"
"USERNAME": "__BITCOIN_RPC_USER__",
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"SECOND_CORE_RPC": {
"PORT": 8302,
"USERNAME": "foo",
"PASSWORD": "bar"
"USERNAME": "__BITCOIN_RPC_USER__",
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4000"

View File

@ -13,8 +13,8 @@
},
"CORE_RPC": {
"PORT": 38332,
"USERNAME": "foo",
"PASSWORD": "bar"
"USERNAME": "__BITCOIN_RPC_USER__",
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4003"
@ -23,9 +23,9 @@
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"USERNAME": "smempool",
"PASSWORD": "smempool",
"DATABASE": "smempool"
"USERNAME": "mempool_signet",
"PASSWORD": "mempool_signet",
"DATABASE": "mempool_signet"
},
"STATISTICS": {
"ENABLED": true,

View File

@ -13,8 +13,8 @@
},
"CORE_RPC": {
"PORT": 18332,
"USERNAME": "foo",
"PASSWORD": "bar"
"USERNAME": "__BITCOIN_RPC_USER__",
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4002"
@ -23,9 +23,9 @@
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"USERNAME": "tmempool",
"PASSWORD": "tmempool",
"DATABASE": "tmempool"
"USERNAME": "mempool_testnet",
"PASSWORD": "mempool_testnet",
"DATABASE": "mempool_testnet"
},
"STATISTICS": {
"ENABLED": true,

View File

@ -1,23 +0,0 @@
#!/usr/local/bin/zsh
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
for site in mainnet liquid testnet bisq signet liquidtestnet
do
#git clone https://github.com/mempool/mempool "${HOME}/${site}"
mkdir -p "${HOME}/public_html/${site}/"
cd "${HOME}/${site}/backend/"
cp "${HOME}/mempool/production/mempool-config.${site}.json" "mempool-config.json"
npm install
npm run build
if [ "${site}" = "mainnet" ]
then
cd "${HOME}/${site}/frontend/"
cp "${HOME}/mempool/production/mempool-frontend-config.${site}.json" "mempool-frontend-config.json"
npm install
npm run build
rsync -av ./dist/mempool/browser/* "${HOME}/public_html/${site}/"
fi
done

View File

@ -4,6 +4,12 @@ HOSTNAME=$(hostname)
LOCKFILE="${HOME}/lock"
REF=$(echo "${1:=origin/master}"|sed -e 's!:!/!')
# get rpc credentials
BITCOIN_RPC_USER=$(grep '^rpcuser' /bitcoin/bitcoin.conf | cut -d '=' -f2)
BITCOIN_RPC_PASS=$(grep '^rpcpassword' /bitcoin/bitcoin.conf | cut -d '=' -f2)
ELEMENTS_RPC_USER=$(grep '^rpcuser' /elements/elements.conf | cut -d '=' -f2)
ELEMENTS_RPC_PASS=$(grep '^rpcpassword' /elements/elements.conf | cut -d '=' -f2)
if [ -f "${LOCKFILE}" ];then
echo "upgrade already running? check lockfile ${LOCKFILE}"
exit 1
@ -42,6 +48,9 @@ build_frontend()
echo "[*] Building frontend for ${site}"
[ -z "${HASH}" ] && exit 1
cd "$HOME/${site}/frontend" || exit 1
if [ ! -e "mempool-frontend-config.json" ];then
cp "${HOME}/mempool/production/mempool-frontend-config.${site}.json" "mempool-frontend-config.json"
fi
npm install --no-optional || exit 1
npm run build || exit 1
}
@ -52,6 +61,15 @@ build_backend()
echo "[*] Building backend for ${site}"
[ -z "${HASH}" ] && exit 1
cd "$HOME/${site}/backend" || exit 1
if [ ! -e "mempool-config.json" ];then
cp "${HOME}/mempool/production/mempool-config.${site}.json" "mempool-config.json"
sed -i .orig \
-e "s!__BITCOIN_RPC_USER__!${BITCOIN_RPC_USER}!" \
-e "s!__BITCOIN_RPC_PASS__!${BITCOIN_RPC_PASS}!" \
-e "s!__ELEMENTS_RPC_USER__!${ELEMENTS_RPC_USER}!" \
-e "s!__ELEMENTS_RPC_PASS__!${ELEMENTS_RPC_PASS}!" \
"mempool-config.json"
fi
npm install --no-optional || exit 1
npm run build || exit 1
}
@ -60,16 +78,28 @@ ship_frontend()
{
local site="$1"
cd "$HOME/${site}/frontend" || exit 1
rsync -av ./dist/mempool/browser/* "${HOME}/public_html/${site}/" || exit 1
mkdir -p "${HOME}/public_html/${site}/"
rsync -av "./dist/mempool/browser/" "${HOME}/public_html/${site}/" || exit 1
}
export NVM_DIR="${HOME}/.nvm"
source "${NVM_DIR}/nvm.sh"
for target in mainnet testnet signet liquid liquidtestnet bisq;do update_repo "${target}";done
for target in mainnet testnet signet liquid liquidtestnet bisq;do build_backend "${target}";done
for target in mainnet liquid bisq;do build_frontend "${target}";done
for target in mainnet liquid bisq;do ship_frontend "${target}";done
for target in mainnet testnet signet liquid liquidtestnet bisq;do
update_repo "${target}"
done
for target in mainnet testnet signet liquid liquidtestnet bisq;do
build_backend "${target}"
done
for target in mainnet liquid bisq;do
build_frontend "${target}"
done
for target in mainnet liquid bisq;do
ship_frontend "${target}"
done
echo "${HOSTNAME} updated to \`${REF}\` @ \`${HASH}\`" | /usr/local/bin/keybase chat send --nonblock --channel general mempool.dev
echo "${HOSTNAME} updated to \`${REF}\` @ \`${HASH}\`" | /usr/local/bin/keybase chat send --nonblock --channel general mempool.ops