Merge branch 'master' into ops/nginx-buffer-size

This commit is contained in:
wiz
2023-09-27 12:10:25 +09:00
committed by GitHub
670 changed files with 116553 additions and 49890 deletions

View File

@@ -2,7 +2,7 @@
These instructions are for setting up a serious production Mempool website for Bitcoin (mainnet, testnet, signet), Liquid (mainnet, testnet), and Bisq.
Again, this setup is no joke—home users should use [one of the other installation methods](../#installation-methods).
Again, this setup is no joke—home users should use [one of the other installation methods](../#installation-methods). Support is only provided to [enterprise sponsors](https://mempool.space/enterprise).
### Server Hardware

View File

@@ -1,13 +1,15 @@
datadir=/bitcoin
server=1
txindex=1
coinstatsindex=1
listen=1
discover=1
par=16
dbcache=8192
maxmempool=1337
maxmempool=4096
mempoolexpiry=999999
maxconnections=42
mempoolfullrbf=1
maxconnections=100
onion=127.0.0.1:9050
rpcallowip=127.0.0.1
rpcuser=__BITCOIN_RPC_USER__
@@ -36,6 +38,12 @@ zmqpubrawtx=tcp://127.0.0.1:8335
#addnode=[2401:b140:2::92:204]:8333
#addnode=[2401:b140:2::92:205]:8333
#addnode=[2401:b140:2::92:206]:8333
#addnode=[2401:b140:3::92:201]:8333
#addnode=[2401:b140:3::92:202]:8333
#addnode=[2401:b140:3::92:203]:8333
#addnode=[2401:b140:3::92:204]:8333
#addnode=[2401:b140:3::92:205]:8333
#addnode=[2401:b140:3::92:206]:8333
[test]
daemon=1
@@ -57,6 +65,12 @@ zmqpubrawtx=tcp://127.0.0.1:18335
#addnode=[2401:b140:2::92:204]:18333
#addnode=[2401:b140:2::92:205]:18333
#addnode=[2401:b140:2::92:206]:18333
#addnode=[2401:b140:3::92:201]:18333
#addnode=[2401:b140:3::92:202]:18333
#addnode=[2401:b140:3::92:203]:18333
#addnode=[2401:b140:3::92:204]:18333
#addnode=[2401:b140:3::92:205]:18333
#addnode=[2401:b140:3::92:206]:18333
[signet]
daemon=1
@@ -78,3 +92,9 @@ zmqpubrawtx=tcp://127.0.0.1:38335
#addnode=[2401:b140:2::92:204]:38333
#addnode=[2401:b140:2::92:205]:38333
#addnode=[2401:b140:2::92:206]:38333
#addnode=[2401:b140:3::92:201]:38333
#addnode=[2401:b140:3::92:202]:38333
#addnode=[2401:b140:3::92:203]:38333
#addnode=[2401:b140:3::92:204]:38333
#addnode=[2401:b140:3::92:205]:38333
#addnode=[2401:b140:3::92:206]:38333

View File

@@ -1,5 +1,5 @@
@reboot sleep 30 ; screen -dmS mainnet /bitcoin/electrs/electrs-start-mainnet
@reboot sleep 60 ; /usr/local/bin/bitcoind -testnet >/dev/null 2>&1
@reboot sleep 70 ; screen -dmS testnet /bitcoin/electrs/electrs-start-testnet
@reboot sleep 80 ; /usr/local/bin/bitcoind -signet >/dev/null 2>&1
@reboot sleep 90 ; screen -dmS signet /bitcoin/electrs/electrs-start-signet
@reboot sleep 5 ; /usr/local/bin/bitcoind -testnet >/dev/null 2>&1
@reboot sleep 5 ; /usr/local/bin/bitcoind -signet >/dev/null 2>&1
@reboot sleep 10 ; screen -dmS mainnet /bitcoin/electrs/electrs-start-mainnet
@reboot sleep 10 ; screen -dmS testnet /bitcoin/electrs/electrs-start-testnet
@reboot sleep 10 ; screen -dmS signet /bitcoin/electrs/electrs-start-signet

View File

@@ -4,6 +4,7 @@ txindex=0
listen=1
daemon=1
prune=1337
mempoolfullrbf=1
rpcallowip=127.0.0.1
rpcuser=__BITCOIN_RPC_USER__
rpcpassword=__BITCOIN_RPC_PASS__

View File

@@ -1,24 +0,0 @@
#!/usr/bin/env zsh
cd "${HOME}/electrs"
#source "${HOME}/.cargo/env"
#export PATH="${HOME}/.cargo/bin:${PATH}"
until false
do
cargo run \
--release \
--features liquid \
--bin electrs \
-- \
-vvv \
--asset-db-path "${HOME}/asset_registry_db" \
--address-search \
--cors '*' \
--db-dir __ELECTRS_DATA_ROOT__ \
--network liquid \
--daemon-dir "${HOME}" \
--http-addr '[::]:3001' \
--cookie '__ELEMENTS_RPC_USER__:__ELEMENTS_RPC_PASS__' \
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
sleep 1
done

View File

@@ -1,24 +0,0 @@
#!/usr/local/bin/zsh
cd "${HOME}/electrs"
#source "${HOME}/.cargo/env"
#export PATH="${HOME}/.cargo/bin:${PATH}"
until false
do
cargo run \
--release \
--features liquid \
--bin electrs \
-- \
-vv \
--asset-db-path "${HOME}/asset_registry_testnet_db" \
--address-search \
--cors '*' \
--db-dir __ELECTRS_DATA_ROOT__ \
--network liquidtestnet \
--daemon-dir "${HOME}" \
--http-addr '[::]:3004' \
--cookie '__ELEMENTS_RPC_USER__:__ELEMENTS_RPC_PASS__' \
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
sleep 1
done

View File

@@ -1,22 +0,0 @@
#!/usr/bin/env zsh
cd "${HOME}/electrs"
#source "${HOME}/.cargo/env"
#export PATH="${HOME}/.cargo/bin:${PATH}"
until false
do
cargo run \
--release \
--bin electrs \
-- \
-vvvv \
--address-search \
--cors '*' \
--db-dir __ELECTRS_DATA_ROOT__ \
--daemon-dir "${HOME}" \
--http-addr '[::]:3000' \
--cookie '__BITCOIN_RPC_USER__:__BITCOIN_RPC_PASS__' \
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
sleep 3
done

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env zsh
cd "${HOME}/electrs"
#source "${HOME}/.cargo/env"
#export PATH="${HOME}/.cargo/bin:${PATH}"
until false
do
cargo run \
--release \
--bin electrs \
-- \
-vv \
--network signet \
--address-search \
--cors '*' \
--db-dir __ELECTRS_DATA_ROOT__ \
--daemon-rpc-addr '127.0.0.1:38332' \
--daemon-dir "${HOME}" \
--http-addr '[::]:3003' \
--cookie '__BITCOIN_RPC_USER__:__BITCOIN_RPC_PASS__' \
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
sleep 1
done

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env zsh
cd "${HOME}/electrs"
#source $HOME/.cargo/env
#export PATH=$HOME/.cargo/bin:$PATH
until false
do
cargo run \
--release \
--bin electrs \
-- \
-vvvv \
--network testnet \
--address-search \
--cors '*' \
--db-dir __ELECTRS_DATA_ROOT__ \
--daemon-dir "${HOME}" \
--http-addr '[::]:3002' \
--cookie '__BITCOIN_RPC_USER__:__BITCOIN_RPC_PASS__' \
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
sleep 3
done

View File

@@ -13,6 +13,7 @@ validatepegin=1
mainchainrpcport=8332
[liquidtestnet]
rpcport=7040
validatepegin=0
anyonecanspendaremine=0
initialfreecoins=2100000000000000

View File

@@ -1,10 +1,10 @@
# start elements on reboot
@reboot sleep 60 ; /usr/local/bin/elementsd -chain=liquidv1 >/dev/null 2>&1
@reboot sleep 60 ; /usr/local/bin/elementsd -chain=liquidtestnet >/dev/null 2>&1
@reboot sleep 5 ; /usr/local/bin/elementsd -chain=liquidv1 >/dev/null 2>&1
@reboot sleep 5 ; /usr/local/bin/elementsd -chain=liquidtestnet >/dev/null 2>&1
# start electrs on reboot
@reboot sleep 90 ; screen -dmS liquidv1 /elements/electrs/electrs-start-liquid
@reboot sleep 90 ; screen -dmS liquidtestnet /elements/electrs/electrs-start-liquidtestnet
@reboot sleep 20 ; screen -dmS liquidv1 /elements/electrs/electrs-start-liquid
@reboot sleep 20 ; screen -dmS liquidtestnet /elements/electrs/electrs-start-liquidtestnet
# hourly asset update and electrs restart
6 * * * * cd $HOME/asset_registry_db && git pull --quiet origin master && cd $HOME/asset_registry_testnet_db && git pull --quiet origin master && killall electrs

View File

@@ -48,7 +48,7 @@ load_rc_config ${name}
: ${bitcoin_syslog_facility:="local0"}
: ${bitcoin_syslog_priority:="info"}
: ${bitcoin_syslog_tag:="bitcoin"}
: ${bitcoin_kill_after:="300"}
: ${bitcoin_kill_after:="600"}
: ${bitcoinlimits_args:="-e -U ${bitcoin_user}"}
# set up dependant variables

View File

@@ -48,9 +48,9 @@ BITCOIN_MAINNET_ENABLE=ON
BITCOIN_MAINNET_MINFEE_ENABLE=ON
BITCOIN_TESTNET_ENABLE=ON
BITCOIN_SIGNET_ENABLE=ON
LN_BITCOIN_MAINNET_ENABLE=ON
LN_BITCOIN_TESTNET_ENABLE=ON
LN_BITCOIN_SIGNET_ENABLE=ON
BITCOIN_MAINNET_LIGHTNING_ENABLE=ON
BITCOIN_TESTNET_LIGHTNING_ENABLE=ON
BITCOIN_SIGNET_LIGHTNING_ENABLE=ON
BISQ_MAINNET_ENABLE=ON
ELEMENTS_LIQUID_ENABLE=ON
ELEMENTS_LIQUIDTESTNET_ENABLE=ON
@@ -192,6 +192,7 @@ case $OS in
TOR_USER=_tor
TOR_GROUP=_tor
NGINX_USER=www
NGINX_GROUP=www
NGINX_ETC_FOLDER=/usr/local/etc/nginx
NGINX_CONFIGURATION=/usr/local/etc/nginx/nginx.conf
CERTBOT_PKG=py39-certbot
@@ -209,6 +210,7 @@ case $OS in
TOR_GROUP=debian-tor
CERTBOT_PKG=python3-certbot-nginx
NGINX_USER=www-data
NGINX_GROUP=www-data
NGINX_ETC_FOLDER=/etc/nginx
NGINX_CONFIGURATION=/etc/nginx/nginx.conf
;;
@@ -230,9 +232,9 @@ MYSQL_GROUP=mysql
MEMPOOL_MAINNET_USER='mempool'
MEMPOOL_TESTNET_USER='mempool_testnet'
MEMPOOL_SIGNET_USER='mempool_signet'
LN_MEMPOOL_MAINNET_USER='mempool_mainnet_lightning'
LN_MEMPOOL_TESTNET_USER='mempool_testnet_lightning'
LN_MEMPOOL_SIGNET_USER='mempool_signet_lightning'
MEMPOOL_MAINNET_LIGHTNING_USER='mempool_mainnet_lightning'
MEMPOOL_TESTNET_LIGHTNING_USER='mempool_testnet_lightning'
MEMPOOL_SIGNET_LIGHTNING_USER='mempool_signet_lightning'
MEMPOOL_LIQUID_USER='mempool_liquid'
MEMPOOL_LIQUIDTESTNET_USER='mempool_liquidtestnet'
MEMPOOL_BISQ_USER='mempool_bisq'
@@ -240,9 +242,9 @@ MEMPOOL_BISQ_USER='mempool_bisq'
MEMPOOL_MAINNET_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
MEMPOOL_TESTNET_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
MEMPOOL_SIGNET_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
LN_MEMPOOL_MAINNET_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
LN_MEMPOOL_TESTNET_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
LN_MEMPOOL_SIGNET_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
MEMPOOL_MAINNET_LIGHTNING_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
MEMPOOL_TESTNET_LIGHTNING_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
MEMPOOL_SIGNET_LIGHTNING_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
MEMPOOL_LIQUID_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
MEMPOOL_LIQUIDTESTNET_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
MEMPOOL_BISQ_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
@@ -251,6 +253,7 @@ MEMPOOL_BISQ_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
MEMPOOL_HOME=/mempool
MEMPOOL_USER=mempool
MEMPOOL_GROUP=mempool
MEMPOOL_MYSQL_CREDENTIALS="${MEMPOOL_HOME}/.mysql_credentials"
# name of Tor hidden service in torrc
MEMPOOL_TOR_HS=mempool
@@ -300,12 +303,6 @@ BISQ_HOME=/bisq
# tor HS folder
BISQ_TOR_HS=bisq
# Unfurl user/group
UNFURL_USER=unfurl
UNFURL_GROUP=unfurl
# Unfurl home folder
UNFURL_HOME=/unfurl
# liquid user/group
ELEMENTS_USER=elements
ELEMENTS_GROUP=elements
@@ -335,7 +332,7 @@ BITCOIN_REPO_URL=https://github.com/bitcoin/bitcoin
BITCOIN_REPO_NAME=bitcoin
BITCOIN_REPO_BRANCH=master
#BITCOIN_LATEST_RELEASE=$(curl -s https://api.github.com/repos/bitcoin/bitcoin/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
BITCOIN_LATEST_RELEASE=v23.0
BITCOIN_LATEST_RELEASE=v25.0
echo -n '.'
BISQ_REPO_URL=https://github.com/bisq-network/bisq
@@ -356,18 +353,18 @@ ELEMENTS_REPO_URL=https://github.com/ElementsProject/elements
ELEMENTS_REPO_NAME=elements
ELEMENTS_REPO_BRANCH=master
#ELEMENTS_LATEST_RELEASE=$(curl -s https://api.github.com/repos/ElementsProject/elements/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
ELEMENTS_LATEST_RELEASE=elements-0.21.0.2
ELEMENTS_LATEST_RELEASE=elements-22.1.1
echo -n '.'
BITCOIN_ELECTRS_REPO_URL=https://github.com/blockstream/electrs
BITCOIN_ELECTRS_REPO_URL=https://github.com/mempool/electrs
BITCOIN_ELECTRS_REPO_NAME=electrs
BITCOIN_ELECTRS_REPO_BRANCH=new-index
BITCOIN_ELECTRS_LATEST_RELEASE=new-index
BITCOIN_ELECTRS_REPO_BRANCH=mempool
BITCOIN_ELECTRS_LATEST_RELEASE=mempool
ELEMENTS_ELECTRS_REPO_URL=https://github.com/blockstream/electrs
ELEMENTS_ELECTRS_REPO_URL=https://github.com/mempool/electrs
ELEMENTS_ELECTRS_REPO_NAME=electrs
ELEMENTS_ELECTRS_REPO_BRANCH=new-index
ELEMENTS_ELECTRS_LATEST_RELEASE=new-index
ELEMENTS_ELECTRS_REPO_BRANCH=mempool
ELEMENTS_ELECTRS_LATEST_RELEASE=mempool
LIQUID_ASSET_REGISTRY_DB_URL=https://github.com/blockstream/asset_registry_db
LIQUID_ASSET_REGISTRY_DB_NAME=asset_registry_db
@@ -395,7 +392,7 @@ DEBIAN_UNFURL_PKG+=(libxdamage-dev libxrandr-dev libgbm-dev libpango1.0-dev liba
# packages needed for mempool ecosystem
FREEBSD_PKG=()
FREEBSD_PKG+=(zsh sudo git git-lfs screen curl wget calc neovim)
FREEBSD_PKG+=(openssh-portable py39-pip rust llvm90 jq base64 libzmq4)
FREEBSD_PKG+=(openssh-portable py39-pip rust llvm10 jq base64 libzmq4)
FREEBSD_PKG+=(boost-libs autoconf automake gmake gcc libevent libtool pkgconf)
FREEBSD_PKG+=(nginx rsync py39-certbot-nginx mariadb105-server keybase)
FREEBSD_PKG+=(geoipupdate)
@@ -533,6 +530,7 @@ osCertbotDryRun()
zfsCreateFilesystems()
{
zfs create -o "mountpoint=/backup" "${ZPOOL}/backup"
zfs create -o "mountpoint=/var/cache/nginx" "${ZPOOL}/cache"
zfs create -o "mountpoint=${ELEMENTS_HOME}" "${ZPOOL}/elements"
zfs create -o "mountpoint=${BITCOIN_HOME}" "${ZPOOL}/bitcoin"
@@ -546,6 +544,12 @@ zfsCreateFilesystems()
zfs create -o "mountpoint=${ELEMENTS_HOME}/liquidv1" "${ZPOOL}/elements/liquidv1"
zfs create -o "mountpoint=${ELEMENTS_ELECTRS_HOME}" "${ZPOOL}/elements/electrs"
# create /bitcoin/socket with custom ACL for electrs unix sockets
zfs create -o "mountpoint=${BITCOIN_HOME}/socket" "${ZPOOL}/bitcoin/socket"
# create /elements/socket with custom ACL for electrs unix sockets
zfs create -o "mountpoint=${ELEMENTS_HOME}/socket" "${ZPOOL}/elements/socket"
# Bitcoin Mainnet
if [ "${BITCOIN_MAINNET_ENABLE}" = ON ];then
for folder in chainstate indexes blocks
@@ -629,6 +633,7 @@ zfsCreateFilesystems()
ext4CreateDir()
{
mkdir -p "/backup" "${ELEMENTS_HOME}" "${BITCOIN_HOME}" "${MINFEE_HOME}" "${ELECTRS_HOME}" "${MEMPOOL_HOME}" "${MYSQL_HOME}" "${BITCOIN_ELECTRS_HOME}" "${ELEMENTS_HOME}/liquidv1" "${ELEMENTS_ELECTRS_HOME}"
# Bitcoin Mainnet
if [ "${BITCOIN_MAINNET_ENABLE}" = ON ];then
for folder in chainstate indexes blocks
@@ -826,21 +831,21 @@ else
fi
if grep LN-Mainnet $tempfile >/dev/null 2>&1;then
LN_BITCOIN_MAINNET_ENABLE=ON
BITCOIN_MAINNET_LIGHTNING_ENABLE=ON
else
LN_BITCOIN_MAINNET_ENABLE=OFF
BITCOIN_MAINNET_LIGHTNING_ENABLE=OFF
fi
if grep LN-Testnet $tempfile >/dev/null 2>&1;then
LN_BITCOIN_TESTNET_ENABLE=ON
BITCOIN_TESTNET_LIGHTNING_ENABLE=ON
else
LN_BITCOIN_TESTNET_ENABLE=OFF
BITCOIN_TESTNET_LIGHTNING_ENABLE=OFF
fi
if grep LN-Signet $tempfile >/dev/null 2>&1;then
LN_BITCOIN_SIGNET_ENABLE=ON
BITCOIN_SIGNET_LIGHTNING_ENABLE=ON
else
LN_BITCOIN_SIGNET_ENABLE=OFF
BITCOIN_SIGNET_LIGHTNING_ENABLE=OFF
fi
if grep Liquid $tempfile >/dev/null 2>&1;then
@@ -1009,6 +1014,7 @@ osSudo "${MEMPOOL_USER}" git clone --branch "${MEMPOOL_REPO_BRANCH}" "${MEMPOOL_
osSudo "${MEMPOOL_USER}" ln -s mempool/production/mempool-build-all upgrade
osSudo "${MEMPOOL_USER}" ln -s mempool/production/mempool-kill-all stop
osSudo "${MEMPOOL_USER}" ln -s mempool/production/mempool-start-all start
osSudo "${MEMPOOL_USER}" ln -s mempool/production/mempool-reset-all reset
case $OS in
@@ -1017,7 +1023,7 @@ case $OS in
osSudo "${ROOT_USER}" mkdir -p /usr/local/etc/syslog.d
osSudo "${ROOT_USER}" install -c -m 755 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/mempool-logger" /usr/local/bin/mempool-logger
osSudo "${ROOT_USER}" install -c -m 644 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/syslog.conf" /usr/local/etc/syslog.d/mempool.conf
echo "[*] Installing newsyslog configuration"
osSudo "${ROOT_USER}" mkdir -p /usr/local/etc/newsyslog.conf.d
osSudo "${ROOT_USER}" install -c -m 644 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/newsyslog-mempool-backend.conf" /usr/local/etc/newsyslog.conf.d/newsyslog-mempool-backend.conf
@@ -1039,8 +1045,9 @@ osSudo "${ROOT_USER}" crontab -u "${MEMPOOL_USER}" "${MEMPOOL_HOME}/${MEMPOOL_RE
echo "[*] Installing nvm.sh from GitHub"
osSudo "${MEMPOOL_USER}" sh -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh'
echo "[*] Building NodeJS via nvm.sh"
osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm install v16.16.0 --shared-zlib'
echo "[*] Building NodeJS v20.5.1 via nvm.sh"
osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm install v20.5.1 --shared-zlib'
osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm alias default 20.5.1'
####################
# Tor installation #
@@ -1055,17 +1062,8 @@ if [ "${TOR_INSTALL}" = ON ];then
osSudo "${ROOT_USER}" install -c -m 644 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/torrc" "${TOR_CONFIGURATION}"
osSudo "${ROOT_USER}" sed -i.orig "s!__TOR_RESOURCES__!${TOR_RESOURCES}!" "${TOR_CONFIGURATION}"
echo "[*] Adding Tor HS configuration for Mempool"
if [ "${MEMPOOL_ENABLE}" = "ON" ];then
if ! grep "${MEMPOOL_TOR_HS}" "${TOR_CONFIGURATION}" >/dev/null 2>&1;then
osSudo "${ROOT_USER}" /bin/sh -c "echo HiddenServiceDir ${TOR_RESOURCES}/${MEMPOOL_TOR_HS}/ >> ${TOR_CONFIGURATION}"
osSudo "${ROOT_USER}" /bin/sh -c "echo HiddenServicePort 80 127.0.0.1:81 >> ${TOR_CONFIGURATION}"
osSudo "${ROOT_USER}" /bin/sh -c "echo HiddenServiceVersion 3 >> ${TOR_CONFIGURATION}"
fi
fi
echo "[*] Adding Tor HS configuration for Bisq"
if [ "${BISQ_ENABLE}" = "ON" ];then
if [ "${BISQ_MAINNET_ENABLE}" = "ON" ];then
if ! grep "${BISQ_TOR_HS}" "${TOR_CONFIGURATION}" >/dev/null 2>&1;then
osSudo "${ROOT_USER}" /bin/sh -c "echo HiddenServiceDir ${TOR_RESOURCES}/${BISQ_TOR_HS}/ >> ${TOR_CONFIGURATION}"
osSudo "${ROOT_USER}" /bin/sh -c "echo HiddenServicePort 80 127.0.0.1:82 >> ${TOR_CONFIGURATION}"
@@ -1074,7 +1072,7 @@ if [ "${TOR_INSTALL}" = ON ];then
fi
echo "[*] Adding Tor HS configuration for Liquid"
if [ "${LIQUID_ENABLE}" = "ON" ];then
if [ "${ELEMENTS_LIQUID_ENABLE}" = "ON" ];then
if ! grep "${LIQUID_TOR_HS}" "${TOR_CONFIGURATION}" >/dev/null 2>&1;then
osSudo "${ROOT_USER}" /bin/sh -c "echo HiddenServiceDir ${TOR_RESOURCES}/${LIQUID_TOR_HS}/ >> ${TOR_CONFIGURATION}"
osSudo "${ROOT_USER}" /bin/sh -c "echo HiddenServicePort 80 127.0.0.1:83 >> ${TOR_CONFIGURATION}"
@@ -1243,9 +1241,9 @@ if [ "${BITCOIN_ELECTRS_INSTALL}" = ON ];then
case $OS in
FreeBSD)
echo "[*] Patching Bitcoin Electrs code for FreeBSD"
osSudo "${BITCOIN_USER}" sh -c "cd \"${BITCOIN_HOME}/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4\" && patch -p1 < \"${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/freebsd/sysconf.patch\""
osSudo "${BITCOIN_USER}" sh -c "cd \"${BITCOIN_ELECTRS_HOME}/src/new_index/\" && sed -i.bak -e s/Snappy/None/ db.rs && rm db.rs.bak"
osSudo "${BITCOIN_USER}" sh -c "cd \"${BITCOIN_ELECTRS_HOME}/src/bin/\" && sed -i.bak -e 's/from_secs(5)/from_secs(1)/' electrs.rs && rm electrs.rs.bak"
osSudo "${BITCOIN_USER}" sh -c "cd \"${BITCOIN_HOME}/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysconf-0.3.4\" && patch -p1 < \"${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/freebsd/sysconf.patch\""
#osSudo "${BITCOIN_USER}" sh -c "cd \"${BITCOIN_ELECTRS_HOME}/src/new_index/\" && sed -i.bak -e s/Snappy/None/ db.rs && rm db.rs.bak"
#osSudo "${BITCOIN_USER}" sh -c "cd \"${BITCOIN_ELECTRS_HOME}/src/bin/\" && sed -i.bak -e 's/from_secs(5)/from_secs(1)/' electrs.rs && rm electrs.rs.bak"
;;
Debian)
;;
@@ -1271,41 +1269,41 @@ if [ "${ELEMENTS_ELECTRS_INSTALL}" = ON ];then
if [ "${ELEMENTS_LIQUIDTESTNET_ENABLE}" = ON ];then
osSudo "${ROOT_USER}" chown -R "${ELEMENTS_USER}:${ELEMENTS_GROUP}" "${ELECTRS_LIQUIDTESTNET_DATA}"
fi
echo "[*] Cloning Liquid Electrs repo from ${ELEMENTS_ELECTRS_REPO_URL}"
osSudo "${ELEMENTS_USER}" git config --global advice.detachedHead false
osSudo "${ELEMENTS_USER}" git clone --branch "${ELEMENTS_ELECTRS_REPO_BRANCH}" "${ELEMENTS_ELECTRS_REPO_URL}" "${ELEMENTS_HOME}/${ELEMENTS_ELECTRS_REPO_NAME}"
echo "[*] Checking out Liquid Electrs ${ELEMENTS_ELECTRS_LATEST_RELEASE}"
osSudo "${ELEMENTS_USER}" sh -c "cd ${ELEMENTS_HOME}/${ELEMENTS_ELECTRS_REPO_NAME} && git checkout ${ELEMENTS_ELECTRS_LATEST_RELEASE}"
echo "[*] Cloning Liquid Asset Registry repo from ${LIQUID_ASSET_REGISTRY_DB_URL}"
osSudo "${ELEMENTS_USER}" git config --global advice.detachedHead false
osSudo "${ELEMENTS_USER}" git clone "${LIQUID_ASSET_REGISTRY_DB_URL}" "${ELEMENTS_HOME}/${LIQUID_ASSET_REGISTRY_DB_NAME}"
echo "[*] Cloning Liquid Asset Registry testnet repo from ${LIQUIDTESTNET_ASSET_REGISTRY_DB_URL}"
osSudo "${ELEMENTS_USER}" git config --global advice.detachedHead false
osSudo "${ELEMENTS_USER}" git clone "${LIQUIDTESTNET_ASSET_REGISTRY_DB_URL}" "${ELEMENTS_HOME}/${LIQUIDTESTNET_ASSET_REGISTRY_DB_NAME}"
echo "[*] Building Liquid Electrs release binary"
osSudo "${ELEMENTS_USER}" sh -c "cd ${ELEMENTS_ELECTRS_HOME} && cargo run --release --features liquid --bin electrs -- --network liquid --version" || true
case $OS in
FreeBSD)
echo "[*] Patching Liquid Electrs code for FreeBSD"
osSudo "${ELEMENTS_USER}" sh -c "cd \"${ELEMENTS_HOME}/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4\" && patch -p1 < \"${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/freebsd/sysconf.patch\""
osSudo "${ELEMENTS_USER}" sh -c "cd \"${ELEMENTS_HOME}/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysconf-0.3.4\" && patch -p1 < \"${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/freebsd/sysconf.patch\""
;;
Debian)
;;
esac
echo "[*] Building Liquid Electrs release binary"
osSudo "${ELEMENTS_USER}" sh -c "cd ${ELEMENTS_ELECTRS_HOME} && cargo run --release --features liquid --bin electrs -- --network liquid --version" || true
fi
#####################################
# Core Lightning for Bitcoin Mainnet #
#####################################
##############################
# Core Lightning for Bitcoin #
##############################
echo "[*] Installing Core Lightning"
case $OS in
@@ -1316,23 +1314,38 @@ case $OS in
osSudo "${ROOT_USER}" pw usermod ${MEMPOOL_USER} -G "${CLN_GROUP}"
osSudo "${ROOT_USER}" chsh -s `which zsh` "${CLN_USER}"
echo "export PATH=$PATH:$HOME/.local/bin" >> "${CLN_HOME}/.zshrc"
osSudo "${ROOT_USER}" mkdir -p "${CLN_HOME}/.lightning/{bitcoin,signet,testnet}"
osSudo "${ROOT_USER}" chmod 750 "${CLN_HOME}" "${CLN_HOME}/.lightning" "${CLN_HOME}/.lightning/{bitcoin,signet,testnet}"
osSudo "${ROOT_USER}" mkdir -p "${CLN_HOME}/.lightning/bitcoin"
osSudo "${ROOT_USER}" mkdir -p "${CLN_HOME}/.lightning/signet"
osSudo "${ROOT_USER}" mkdir -p "${CLN_HOME}/.lightning/testnet"
osSudo "${ROOT_USER}" chmod 750 "${CLN_HOME}" "${CLN_HOME}/.lightning"
osSudo "${ROOT_USER}" chmod 750 "${CLN_HOME}" "${CLN_HOME}/.lightning/bitcoin"
osSudo "${ROOT_USER}" chmod 750 "${CLN_HOME}" "${CLN_HOME}/.lightning/signet"
osSudo "${ROOT_USER}" chmod 750 "${CLN_HOME}" "${CLN_HOME}/.lightning/testnet"
osSudo "${ROOT_USER}" chown -R "${CLN_USER}:${CLN_GROUP}" "${CLN_HOME}"
echo "[*] Creating symlink to .bitcoin folder"
osSudo "${CLN_USER}" ln -s "${BITCOIN_HOME}/.bitcoin" "${CLN_HOME}/.bitcoin"
echo "[*] Installing Core Lightning package"
osPackageInstall ${CLN_PKG}
echo "[*] Installing Core Lightning mainnet Cronjob"
crontab_cln+='@reboot sleep 60 ; screen -dmS main lightningd --alias `hostname` --fee-base 0 --bitcoin-datadir /bitcoin\n'
crontab_cln+='@reboot sleep 90 ; screen -dmS tes lightningd --alias `hostname` --fee-base 0 --bitcoin-datadir /bitcoin --network testnet\n'
crontab_cln+='@reboot sleep 120 ; screen -dmS sig lightningd --alias `hostname` --fee-base 0 --bitcoin-datadir /bitcoin --network signet\n'
echo "${crontab_cln}" | crontab -u "${CLN_USER}" -
######## FIXME: this code doesn't work properly, needs fixing
#
# echo "[*] Installing Core Lightning mainnet Cronjob"
# public_ipv4=$( ifconfig | grep 'inet ' | awk -F ' ' '{ print $2 }' | grep -v '^103\.165\.192\.' | grep -v '^127\.0\.0\.1' )
# public_ipv6=$( ifconfig | grep 'inet6' | awk -F ' ' '{ print $2 }' | grep -v '^2001:df6:7280::' | grep -v '^fe80::' | grep -v '^::1' )
#
# crontab_cln+="@reboot sleep 10 ; screen -dmS main lightningd --rpc-file-mode 0660 --alias `hostname` --disable-ip-discovery --autolisten false --bind-addr $public_ipv4 --announce-addr $public_ipv4 --bind-addr $public_ipv6 --announce-addr $public_ipv6\n"
# crontab_cln+="@reboot sleep 10 ; screen -dmS tes lightningd --rpc-file-mode 0660 --alias `hostname` --network testnet --disable-ip-discovery --autolisten false --bind-addr $public_ipv4 --announce-addr $public_ipv4 --bind-addr $public_ipv6 --announce-addr $public_ipv6\n"
# crontab_cln+="@reboot sleep 10 ; screen -dmS sig lightningd --rpc-file-mode 0660 --alias `hostname` --network signet --disable-ip-discovery --autolisten false --bind-addr $public_ipv4 --announce-addr $public_ipv4 --bind-addr $public_ipv6 --announce-addr $public_ipv6 \n"
# crontab_cln+="@reboot sleep 20 ; /mempool/mempool.space/lightning-seeder >/dev/null 2>&1\n"
# crontab_cln+="1 * * * * /mempool/mempool.space/lightning-seeder >/dev/null 2>&1\n"
# echo "${crontab_cln}" | crontab -u "${CLN_USER}" -
;;
Debian)
;;
esac
#####################
# Bisq installation #
#####################
@@ -1420,16 +1433,6 @@ fi
if [ "${UNFURL_INSTALL}" = ON ];then
echo "[*] Creating Unfurl user"
osGroupCreate "${UNFURL_GROUP}"
osUserCreate "${UNFURL_USER}" "${UNFURL_HOME}" "${UNFURL_GROUP}"
osSudo "${ROOT_USER}" chsh -s `which zsh` "${UNFURL_USER}"
echo "[*] Creating Unfurl folder"
osSudo "${ROOT_USER}" mkdir -p "${UNFURL_HOME}"
osSudo "${ROOT_USER}" chown -R "${UNFURL_USER}:${UNFURL_GROUP}" "${UNFURL_HOME}"
osSudo "${UNFURL_USER}" touch "${UNFURL_HOME}/.zshrc"
echo "[*] Insalling Unfurl source"
case $OS in
@@ -1445,7 +1448,7 @@ if [ "${UNFURL_INSTALL}" = ON ];then
echo "[*] Installing color emoji"
osSudo "${ROOT_USER}" curl "https://github.com/samuelngs/apple-emoji-linux/releases/download/ios-15.4/AppleColorEmoji.ttf" -o /usr/local/share/fonts/TTF/AppleColorEmoji.ttf
cat >> /usr/local/etc/fonts/conf.d/01-emoji.conf <<EOF
cat > /usr/local/etc/fonts/conf.d/01-emoji.conf <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
@@ -1520,7 +1523,6 @@ if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
case $OS in
FreeBSD)
echo "[*] FIXME: Bitcoin Minfee service must be installed manually on FreeBSD"
;;
Debian)
@@ -1538,7 +1540,6 @@ if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
case $OS in
FreeBSD)
echo "[*] FIXME: Bitcoin Testnet service must be installed manually on FreeBSD"
;;
Debian)
@@ -1556,7 +1557,6 @@ if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
case $OS in
FreeBSD)
echo "[*] FIXME: Bitcoin Signet service must be installed manually on FreeBSD"
;;
Debian)
@@ -1574,7 +1574,6 @@ if [ "${ELEMENTS_LIQUID_ENABLE}" = ON ];then
case $OS in
FreeBSD)
echo "[*] FIXME: Bitcoin Liquid service must be installed manually on FreeBSD"
;;
Debian)
@@ -1592,7 +1591,6 @@ if [ "${ELEMENTS_LIQUID_ENABLE}" = ON ];then
case $OS in
FreeBSD)
echo "[*] FIXME: Bitcoin Liquid service must be installed manually on FreeBSD"
;;
Debian)
@@ -1604,15 +1602,8 @@ fi
########################################
# Electrs instance for Bitcoin Mainnet #
########################################
if [ "${BITCOIN_MAINNET_ENABLE}" = ON ];then
echo "[*] Installing Bitcoin Mainnet electrs start script"
osSudo "${ROOT_USER}" install -c -o "${BITCOIN_USER}" -g "${BITCOIN_GROUP}" -m 755 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/electrs-start-mainnet" "${BITCOIN_ELECTRS_HOME}"
echo "[*] Configuring Bitcoin Mainnet RPC credentials in electrs start script"
osSudo "${ROOT_USER}" sed -i.orig "s/__BITCOIN_RPC_USER__/${BITCOIN_RPC_USER}/" "${BITCOIN_ELECTRS_HOME}/electrs-start-mainnet"
osSudo "${ROOT_USER}" sed -i.orig "s/__BITCOIN_RPC_PASS__/${BITCOIN_RPC_PASS}/" "${BITCOIN_ELECTRS_HOME}/electrs-start-mainnet"
osSudo "${ROOT_USER}" sed -i.orig "s!__ELECTRS_DATA_ROOT__!${ELECTRS_DATA_ROOT}!" "${BITCOIN_ELECTRS_HOME}/electrs-start-mainnet"
echo "[*] FIXME: must only crontab enabled daemons"
fi
########################################
@@ -1620,13 +1611,7 @@ fi
########################################
if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
echo "[*] Installing Bitcoin Testnet electrs start script"
osSudo "${ROOT_USER}" install -c -o "${BITCOIN_USER}" -g "${BITCOIN_GROUP}" -m 755 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/electrs-start-testnet" "${BITCOIN_ELECTRS_HOME}"
echo "[*] Configuring Bitcoin Testnet RPC credentials in electrs start script"
osSudo "${ROOT_USER}" sed -i.orig "s/__BITCOIN_RPC_USER__/${BITCOIN_RPC_USER}/" "${BITCOIN_ELECTRS_HOME}/electrs-start-testnet"
osSudo "${ROOT_USER}" sed -i.orig "s/__BITCOIN_RPC_PASS__/${BITCOIN_RPC_PASS}/" "${BITCOIN_ELECTRS_HOME}/electrs-start-testnet"
osSudo "${ROOT_USER}" sed -i.orig "s!__ELECTRS_DATA_ROOT__!${ELECTRS_DATA_ROOT}!" "${BITCOIN_ELECTRS_HOME}/electrs-start-testnet"
echo "[*] FIXME: must only crontab enabled daemons"
fi
#######################################
@@ -1634,13 +1619,7 @@ fi
#######################################
if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
echo "[*] Installing Bitcoin Signet electrs start script"
osSudo "${ROOT_USER}" install -c -o "${BITCOIN_USER}" -g "${BITCOIN_GROUP}" -m 755 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/electrs-start-signet" "${BITCOIN_ELECTRS_HOME}"
echo "[*] Configuring Bitcoin Signet RPC credentials in electrs start script"
osSudo "${ROOT_USER}" sed -i.orig "s/__BITCOIN_RPC_USER__/${BITCOIN_RPC_USER}/" "${BITCOIN_ELECTRS_HOME}/electrs-start-signet"
osSudo "${ROOT_USER}" sed -i.orig "s/__BITCOIN_RPC_PASS__/${BITCOIN_RPC_PASS}/" "${BITCOIN_ELECTRS_HOME}/electrs-start-signet"
osSudo "${ROOT_USER}" sed -i.orig "s!__ELECTRS_DATA_ROOT__!${ELECTRS_DATA_ROOT}!" "${BITCOIN_ELECTRS_HOME}/electrs-start-signet"
echo "[*] FIXME: must only crontab enabled daemons"
fi
########################################
@@ -1648,21 +1627,12 @@ fi
########################################
if [ "${ELEMENTS_LIQUID_ENABLE}" = ON ];then
echo "[*] Installing Elements Liquid electrs start script"
osSudo "${ROOT_USER}" install -c -o "${ELEMENTS_USER}" -g "${ELEMENTS_GROUP}" -m 755 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/electrs-start-liquid" "${ELEMENTS_ELECTRS_HOME}"
echo "[*] Installing Elements crontab"
case $OS in
FreeBSD)
echo "[*] FIXME: must only crontab enabled daemons"
osSudo "${ROOT_USER}" crontab -u "${ELEMENTS_USER}" "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/elements.crontab"
;;
esac
echo "[*] Configuring Elements Liquid RPC credentials in electrs start script"
osSudo "${ROOT_USER}" sed -i.orig "s/__ELEMENTS_RPC_USER__/${ELEMENTS_RPC_USER}/" "${ELEMENTS_ELECTRS_HOME}/electrs-start-liquid"
osSudo "${ROOT_USER}" sed -i.orig "s/__ELEMENTS_RPC_PASS__/${ELEMENTS_RPC_PASS}/" "${ELEMENTS_ELECTRS_HOME}/electrs-start-liquid"
osSudo "${ROOT_USER}" sed -i.orig "s!__ELECTRS_DATA_ROOT__!${ELECTRS_DATA_ROOT}!" "${ELEMENTS_ELECTRS_HOME}/electrs-start-liquid"
fi
################################################
@@ -1670,19 +1640,11 @@ fi
################################################
if [ "${ELEMENTS_LIQUIDTESTNET_ENABLE}" = ON ];then
echo "[*] Installing Elements Liquid Testnet electrs start script"
osSudo "${ROOT_USER}" install -c -o "${ELEMENTS_USER}" -g "${ELEMENTS_GROUP}" -m 755 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/electrs-start-liquidtestnet" "${ELEMENTS_ELECTRS_HOME}"
echo "[*] Installing Elements Liquid Testnet RPC credentials"
osSudo "${ROOT_USER}" sed -i.orig "s/__BITCOIN_RPC_USER__/${BITCOIN_RPC_USER}/" "${ELEMENTS_HOME}/elements.conf"
osSudo "${ROOT_USER}" sed -i.orig "s/__BITCOIN_RPC_PASS__/${BITCOIN_RPC_PASS}/" "${ELEMENTS_HOME}/elements.conf"
osSudo "${ROOT_USER}" sed -i.orig "s/__ELEMENTS_RPC_USER__/${ELEMENTS_RPC_USER}/" "${ELEMENTS_HOME}/elements.conf"
osSudo "${ROOT_USER}" sed -i.orig "s/__ELEMENTS_RPC_PASS__/${ELEMENTS_RPC_PASS}/" "${ELEMENTS_HOME}/elements.conf"
echo "[*] Configuring Elements LiquidTestnet RPC credentials in electrs start script"
osSudo "${ROOT_USER}" sed -i.orig "s/__ELEMENTS_RPC_USER__/${ELEMENTS_RPC_USER}/" "${ELEMENTS_ELECTRS_HOME}/electrs-start-liquidtestnet"
osSudo "${ROOT_USER}" sed -i.orig "s/__ELEMENTS_RPC_PASS__/${ELEMENTS_RPC_PASS}/" "${ELEMENTS_ELECTRS_HOME}/electrs-start-liquidtestnet"
osSudo "${ROOT_USER}" sed -i.orig "s!__ELECTRS_DATA_ROOT__!${ELECTRS_DATA_ROOT}!" "${ELEMENTS_ELECTRS_HOME}/electrs-start-liquidtestnet"
fi
################################
@@ -1691,7 +1653,6 @@ fi
echo "[*] Installing crontabs"
case $OS in
FreeBSD)
echo "[*] FIXME: must only crontab enabled daemons"
osSudo "${ROOT_USER}" crontab -u "${BITCOIN_USER}" "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/bitcoin.crontab"
osSudo "${ROOT_USER}" crontab -u "${MINFEE_USER}" "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/minfee.crontab"
;;
@@ -1746,7 +1707,7 @@ if [ "${BITCOIN_MAINNET_ENABLE}" = ON -o "${BITCOIN_TESTNET_ENABLE}" = ON -o "${
osSudo "${MEMPOOL_USER}" sh -c "cd ${MEMPOOL_HOME}/mainnet && git checkout ${MEMPOOL_LATEST_RELEASE}"
fi
if [ "${LN_BITCOIN_MAINNET_ENABLE}" = ON ];then
if [ "${BITCOIN_MAINNET_LIGHTNING_ENABLE}" = ON ];then
echo "[*] Creating Mempool instance for Lightning Network on Bitcoin Mainnet"
osSudo "${MEMPOOL_USER}" git config --global advice.detachedHead false
osSudo "${MEMPOOL_USER}" git clone --branch "${MEMPOOL_REPO_BRANCH}" "${MEMPOOL_REPO_URL}" "${MEMPOOL_HOME}/mainnet-lightning"
@@ -1764,7 +1725,7 @@ if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
osSudo "${MEMPOOL_USER}" sh -c "cd ${MEMPOOL_HOME}/testnet && git checkout ${MEMPOOL_LATEST_RELEASE}"
fi
if [ "${LN_BITCOIN_TESTNET_ENABLE}" = ON ];then
if [ "${BITCOIN_TESTNET_LIGHTNING_ENABLE}" = ON ];then
echo "[*] Creating Mempool instance for Lightning Network on Bitcoin Testnet"
osSudo "${MEMPOOL_USER}" git config --global advice.detachedHead false
osSudo "${MEMPOOL_USER}" git clone --branch "${MEMPOOL_REPO_BRANCH}" "${MEMPOOL_REPO_URL}" "${MEMPOOL_HOME}/testnet-lightning"
@@ -1782,7 +1743,7 @@ if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
osSudo "${MEMPOOL_USER}" sh -c "cd ${MEMPOOL_HOME}/signet && git checkout ${MEMPOOL_LATEST_RELEASE}"
fi
if [ "${LN_BITCOIN_SIGNET_ENABLE}" = ON ];then
if [ "${BITCOIN_SIGNET_LIGHTNING_ENABLE}" = ON ];then
echo "[*] Creating Mempool instance for Lightning Network on Bitcoin Signet"
osSudo "${MEMPOOL_USER}" git config --global advice.detachedHead false
osSudo "${MEMPOOL_USER}" git clone --branch "${MEMPOOL_REPO_BRANCH}" "${MEMPOOL_REPO_URL}" "${MEMPOOL_HOME}/signet-lightning"
@@ -1824,13 +1785,16 @@ echo "[*] Adding MySQL configuration"
case $OS in
FreeBSD)
osSudo "${ROOT_USER}" service mysql-server start
osSudo "${ROOT_USER}" service mysql-server onestart
;;
Debian)
osSudo "${ROOT_USER}" service mysql start
;;
esac
# wait for mysql to start
sleep 10
mysql << _EOF_
create database mempool;
grant all on mempool.* to '${MEMPOOL_MAINNET_USER}'@'localhost' identified by '${MEMPOOL_MAINNET_PASS}';
@@ -1842,13 +1806,13 @@ create database mempool_signet;
grant all on mempool_signet.* to '${MEMPOOL_SIGNET_USER}'@'localhost' identified by '${MEMPOOL_SIGNET_PASS}';
create database mempool_mainnet_lightning;
grant all on mempool_mainnet_lightning.* to '${LN_MEMPOOL_MAINNET_USER}'@'%' identified by '${LN_MEMPOOL_MAINNET_PASS}';
grant all on mempool_mainnet_lightning.* to '${MEMPOOL_MAINNET_LIGHTNING_USER}'@'localhost' identified by '${MEMPOOL_MAINNET_LIGHTNING_PASS}';
create database mempool_testnet_lightning;
grant all on mempool_testnet_lightning.* to '${LN_MEMPOOL_TESTNET_USER}'@'%' identified by '${LN_MEMPOOL_TESTNET_PASS}';
grant all on mempool_testnet_lightning.* to '${MEMPOOL_TESTNET_LIGHTNING_USER}'@'localhost' identified by '${MEMPOOL_TESTNET_LIGHTNING_PASS}';
create database mempool_signet_lightning;
grant all on mempool_signet_lightning.* to '${LN_MEMPOOL_SIGNET_USER}'@'%' identified by '${LN_MEMPOOL_SIGNET_PASS}';
grant all on mempool_signet_lightning.* to '${MEMPOOL_SIGNET_LIGHTNING_USER}'@'localhost' identified by '${MEMPOOL_SIGNET_LIGHTNING_PASS}';
create database mempool_liquid;
grant all on mempool_liquid.* to '${MEMPOOL_LIQUID_USER}'@'localhost' identified by '${MEMPOOL_LIQUID_PASS}';
@@ -1861,19 +1825,19 @@ grant all on mempool_bisq.* to '${MEMPOOL_BISQ_USER}'@'localhost' identified by
_EOF_
echo "[*] save MySQL credentials"
cat > ${MEMPOOL_HOME}/mysql_credentials << _EOF_
cat > "${MEMPOOL_MYSQL_CREDENTIALS}" << _EOF_
declare -x MEMPOOL_MAINNET_USER="${MEMPOOL_MAINNET_USER}"
declare -x MEMPOOL_MAINNET_PASS="${MEMPOOL_MAINNET_PASS}"
declare -x MEMPOOL_TESTNET_USER="${MEMPOOL_TESTNET_USER}"
declare -x MEMPOOL_TESTNET_PASS="${MEMPOOL_TESTNET_PASS}"
declare -x MEMPOOL_SIGNET_USER="${MEMPOOL_SIGNET_USER}"
declare -x MEMPOOL_SIGNET_PASS="${MEMPOOL_SIGNET_PASS}"
declare -x LN_MEMPOOL_MAINNET_USER="${LN_MEMPOOL_MAINNET_USER}"
declare -x LN_MEMPOOL_MAINNET_PASS="${LN_MEMPOOL_MAINNET_PASS}"
declare -x LN_MEMPOOL_TESTNET_USER="${LN_MEMPOOL_TESTNET_USER}"
declare -x LN_MEMPOOL_TESTNET_PASS="${LN_MEMPOOL_TESTNET_PASS}"
declare -x LN_MEMPOOL_SIGNET_USER="${LN_MEMPOOL_SIGNET_USER}"
declare -x LN_MEMPOOL_SIGNET_PASS="${LN_MEMPOOL_SIGNET_PASS}"
declare -x MEMPOOL_MAINNET_LIGHTNING_USER="${MEMPOOL_MAINNET_LIGHTNING_USER}"
declare -x MEMPOOL_MAINNET_LIGHTNING_PASS="${MEMPOOL_MAINNET_LIGHTNING_PASS}"
declare -x MEMPOOL_TESTNET_LIGHTNING_USER="${MEMPOOL_TESTNET_LIGHTNING_USER}"
declare -x MEMPOOL_TESTNET_LIGHTNING_PASS="${MEMPOOL_TESTNET_LIGHTNING_PASS}"
declare -x MEMPOOL_SIGNET_LIGHTNING_USER="${MEMPOOL_SIGNET_LIGHTNING_USER}"
declare -x MEMPOOL_SIGNET_LIGHTNING_PASS="${MEMPOOL_SIGNET_LIGHTNING_PASS}"
declare -x MEMPOOL_LIQUID_USER="${MEMPOOL_LIQUID_USER}"
declare -x MEMPOOL_LIQUID_PASS="${MEMPOOL_LIQUID_PASS}"
declare -x MEMPOOL_LIQUIDTESTNET_USER="${MEMPOOL_LIQUIDTESTNET_USER}"
@@ -1881,42 +1845,75 @@ declare -x MEMPOOL_LIQUIDTESTNET_PASS="${MEMPOOL_LIQUIDTESTNET_PASS}"
declare -x MEMPOOL_BISQ_USER="${MEMPOOL_BISQ_USER}"
declare -x MEMPOOL_BISQ_PASS="${MEMPOOL_BISQ_PASS}"
_EOF_
chown "${MEMPOOL_USER}:${MEMPOOL_GROUP}" "${MEMPOOL_MYSQL_CREDENTIALS}"
##### nginx
echo "[*] Adding Nginx configuration"
osSudo "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/nginx/nginx.conf" "${NGINX_CONFIGURATION}"
ln -s "${MEMPOOL_HOME}/mempool" "${NGINX_ETC_FOLDER}/mempool"
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_USER__!${NGINX_USER}!" "${NGINX_CONFIGURATION}"
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_ETC_FOLDER__!${NGINX_ETC_FOLDER}!" "${NGINX_CONFIGURATION}"
#if [ "${TOR_INSTALL}" = ON ];then
# echo "[*] Read tor v3 onion hostnames"
#
# NGINX_MEMPOOL_ONION=$(cat "${TOR_RESOURCES}/mempool/hostname")
# osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_MEMPOOL_ONION__!${NGINX_MEMPOOL_ONION%.onion}!" "${NGINX_CONFIGURATION}"
#
# if [ "${ELEMENTS_LIQUID_ENABLE}" = "ON" ];then
# NGINX_LIQUID_ONION=$(cat "${TOR_RESOURCES}/liquid/hostname")
# osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_LIQUID_ONION__!${NGINX_LIQUID_ONIONi%.onion}!" "${NGINX_CONFIGURATION}"
# fi
#
# if [ "${BISQ_MAINNET_ENABLE}" = "ON" ];then
# NGINX_BISQ_ONION=$(cat "${TOR_RESOURCES}/bisq/hostname")
# osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_BISQ_ONION__!${NGINX_BISQ_ONION%.onion}!" "${NGINX_CONFIGURATION}"
# fi
#fi
##### OS systemd
echo "[*] Setting permissions for electrs sockets"
case $OS in
FreeBSD)
setfacl -m "user:bitcoin:full_set:f:allow,user:mempool:full_set:f:allow,user:www:full_set:f:allow,everyone@::f:allow" "${BITCOIN_HOME}/socket"
chown "${BITCOIN_USER}:${BITCOIN_GROUP}" "${BITCOIN_HOME}/socket"
setfacl -m "user:elements:full_set:f:allow,user:mempool:full_set:f:allow,user:www:full_set:f:allow,everyone@::f:allow" "${ELEMENTS_HOME}/socket"
chown "${ELEMENTS_USER}:${ELEMENTS_GROUP}" "${ELEMENTS_HOME}/socket"
;;
Debian)
echo "[*] Adding Nginx configuration"
osSudo "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/nginx/nginx.conf" "${NGINX_CONFIGURATION}"
mkdir -p /var/cache/nginx/services /var/cache/nginx/api
chown ${NGINX_USER}: /var/cache/nginx/services /var/cache/nginx/api
ln -s /mempool/mempool /etc/nginx/mempool
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_USER__!${NGINX_USER}!" "${NGINX_CONFIGURATION}"
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_ETC_FOLDER__!${NGINX_ETC_FOLDER}!" "${NGINX_CONFIGURATION}"
if [ "${TOR_INSTALL}" = ON ];then
echo "[*] Read tor v3 onion hostnames"
NGINX_MEMPOOL_ONION=$(cat "${TOR_RESOURCES}/mempool/hostname")
NGINX_BISQ_ONION=$(cat "${TOR_RESOURCES}/bisq/hostname")
NGINX_LIQUID_ONION=$(cat "${TOR_RESOURCES}/liquid/hostname")
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_MEMPOOL_ONION__!${NGINX_MEMPOOL_ONION%.onion}!" "${NGINX_CONFIGURATION}"
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_BISQ_ONION__!${NGINX_BISQ_ONION%.onion}!" "${NGINX_CONFIGURATION}"
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_LIQUID_ONION__!${NGINX_LIQUID_ONIONi%.onion}!" "${NGINX_CONFIGURATION}"
fi
echo "[*] Restarting Nginx"
osSudo "${ROOT_USER}" service nginx restart
Debian)
;;
esac
##### OS systemd
echo "[*] Updating systemd daemon configuration"
echo "[*] Updating system startup configuration"
case $OS in
FreeBSD)
cat >> /etc/rc.conf <<EOF
moused_nondefault_enable="NO"
nginx_enable="YES"
nginx_profiles="mempool"
nginx_mempool_flags="-p /mempool"
nginx_mempool_configfile="/mempool/mempool/nginx/nginx.conf"
mysql_enable="YES"
mysql_dbdir="/mysql"
mysql_args="--innodb-buffer-pool-size=8G --bind-address 127.0.0.1"
kld_list="nvidia"
nvidia_xorg_enable="YES"
dbus_enable="YES"
tor_enable="YES"
bitcoin_enable="YES"
postfix_enable="YES"
EOF
;;
Debian)
@@ -1948,6 +1945,9 @@ case $OS in
;;
esac
echo "[*] Restarting Nginx"
osSudo "${ROOT_USER}" service nginx restart
##### OS set Linux user ulimits
echo "[*] Setting ulimits for users"
@@ -2049,20 +2049,12 @@ osSudo "${MEMPOOL_USER}" sh -c "cd ${MEMPOOL_HOME} && ./upgrade" || true
##### finish
case $OS in
FreeBSD)
;;
Debian)
if [ "${TOR_INSTALL}" = ON ];then
echo "This are the generated Tor addresses:"
echo "${NGINX_MEMPOOL_ONION}"
echo "${NGINX_BISQ_ONION}"
echo "${NGINX_LIQUID_ONION}"
fi
;;
esac
#if [ "${TOR_INSTALL}" = ON ];then
# echo "Your auto-generated Tor addresses are:"
# echo "${NGINX_MEMPOOL_ONION}"
# echo "${NGINX_BISQ_ONION}"
# echo "${NGINX_LIQUID_ONION}"
#fi
echo
echo 'Please reboot to start all the services.'

View File

@@ -12,7 +12,7 @@ ELEMENTS_RPC_USER=$(grep '^rpcuser' /elements/elements.conf | cut -d '=' -f2)
ELEMENTS_RPC_PASS=$(grep '^rpcpassword' /elements/elements.conf | cut -d '=' -f2)
# get mysql credentials
MYSQL_CRED_FILE=${HOME}/mempool/mysql_credentials
MYSQL_CRED_FILE=${HOME}/.mysql_credentials
if [ -f "${MYSQL_CRED_FILE}" ];then
. ${MYSQL_CRED_FILE}
fi
@@ -38,7 +38,7 @@ update_repo()
cd "$HOME/${site}" || exit 1
git fetch origin || exit 1
for remote in origin hunicus mononaut;do
for remote in origin;do
git remote add "${remote}" "https://github.com/${remote}/mempool" >/dev/null 2>&1
git fetch "${remote}" || exit 1
done
@@ -98,15 +98,15 @@ build_backend()
-e "s!__MEMPOOL_TESTNET_PASS__!${MEMPOOL_TESTNET_PASS}!" \
-e "s!__MEMPOOL_SIGNET_USER__!${MEMPOOL_SIGNET_USER}!" \
-e "s!__MEMPOOL_SIGNET_PASS__!${MEMPOOL_SIGNET_PASS}!" \
-e "s!__LN_MEMPOOL_MAINNET_USER__!${LN_MEMPOOL_MAINNET_USER}!" \
-e "s!__LN_MEMPOOL_MAINNET_PASS__!${LN_MEMPOOL_MAINNET_PASS}!" \
-e "s!__LN_MEMPOOL_TESTNET_USER__!${LN_MEMPOOL_TESTNET_USER}!" \
-e "s!__LN_MEMPOOL_TESTNET_PASS__!${LN_MEMPOOL_TESTNET_PASS}!" \
-e "s!__LN_MEMPOOL_SIGNET_USER__!${LN_MEMPOOL_SIGNET_USER}!" \
-e "s!__LN_MEMPOOL_SIGNET_PASS__!${LN_MEMPOOL_SIGNET_PASS}!" \
-e "s!__MEMPOOL_MAINNET_LIGHTNING_USER__!${MEMPOOL_MAINNET_LIGHTNING_USER}!" \
-e "s!__MEMPOOL_MAINNET_LIGHTNING_PASS__!${MEMPOOL_MAINNET_LIGHTNING_PASS}!" \
-e "s!__MEMPOOL_TESTNET_LIGHTNING_USER__!${MEMPOOL_TESTNET_LIGHTNING_USER}!" \
-e "s!__MEMPOOL_TESTNET_LIGHTNING_PASS__!${MEMPOOL_TESTNET_LIGHTNING_PASS}!" \
-e "s!__MEMPOOL_SIGNET_LIGHTNING_USER__!${MEMPOOL_SIGNET_LIGHTNING_USER}!" \
-e "s!__MEMPOOL_SIGNET_LIGHTNING_PASS__!${MEMPOOL_SIGNET_LIGHTNING_PASS}!" \
-e "s!__MEMPOOL_LIQUID_USER__!${MEMPOOL_LIQUID_USER}!" \
-e "s!__MEMPOOL_LIQUID_PASS__!${MEMPOOL_LIQUID_PASS}!" \
-e "s!__MEMPOOL_LIQUIDTESTNET_USER__!${LIQUIDTESTNET_USER}!" \
-e "s!__MEMPOOL_LIQUIDTESTNET_USER__!${MEMPOOL_LIQUIDTESTNET_USER}!" \
-e "s!__MEMPOOL_LIQUIDTESTNET_PASS__!${MEMPOOL_LIQUIDTESTNET_PASS}!" \
-e "s!__MEMPOOL_BISQ_USER__!${MEMPOOL_BISQ_USER}!" \
-e "s!__MEMPOOL_BISQ_PASS__!${MEMPOOL_BISQ_PASS}!" \

View File

@@ -15,12 +15,13 @@
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4000"
"REST_API_URL": "http://127.0.0.1:5000",
"UNIX_SOCKET_PATH": "/bitcoin/socket/esplora-bitcoin-mainnet"
},
"DATABASE": {
"ENABLED": false,
"HOST": "127.0.0.1",
"PORT": 3306,
"SOCKET": "/var/run/mysql/mysql.sock",
"USERNAME": "__MEMPOOL_BISQ_USER__",
"PASSWORD": "__MEMPOOL_BISQ_PASS__",
"DATABASE": "mempool_bisq"

View File

@@ -6,7 +6,8 @@
"MINED_BLOCKS_CACHE": 144,
"SPAWN_CLUSTER_PROCS": 0,
"API_URL_PREFIX": "/api/v1/",
"POLL_RATE_MS": 1000
"POLL_RATE_MS": 1000,
"DISK_CACHE_BLOCK_INTERVAL": 1
},
"SYSLOG" : {
"MIN_PRIORITY": "debug"
@@ -22,12 +23,38 @@
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4001"
"UNIX_SOCKET_PATH": "/elements/socket/esplora-liquid-mainnet",
"FALLBACK": [
"http://node201.va1.mempool.space:3001",
"http://node202.va1.mempool.space:3001",
"http://node203.va1.mempool.space:3001",
"http://node204.va1.mempool.space:3001",
"http://node205.va1.mempool.space:3001",
"http://node206.va1.mempool.space:3001",
"http://node201.fmt.mempool.space:3001",
"http://node202.fmt.mempool.space:3001",
"http://node203.fmt.mempool.space:3001",
"http://node204.fmt.mempool.space:3001",
"http://node205.fmt.mempool.space:3001",
"http://node206.fmt.mempool.space:3001",
"http://node201.fra.mempool.space:3001",
"http://node202.fra.mempool.space:3001",
"http://node203.fra.mempool.space:3001",
"http://node204.fra.mempool.space:3001",
"http://node205.fra.mempool.space:3001",
"http://node206.fra.mempool.space:3001",
"http://node201.tk7.mempool.space:3001",
"http://node202.tk7.mempool.space:3001",
"http://node203.tk7.mempool.space:3001",
"http://node204.tk7.mempool.space:3001",
"http://node205.tk7.mempool.space:3001",
"http://node206.tk7.mempool.space:3001"
]
},
"DATABASE": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"SOCKET": "/var/run/mysql/mysql.sock",
"USERNAME": "__MEMPOOL_LIQUID_USER__",
"PASSWORD": "__MEMPOOL_LIQUID_PASS__",
"DATABASE": "mempool_liquid"

View File

@@ -6,7 +6,8 @@
"MINED_BLOCKS_CACHE": 144,
"SPAWN_CLUSTER_PROCS": 0,
"API_URL_PREFIX": "/api/v1/",
"POLL_RATE_MS": 1000
"POLL_RATE_MS": 1000,
"DISK_CACHE_BLOCK_INTERVAL": 1
},
"SYSLOG" : {
"MIN_PRIORITY": "debug"
@@ -22,12 +23,38 @@
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4004"
"UNIX_SOCKET_PATH": "/elements/socket/esplora-liquid-testnet",
"FALLBACK": [
"http://node201.va1.mempool.space:3004",
"http://node202.va1.mempool.space:3004",
"http://node203.va1.mempool.space:3004",
"http://node204.va1.mempool.space:3004",
"http://node205.va1.mempool.space:3004",
"http://node206.va1.mempool.space:3004",
"http://node201.fmt.mempool.space:3004",
"http://node202.fmt.mempool.space:3004",
"http://node203.fmt.mempool.space:3004",
"http://node204.fmt.mempool.space:3004",
"http://node205.fmt.mempool.space:3004",
"http://node206.fmt.mempool.space:3004",
"http://node201.fra.mempool.space:3004",
"http://node202.fra.mempool.space:3004",
"http://node203.fra.mempool.space:3004",
"http://node204.fra.mempool.space:3004",
"http://node205.fra.mempool.space:3004",
"http://node206.fra.mempool.space:3004",
"http://node201.tk7.mempool.space:3004",
"http://node202.tk7.mempool.space:3004",
"http://node203.tk7.mempool.space:3004",
"http://node204.tk7.mempool.space:3004",
"http://node205.tk7.mempool.space:3004",
"http://node206.tk7.mempool.space:3004"
]
},
"DATABASE": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"SOCKET": "/var/run/mysql/mysql.sock",
"USERNAME": "__MEMPOOL_LIQUIDTESTNET_USER__",
"PASSWORD": "__MEMPOOL_LIQUIDTESTNET_PASS__",
"DATABASE": "mempool_liquidtestnet"

View File

@@ -1,5 +1,6 @@
{
"MEMPOOL": {
"ENABLED": false,
"NETWORK": "mainnet",
"BACKEND": "esplora",
"HTTP_PORT": 8993,
@@ -15,7 +16,33 @@
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4000"
"UNIX_SOCKET_PATH": "/bitcoin/socket/esplora-bitcoin-mainnet",
"FALLBACK": [
"http://node201.va1.mempool.space:3000",
"http://node202.va1.mempool.space:3000",
"http://node203.va1.mempool.space:3000",
"http://node204.va1.mempool.space:3000",
"http://node205.va1.mempool.space:3000",
"http://node206.va1.mempool.space:3000",
"http://node201.fmt.mempool.space:3000",
"http://node202.fmt.mempool.space:3000",
"http://node203.fmt.mempool.space:3000",
"http://node204.fmt.mempool.space:3000",
"http://node205.fmt.mempool.space:3000",
"http://node206.fmt.mempool.space:3000",
"http://node201.fra.mempool.space:3000",
"http://node202.fra.mempool.space:3000",
"http://node203.fra.mempool.space:3000",
"http://node204.fra.mempool.space:3000",
"http://node205.fra.mempool.space:3000",
"http://node206.fra.mempool.space:3000",
"http://node201.tk7.mempool.space:3000",
"http://node202.tk7.mempool.space:3000",
"http://node203.tk7.mempool.space:3000",
"http://node204.tk7.mempool.space:3000",
"http://node205.tk7.mempool.space:3000",
"http://node206.tk7.mempool.space:3000"
]
},
"LIGHTNING": {
"ENABLED": true,
@@ -41,9 +68,9 @@
"DATABASE": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"DATABASE": "mempool_mainnet_lightning",
"USERNAME": "mempool_mainnet_lightning",
"PASSWORD": "mempool_mainnet_lightning"
"SOCKET": "/var/run/mysql/mysql.sock",
"USERNAME": "__MEMPOOL_MAINNET_LIGHTNING_USER__",
"PASSWORD": "__MEMPOOL_MAINNET_LIGHTNING_PASS__",
"DATABASE": "mempool_mainnet_lightning"
}
}

View File

@@ -10,7 +10,16 @@
"POLL_RATE_MS": 1000,
"INDEXING_BLOCKS_AMOUNT": -1,
"BLOCKS_SUMMARIES_INDEXING": true,
"USE_SECOND_NODE_FOR_MINFEE": true
"AUDIT": true,
"CPFP_INDEXING": true,
"ADVANCED_GBT_AUDIT": true,
"ADVANCED_GBT_MEMPOOL": true,
"RUST_GBT": true,
"USE_SECOND_NODE_FOR_MINFEE": true,
"DISK_CACHE_BLOCK_INTERVAL": 1,
"MAX_PUSH_TX_SIZE_WEIGHT": 4000000,
"ALLOW_UNREACHABLE": true,
"PRICE_UPDATES_PER_HOUR": 12
},
"SYSLOG" : {
"MIN_PRIORITY": "debug"
@@ -26,12 +35,38 @@
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4000"
"UNIX_SOCKET_PATH": "/bitcoin/socket/esplora-bitcoin-mainnet",
"FALLBACK": [
"http://node201.va1.mempool.space:3000",
"http://node202.va1.mempool.space:3000",
"http://node203.va1.mempool.space:3000",
"http://node204.va1.mempool.space:3000",
"http://node205.va1.mempool.space:3000",
"http://node206.va1.mempool.space:3000",
"http://node201.fmt.mempool.space:3000",
"http://node202.fmt.mempool.space:3000",
"http://node203.fmt.mempool.space:3000",
"http://node204.fmt.mempool.space:3000",
"http://node205.fmt.mempool.space:3000",
"http://node206.fmt.mempool.space:3000",
"http://node201.fra.mempool.space:3000",
"http://node202.fra.mempool.space:3000",
"http://node203.fra.mempool.space:3000",
"http://node204.fra.mempool.space:3000",
"http://node205.fra.mempool.space:3000",
"http://node206.fra.mempool.space:3000",
"http://node201.tk7.mempool.space:3000",
"http://node202.tk7.mempool.space:3000",
"http://node203.tk7.mempool.space:3000",
"http://node204.tk7.mempool.space:3000",
"http://node205.tk7.mempool.space:3000",
"http://node206.tk7.mempool.space:3000"
]
},
"DATABASE": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"SOCKET": "/var/run/mysql/mysql.sock",
"USERNAME": "__MEMPOOL_MAINNET_USER__",
"PASSWORD": "__MEMPOOL_MAINNET_PASS__",
"DATABASE": "mempool"
@@ -39,5 +74,36 @@
"STATISTICS": {
"ENABLED": true,
"TX_PER_SECOND_SAMPLE_PERIOD": 150
},
"REPLICATION": {
"ENABLED": true,
"AUDIT": true,
"AUDIT_START_HEIGHT": 774000,
"SERVERS": [
"node201.va1.mempool.space",
"node202.va1.mempool.space",
"node203.va1.mempool.space",
"node204.va1.mempool.space",
"node205.va1.mempool.space",
"node206.va1.mempool.space",
"node201.fmt.mempool.space",
"node202.fmt.mempool.space",
"node203.fmt.mempool.space",
"node204.fmt.mempool.space",
"node205.fmt.mempool.space",
"node206.fmt.mempool.space",
"node201.fra.mempool.space",
"node202.fra.mempool.space",
"node203.fra.mempool.space",
"node204.fra.mempool.space",
"node205.fra.mempool.space",
"node206.fra.mempool.space",
"node201.tk7.mempool.space",
"node202.tk7.mempool.space",
"node203.tk7.mempool.space",
"node204.tk7.mempool.space",
"node205.tk7.mempool.space",
"node206.tk7.mempool.space"
]
}
}

View File

@@ -1,5 +1,6 @@
{
"MEMPOOL": {
"ENABLED": false,
"NETWORK": "signet",
"BACKEND": "esplora",
"HTTP_PORT": 8991,
@@ -15,7 +16,33 @@
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4003"
"UNIX_SOCKET_PATH": "/bitcoin/socket/esplora-bitcoin-signet",
"FALLBACK": [
"http://node201.va1.mempool.space:3003",
"http://node202.va1.mempool.space:3003",
"http://node203.va1.mempool.space:3003",
"http://node204.va1.mempool.space:3003",
"http://node205.va1.mempool.space:3003",
"http://node206.va1.mempool.space:3003",
"http://node201.fmt.mempool.space:3003",
"http://node202.fmt.mempool.space:3003",
"http://node203.fmt.mempool.space:3003",
"http://node204.fmt.mempool.space:3003",
"http://node205.fmt.mempool.space:3003",
"http://node206.fmt.mempool.space:3003",
"http://node201.fra.mempool.space:3003",
"http://node202.fra.mempool.space:3003",
"http://node203.fra.mempool.space:3003",
"http://node204.fra.mempool.space:3003",
"http://node205.fra.mempool.space:3003",
"http://node206.fra.mempool.space:3003",
"http://node201.tk7.mempool.space:3003",
"http://node202.tk7.mempool.space:3003",
"http://node203.tk7.mempool.space:3003",
"http://node204.tk7.mempool.space:3003",
"http://node205.tk7.mempool.space:3003",
"http://node206.tk7.mempool.space:3003"
]
},
"LIGHTNING": {
"ENABLED": true,
@@ -36,9 +63,9 @@
"DATABASE": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"USERNAME": "mempool_signet_lightning",
"PASSWORD": "mempool_signet_lightning",
"SOCKET": "/var/run/mysql/mysql.sock",
"USERNAME": "__MEMPOOL_SIGNET_LIGHTNING_USER__",
"PASSWORD": "__MEMPOOL_SIGNET_LIGHTNING_PASS__",
"DATABASE": "mempool_signet_lightning"
}
}

View File

@@ -7,7 +7,14 @@
"SPAWN_CLUSTER_PROCS": 0,
"API_URL_PREFIX": "/api/v1/",
"INDEXING_BLOCKS_AMOUNT": -1,
"POLL_RATE_MS": 1000
"AUDIT": true,
"ADVANCED_GBT_AUDIT": true,
"ADVANCED_GBT_MEMPOOL": true,
"RUST_GBT": true,
"POLL_RATE_MS": 1000,
"DISK_CACHE_BLOCK_INTERVAL": 1,
"MAX_PUSH_TX_SIZE_WEIGHT": 4000000,
"ALLOW_UNREACHABLE": true
},
"SYSLOG" : {
"MIN_PRIORITY": "debug"
@@ -18,12 +25,38 @@
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4003"
"UNIX_SOCKET_PATH": "/bitcoin/socket/esplora-bitcoin-signet",
"FALLBACK": [
"http://node201.va1.mempool.space:3003",
"http://node202.va1.mempool.space:3003",
"http://node203.va1.mempool.space:3003",
"http://node204.va1.mempool.space:3003",
"http://node205.va1.mempool.space:3003",
"http://node206.va1.mempool.space:3003",
"http://node201.fmt.mempool.space:3003",
"http://node202.fmt.mempool.space:3003",
"http://node203.fmt.mempool.space:3003",
"http://node204.fmt.mempool.space:3003",
"http://node205.fmt.mempool.space:3003",
"http://node206.fmt.mempool.space:3003",
"http://node201.fra.mempool.space:3003",
"http://node202.fra.mempool.space:3003",
"http://node203.fra.mempool.space:3003",
"http://node204.fra.mempool.space:3003",
"http://node205.fra.mempool.space:3003",
"http://node206.fra.mempool.space:3003",
"http://node201.tk7.mempool.space:3003",
"http://node202.tk7.mempool.space:3003",
"http://node203.tk7.mempool.space:3003",
"http://node204.tk7.mempool.space:3003",
"http://node205.tk7.mempool.space:3003",
"http://node206.tk7.mempool.space:3003"
]
},
"DATABASE": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"SOCKET": "/var/run/mysql/mysql.sock",
"USERNAME": "__MEMPOOL_SIGNET_USER__",
"PASSWORD": "__MEMPOOL_SIGNET_PASS__",
"DATABASE": "mempool_signet"

View File

@@ -1,5 +1,6 @@
{
"MEMPOOL": {
"ENABLED": false,
"NETWORK": "testnet",
"BACKEND": "esplora",
"HTTP_PORT": 8992,
@@ -15,7 +16,33 @@
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4002"
"UNIX_SOCKET_PATH": "/bitcoin/socket/esplora-bitcoin-testnet",
"FALLBACK": [
"http://node201.va1.mempool.space:3002",
"http://node202.va1.mempool.space:3002",
"http://node203.va1.mempool.space:3002",
"http://node204.va1.mempool.space:3002",
"http://node205.va1.mempool.space:3002",
"http://node206.va1.mempool.space:3002",
"http://node201.fmt.mempool.space:3002",
"http://node202.fmt.mempool.space:3002",
"http://node203.fmt.mempool.space:3002",
"http://node204.fmt.mempool.space:3002",
"http://node205.fmt.mempool.space:3002",
"http://node206.fmt.mempool.space:3002",
"http://node201.fra.mempool.space:3002",
"http://node202.fra.mempool.space:3002",
"http://node203.fra.mempool.space:3002",
"http://node204.fra.mempool.space:3002",
"http://node205.fra.mempool.space:3002",
"http://node206.fra.mempool.space:3002",
"http://node201.tk7.mempool.space:3002",
"http://node202.tk7.mempool.space:3002",
"http://node203.tk7.mempool.space:3002",
"http://node204.tk7.mempool.space:3002",
"http://node205.tk7.mempool.space:3002",
"http://node206.tk7.mempool.space:3002"
]
},
"LIGHTNING": {
"ENABLED": true,
@@ -36,9 +63,9 @@
"DATABASE": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"USERNAME": "mempool_testnet_lightning",
"PASSWORD": "mempool_testnet_lightning",
"SOCKET": "/var/run/mysql/mysql.sock",
"USERNAME": "__MEMPOOL_TESTNET_LIGHTNING_USER__",
"PASSWORD": "__MEMPOOL_TESTNET_LIGHTNING_PASS__",
"DATABASE": "mempool_testnet_lightning"
}
}

View File

@@ -7,7 +7,14 @@
"SPAWN_CLUSTER_PROCS": 0,
"API_URL_PREFIX": "/api/v1/",
"INDEXING_BLOCKS_AMOUNT": -1,
"POLL_RATE_MS": 1000
"AUDIT": true,
"ADVANCED_GBT_AUDIT": true,
"ADVANCED_GBT_MEMPOOL": true,
"RUST_GBT": true,
"POLL_RATE_MS": 1000,
"DISK_CACHE_BLOCK_INTERVAL": 1,
"MAX_PUSH_TX_SIZE_WEIGHT": 4000000,
"ALLOW_UNREACHABLE": true
},
"SYSLOG" : {
"MIN_PRIORITY": "debug"
@@ -18,12 +25,38 @@
"PASSWORD": "__BITCOIN_RPC_PASS__"
},
"ESPLORA": {
"REST_API_URL": "http://127.0.0.1:4002"
"UNIX_SOCKET_PATH": "/bitcoin/socket/esplora-bitcoin-testnet",
"FALLBACK": [
"http://node201.va1.mempool.space:3002",
"http://node202.va1.mempool.space:3002",
"http://node203.va1.mempool.space:3002",
"http://node204.va1.mempool.space:3002",
"http://node205.va1.mempool.space:3002",
"http://node206.va1.mempool.space:3002",
"http://node201.fmt.mempool.space:3002",
"http://node202.fmt.mempool.space:3002",
"http://node203.fmt.mempool.space:3002",
"http://node204.fmt.mempool.space:3002",
"http://node205.fmt.mempool.space:3002",
"http://node206.fmt.mempool.space:3002",
"http://node201.fra.mempool.space:3002",
"http://node202.fra.mempool.space:3002",
"http://node203.fra.mempool.space:3002",
"http://node204.fra.mempool.space:3002",
"http://node205.fra.mempool.space:3002",
"http://node206.fra.mempool.space:3002",
"http://node201.tk7.mempool.space:3002",
"http://node202.tk7.mempool.space:3002",
"http://node203.tk7.mempool.space:3002",
"http://node204.tk7.mempool.space:3002",
"http://node205.tk7.mempool.space:3002",
"http://node206.tk7.mempool.space:3002"
]
},
"DATABASE": {
"ENABLED": true,
"HOST": "127.0.0.1",
"PORT": 3306,
"SOCKET": "/var/run/mysql/mysql.sock",
"USERNAME": "__MEMPOOL_TESTNET_USER__",
"PASSWORD": "__MEMPOOL_TESTNET_PASS__",
"DATABASE": "mempool_testnet"

View File

@@ -9,5 +9,7 @@
"MEMPOOL_WEBSITE_URL": "https://mempool.space",
"LIQUID_WEBSITE_URL": "https://liquid.network",
"BISQ_WEBSITE_URL": "https://bisq.markets",
"ITEMS_PER_PAGE": 25
"ITEMS_PER_PAGE": 25,
"LIGHTNING": true,
"AUDIT": true
}

3
production/mempool-reset-all Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env zsh
rm $HOME/*/backend/mempool-config.json
rm $HOME/*/frontend/mempool-frontend-config.json

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env zsh
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
nvm use v20.5.1
# start all mempool backends that exist
for site in mainnet mainnet-lightning testnet testnet-lightning signet signet-lightning bisq liquid liquidtestnet;do
@@ -9,12 +10,9 @@ for site in mainnet mainnet-lightning testnet testnet-lightning signet signet-li
screen -dmS "${site}" sh -c 'while true;do npm run start-production;sleep 1;done'
done
# only start xorg if GPU present
if pciconf -lv|grep -i nvidia >/dev/null 2>&1;then
export DISPLAY=:0
screen -dmS x startx
sleep 3
fi
export DISPLAY=:0
screen -dmS x startx
sleep 3
# start unfurlers for each frontend
for site in mainnet liquid bisq;do

View File

@@ -1,5 +1,5 @@
# start on reboot
@reboot sleep 10 ; $HOME/start
@reboot sleep 90 ; $HOME/start
# daily backup
37 13 * * * sleep 30 ; /mempool/mempool.space/backup >/dev/null 2>&1 &

View File

@@ -1 +1 @@
@reboot sleep 120 ; /usr/local/bin/bitcoind >/dev/null 2>&1
@reboot /usr/local/bin/bitcoind >/dev/null 2>&1

View File

@@ -1,8 +1,8 @@
/var/log/nginx/access.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/error.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/bisq-access.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/bisq-error.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/liquid-access.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/liquid-error.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/mempool-access.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/mempool-error.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/access.log www:www 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/error.log www:www 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/bisq-access.log www:www 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/bisq-error.log www:www 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/liquid-access.log www:www 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/liquid-error.log www:www 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/mempool-access.log www:www 644 10 * @T00 C /var/run/mempool.pid 30
/var/log/nginx/mempool-error.log www:www 644 10 * @T00 C /var/run/mempool.pid 30

View File

@@ -1,6 +1,19 @@
#!/usr/bin/env zsh
delay=0.15
hostname=$(hostname)
slugs=(`curl -sSL https://raw.githubusercontent.com/mempool/mining-pools/master/pools.json | jq -r '.slugs[]'`)
slugs=(`curl -sSL https://${hostname}/api/v1/mining/pools/3y|jq -r -S '(.pools[].slug)'`)
warmSlurp()
{
echo "$1"
curl -i -s -H 'User-Agent: Googlebot' "$1" | head -1
}
warmUnfurl()
{
echo "$1"
curl -i -s -H 'User-Agent: Twitterbot' "$1" | head -1
}
warm()
{
@@ -8,126 +21,172 @@ warm()
curl -i -s "$1" | head -1
}
while true
do for url in / \
'/api/v1/blocks' \
'/api/v1/statistics/2h' \
'/api/v1/statistics/24h' \
'/api/v1/statistics/1w' \
'/api/v1/statistics/1m' \
'/api/v1/statistics/3m' \
'/api/v1/statistics/6m' \
'/api/v1/statistics/1y' \
'/api/v1/statistics/2y' \
'/api/v1/statistics/3y' \
'/api/v1/mining/pools/24h' \
'/api/v1/mining/pools/3d' \
'/api/v1/mining/pools/1w' \
'/api/v1/mining/pools/1m' \
'/api/v1/mining/pools/3m' \
'/api/v1/mining/pools/6m' \
'/api/v1/mining/pools/1y' \
'/api/v1/mining/pools/2y' \
'/api/v1/mining/pools/3y' \
'/api/v1/mining/pools/all' \
'/api/v1/mining/hashrate/3m' \
'/api/v1/mining/hashrate/6m' \
'/api/v1/mining/hashrate/1y' \
'/api/v1/mining/hashrate/2y' \
'/api/v1/mining/hashrate/3y' \
'/api/v1/mining/hashrate/all' \
'/api/v1/mining/hashrate/pools/3m' \
'/api/v1/mining/hashrate/pools/6m' \
'/api/v1/mining/hashrate/pools/1y' \
'/api/v1/mining/hashrate/pools/2y' \
'/api/v1/mining/hashrate/pools/3y' \
'/api/v1/mining/hashrate/pools/all' \
'/api/v1/mining/reward-stats/144' \
'/api/v1/mining/blocks/fees/24h' \
'/api/v1/mining/blocks/fees/3d' \
'/api/v1/mining/blocks/fees/1w' \
'/api/v1/mining/blocks/fees/1m' \
'/api/v1/mining/blocks/fees/3m' \
'/api/v1/mining/blocks/fees/6m' \
'/api/v1/mining/blocks/fees/1y' \
'/api/v1/mining/blocks/fees/2y' \
'/api/v1/mining/blocks/fees/3y' \
'/api/v1/mining/blocks/fees/all' \
'/api/v1/mining/blocks/rewards/24h' \
'/api/v1/mining/blocks/rewards/3d' \
'/api/v1/mining/blocks/rewards/1w' \
'/api/v1/mining/blocks/rewards/1m' \
'/api/v1/mining/blocks/rewards/3m' \
'/api/v1/mining/blocks/rewards/6m' \
'/api/v1/mining/blocks/rewards/1y' \
'/api/v1/mining/blocks/rewards/2y' \
'/api/v1/mining/blocks/rewards/3y' \
'/api/v1/mining/blocks/rewards/all' \
'/api/v1/mining/blocks/fee-rates/24h' \
'/api/v1/mining/blocks/fee-rates/3d' \
'/api/v1/mining/blocks/fee-rates/1w' \
'/api/v1/mining/blocks/fee-rates/1m' \
'/api/v1/mining/blocks/fee-rates/3m' \
'/api/v1/mining/blocks/fee-rates/6m' \
'/api/v1/mining/blocks/fee-rates/1y' \
'/api/v1/mining/blocks/fee-rates/2y' \
'/api/v1/mining/blocks/fee-rates/3y' \
'/api/v1/mining/blocks/fee-rates/all' \
'/api/v1/mining/difficulty-adjustments/24h' \
'/api/v1/mining/difficulty-adjustments/3d' \
'/api/v1/mining/difficulty-adjustments/1w' \
'/api/v1/mining/difficulty-adjustments/1m' \
'/api/v1/mining/difficulty-adjustments/3m' \
'/api/v1/mining/difficulty-adjustments/6m' \
'/api/v1/mining/difficulty-adjustments/1y' \
'/api/v1/mining/difficulty-adjustments/2y' \
'/api/v1/mining/difficulty-adjustments/3y' \
'/api/v1/mining/difficulty-adjustments/all' \
'/api/v1/lightning/channels-geo?style=widget' \
'/api/v1/lightning/channels-geo?style=graph' \
'/api/v1/lightning/statistics/latest' \
'/api/v1/lightning/statistics/1m' \
'/api/v1/lightning/statistics/3m' \
'/api/v1/lightning/statistics/6m' \
'/api/v1/lightning/statistics/1y' \
'/api/v1/lightning/statistics/2y' \
'/api/v1/lightning/statistics/3y' \
'/api/v1/lightning/statistics/all' \
'/api/v1/lightning/nodes/isp-ranking' \
'/api/v1/lightning/nodes/isp/396982,15169' `# Google` \
'/api/v1/lightning/nodes/isp/14618,16509' `# Amazon` \
'/api/v1/lightning/nodes/isp/39572' `# DataWeb` \
'/api/v1/lightning/nodes/isp/14061' `# Digital Ocean` \
'/api/v1/lightning/nodes/isp/24940,213230' `# Hetzner` \
'/api/v1/lightning/nodes/isp/394745' `# LunaNode` \
'/api/v1/lightning/nodes/isp/45102' `# Alibaba` \
'/api/v1/lightning/nodes/isp/3209' `# Vodafone Germany` \
'/api/v1/lightning/nodes/isp/7922' `# Comcast Cable` \
'/api/v1/lightning/nodes/isp/34197' `# SHRD SARL` \
'/api/v1/lightning/nodes/isp/42275' `# Three Fourteen SASU` \
'/api/v1/lightning/nodes/isp/16276' `# OVH SAS` \
'/api/v1/lightning/nodes/isp/11426,11427,20001,20115,11351,10796,33363,12271' `# Spectrum` \
'/api/v1/lightning/nodes/isp/701' `# Verizon` \
'/api/v1/lightning/nodes/isp/12876' `# Scaleway` \
'/api/v1/lightning/nodes/isp/33915' `# Ziggo` \
'/api/v1/lightning/nodes/isp/3320' `# Deutsche Telekom AG` \
'/api/v1/lightning/nodes/isp/8075' `# Microsoft Azure` \
'/api/v1/lightning/nodes/countries' \
'/api/v1/lightning/nodes/rankings' \
'/api/v1/lightning/nodes/rankings/liquidity' \
'/api/v1/lightning/nodes/rankings/connectivity' \
'/api/v1/lightning/nodes/rankings/age' \
warmSlurpURLs=(
'/'
'/mining'
'/lightning'
'/graphs'
'/docs'
'/docs/faq'
'/docs/api/rest'
'/about'
)
warmUnfurlURLs=(
'/'
'/mining'
'/lightning'
)
warmURLs=(
'/api/v1/blocks'
'/api/v1/statistics/2h'
'/api/v1/statistics/24h'
'/api/v1/statistics/1w'
'/api/v1/statistics/1m'
'/api/v1/statistics/3m'
'/api/v1/statistics/6m'
'/api/v1/statistics/1y'
'/api/v1/statistics/2y'
'/api/v1/statistics/3y'
'/api/v1/statistics/4y'
'/api/v1/statistics/all'
'/api/v1/mining/pools/24h'
'/api/v1/mining/pools/3d'
'/api/v1/mining/pools/1w'
'/api/v1/mining/pools/1m'
'/api/v1/mining/pools/3m'
'/api/v1/mining/pools/6m'
'/api/v1/mining/pools/1y'
'/api/v1/mining/pools/2y'
'/api/v1/mining/pools/3y'
'/api/v1/mining/pools/all'
'/api/v1/mining/hashrate/3m'
'/api/v1/mining/hashrate/6m'
'/api/v1/mining/hashrate/1y'
'/api/v1/mining/hashrate/2y'
'/api/v1/mining/hashrate/3y'
'/api/v1/mining/hashrate/all'
'/api/v1/mining/hashrate/pools/3m'
'/api/v1/mining/hashrate/pools/6m'
'/api/v1/mining/hashrate/pools/1y'
'/api/v1/mining/hashrate/pools/2y'
'/api/v1/mining/hashrate/pools/3y'
'/api/v1/mining/hashrate/pools/all'
'/api/v1/mining/reward-stats/144'
'/api/v1/mining/blocks/fees/24h'
'/api/v1/mining/blocks/fees/3d'
'/api/v1/mining/blocks/fees/1w'
'/api/v1/mining/blocks/fees/1m'
'/api/v1/mining/blocks/fees/3m'
'/api/v1/mining/blocks/fees/6m'
'/api/v1/mining/blocks/fees/1y'
'/api/v1/mining/blocks/fees/2y'
'/api/v1/mining/blocks/fees/3y'
'/api/v1/mining/blocks/fees/all'
'/api/v1/mining/blocks/rewards/24h'
'/api/v1/mining/blocks/rewards/3d'
'/api/v1/mining/blocks/rewards/1w'
'/api/v1/mining/blocks/rewards/1m'
'/api/v1/mining/blocks/rewards/3m'
'/api/v1/mining/blocks/rewards/6m'
'/api/v1/mining/blocks/rewards/1y'
'/api/v1/mining/blocks/rewards/2y'
'/api/v1/mining/blocks/rewards/3y'
'/api/v1/mining/blocks/rewards/all'
'/api/v1/mining/blocks/fee-rates/24h'
'/api/v1/mining/blocks/fee-rates/3d'
'/api/v1/mining/blocks/fee-rates/1w'
'/api/v1/mining/blocks/fee-rates/1m'
'/api/v1/mining/blocks/fee-rates/3m'
'/api/v1/mining/blocks/fee-rates/6m'
'/api/v1/mining/blocks/fee-rates/1y'
'/api/v1/mining/blocks/fee-rates/2y'
'/api/v1/mining/blocks/fee-rates/3y'
'/api/v1/mining/blocks/fee-rates/all'
'/api/v1/mining/difficulty-adjustments/24h'
'/api/v1/mining/difficulty-adjustments/3d'
'/api/v1/mining/difficulty-adjustments/1w'
'/api/v1/mining/difficulty-adjustments/1m'
'/api/v1/mining/difficulty-adjustments/3m'
'/api/v1/mining/difficulty-adjustments/6m'
'/api/v1/mining/difficulty-adjustments/1y'
'/api/v1/mining/difficulty-adjustments/2y'
'/api/v1/mining/difficulty-adjustments/3y'
'/api/v1/mining/difficulty-adjustments/all'
'/api/v1/lightning/channels-geo?style=widget'
'/api/v1/lightning/channels-geo?style=graph'
'/api/v1/lightning/statistics/latest'
'/api/v1/lightning/statistics/1m'
'/api/v1/lightning/statistics/3m'
'/api/v1/lightning/statistics/6m'
'/api/v1/lightning/statistics/1y'
'/api/v1/lightning/statistics/2y'
'/api/v1/lightning/statistics/3y'
'/api/v1/lightning/statistics/all'
'/api/v1/lightning/nodes/isp-ranking'
'/api/v1/lightning/nodes/isp/15169,396982' `# Google`
'/api/v1/lightning/nodes/isp/14618,16509' `# Amazon`
'/api/v1/lightning/nodes/isp/39572' `# DataWeb`
'/api/v1/lightning/nodes/isp/14061' `# Digital Ocean`
'/api/v1/lightning/nodes/isp/24940,213230' `# Hetzner`
'/api/v1/lightning/nodes/isp/394745' `# LunaNode`
'/api/v1/lightning/nodes/isp/45102' `# Alibaba`
'/api/v1/lightning/nodes/isp/3209' `# Vodafone Germany`
'/api/v1/lightning/nodes/isp/7922' `# Comcast Cable`
'/api/v1/lightning/nodes/isp/34197' `# SHRD SARL`
'/api/v1/lightning/nodes/isp/42275' `# Three Fourteen SASU`
'/api/v1/lightning/nodes/isp/16276' `# OVH SAS`
'/api/v1/lightning/nodes/isp/10796,11351,11426,11427,12271,20001,2$delay,33363' `# Spectrum`
'/api/v1/lightning/nodes/isp/701' `# Verizon`
'/api/v1/lightning/nodes/isp/12876' `# Scaleway`
'/api/v1/lightning/nodes/isp/33915' `# Ziggo`
'/api/v1/lightning/nodes/isp/3320' `# Deutsche Telekom AG`
'/api/v1/lightning/nodes/isp/8075' `# Microsoft Azure`
'/api/v1/lightning/nodes/isp/212531' `# UAB Interneto vizija`
'/api/v1/lightning/nodes/isp/63949' `# Linode`
'/api/v1/lightning/nodes/isp/51167' `# Contabo GmbH`
'/api/v1/lightning/nodes/countries'
'/api/v1/lightning/nodes/rankings'
'/api/v1/lightning/nodes/rankings/liquidity'
'/api/v1/lightning/nodes/rankings/connectivity'
'/api/v1/lightning/nodes/rankings/age'
)
echo "waiting for mempool backend to start..."
sleep 60
while true
do
echo "starting warm cache cycle..."
for url in $warmSlurpURLs
do
warmSlurp "https://${hostname}${url}"
sleep $delay # delay between queries to not DoS unfurler
done
for url in $warmUnfurlURLs
do
warmUnfurl "https://${hostname}${url}"
sleep $delay # delay between queries to not DoS unfurler
done
for url in $warmURLs
do
warm "https://${hostname}${url}"
sleep $delay # delay between queries to not DoS mariadb
done
for slug in $slugs
do
warm "https://${hostname}/api/v1/mining/pool/${slug}"
sleep $delay # delay between queries to not DoS mariadb
warm "https://${hostname}/api/v1/mining/pool/${slug}/hashrate"
sleep $delay # delay between queries to not DoS mariadb
warm "https://${hostname}/api/v1/mining/pool/${slug}/blocks"
sleep $delay # delay between queries to not DoS mariadb
done
sleep 10
sleep 1
done

View File

@@ -35,3 +35,5 @@ gzip_types application/javascript application/json application/ld+json applicati
# limit request body size
client_max_body_size 10m;
# need to bump this up for about page sponsor images lol
http2_max_concurrent_streams 256;

View File

@@ -3,8 +3,8 @@ map $http_accept_language $header_lang {
~*^en-US '';
~*^en '';
~*^ar ar;
~*^ca ca;
~*^cs cs;
~*^da da;
~*^de de;
~*^es es;
~*^fa fa;
@@ -31,14 +31,15 @@ map $http_accept_language $header_lang {
~*^uk uk;
~*^vi vi;
~*^zh zh;
~*^lt lt;
}
map $cookie_lang $lang {
default $header_lang;
~*^en-US '';
~*^en '';
~*^ar ar;
~*^ca ca;
~*^cs cs;
~*^da da;
~*^de de;
~*^es es;
~*^fa fa;
@@ -65,4 +66,5 @@ map $cookie_lang $lang {
~*^uk uk;
~*^vi vi;
~*^zh zh;
~*^lt lt;
}

View File

@@ -1,6 +1,8 @@
# proxy cache
proxy_cache_path /var/cache/nginx/api keys_zone=api:20m levels=1:2 inactive=600s max_size=100m;
proxy_cache_path /var/cache/nginx/services keys_zone=services:20m levels=1:2 inactive=600s max_size=100m;
proxy_cache_path /var/cache/nginx/markets keys_zone=markets:20m levels=1:2 inactive=600s max_size=100m;
types_hash_max_size 2048;
proxy_buffer_size 8k;
proxy_cache_path /var/cache/nginx/api keys_zone=api:20m levels=1:2 inactive=365d max_size=2000m;
proxy_cache_path /var/cache/nginx/unfurler keys_zone=unfurler:20m levels=1:2 inactive=365d max_size=2000m;
proxy_cache_path /var/cache/nginx/slurper keys_zone=slurper:20m levels=1:2 inactive=365d max_size=5000m;
proxy_cache_path /var/cache/nginx/services keys_zone=services:20m levels=1:2 inactive=365d max_size=100m;
proxy_cache_path /var/cache/nginx/markets keys_zone=markets:20m levels=1:2 inactive=365d max_size=100m;
types_hash_max_size 4096;
proxy_buffer_size 8k;

View File

@@ -1,3 +1,15 @@
location /api/v1/services {
proxy_pass $mempoolSpaceServices;
proxy_cache services;
proxy_cache_background_update on;
proxy_cache_use_stale updating;
proxy_cache_valid 200 1d;
expires 1d;
proxy_hide_header onion-location;
proxy_hide_header strict-transport-security;
proxy_hide_header content-security-policy;
proxy_hide_header x-frame-options;
}
location /api/v1/contributors/images {
proxy_pass $mempoolSpaceServices;
proxy_cache services;

View File

@@ -97,10 +97,10 @@ location @mempool-api-v1-cache-normal {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache api;
proxy_cache_valid 200 10s;
proxy_cache_valid 200 2s;
proxy_redirect off;
expires 10s;
expires 2s;
}
location @mempool-api-v1-cache-disabled {

View File

@@ -1,12 +1,12 @@
# redirect mempool.space/liquid to liquid.network
location /liquid {
location = /liquid {
rewrite /liquid/(.*) https://liquid.network/$1;
rewrite /liquid https://liquid.network/;
return 308;
}
# redirect mempool.space/liquidtestnet to liquid.network/testnet
location /liquidtestnet {
location = /liquidtestnet {
rewrite /liquidtestnet/(.*) https://liquid.network/testnet/$1;
rewrite /liquidtestnet/ https://liquid.network/testnet/;
rewrite /liquidtestnet https://liquid.network/testnet;
@@ -14,7 +14,7 @@ location /liquidtestnet {
}
# redirect mempool.space/bisq to bisq.markets
location /bisq {
location = /bisq {
rewrite /bisq/(.*) https://bisq.markets/$1;
rewrite /bisq https://bisq.markets/;
return 308;

View File

@@ -23,8 +23,8 @@ http {
include mempool/production/nginx/http-language.conf;
# match preview/unfurl bot user-agents
map $http_user_agent $unfurlbot {
default 0;
map $http_user_agent $unfurlprefix {
default "";
}
# mempool configuration

View File

@@ -9,6 +9,10 @@ location /api/tx/ {
rewrite ^/api/(.*) /$1 break;
try_files /dev/null @esplora-api-cache-disabled;
}
location /api/address-prefix/ {
rewrite ^/api/(.*) /$1 break;
try_files /dev/null @esplora-api-cache-disabled;
}
# rewrite APIs to match what backend expects
location /api/currencies {

View File

@@ -48,8 +48,8 @@ add_header Vary Cookie;
# for exact / requests, redirect based on $lang
# cache redirect for 5 minutes
location = / {
if ($unfurlbot) {
proxy_pass $mempoolSpaceUnfurler;
if ($unfurlprefix != '') {
rewrite ^(.*)$ $unfurlprefix$1 last;
}
if ($lang != '') {
return 302 $scheme://$host/$lang/;
@@ -59,18 +59,21 @@ location = / {
}
# cache /<lang>/main.f40e91d908a068a2.js forever since they never change
location ~ ^/([a-z][a-z])/(.+\..+\.(js|css)) {
location ~ ^/([a-z][a-z])/(.+\..+\.(js|css))$ {
try_files $uri =404;
expires 1y;
}
# cache everything else for 5 minutes
location ~ ^/([a-z][a-z])$ {
if ($unfurlprefix != '') {
rewrite ^(.*)$ $unfurlprefix$1 last;
}
try_files $uri /$1/index.html /en-US/index.html =404;
expires 5m;
}
location ~ ^/([a-z][a-z])/ {
if ($unfurlbot) {
proxy_pass $mempoolSpaceUnfurler;
if ($unfurlprefix != '') {
rewrite ^(.*)$ $unfurlprefix$1 last;
}
try_files $uri /$1/index.html /en-US/index.html =404;
expires 5m;
@@ -81,12 +84,27 @@ location /resources {
try_files $uri /en-US/index.html;
expires 1w;
}
# only cache /resources/config.* for 5 minutes since it changes often
location /resources/config. {
try_files $uri =404;
expires 5m;
}
# cache /main.f40e91d908a068a2.js forever since they never change
location ~* ^/.+\..+\.(js|css) {
location ~* ^/.+\..+\.(js|css)$ {
try_files /$lang/$uri /en-US/$uri =404;
expires 1y;
}
# old stuff is gone
location /explorer/ {
return 410;
}
location /sitemap/ {
return 410;
}
# unfurl preview
location /preview {
try_files /$lang/$uri $uri /en-US/$uri /en-US/index.html =404;
@@ -94,16 +112,56 @@ location /preview {
}
# unfurl renderer
location ^~ /render {
proxy_pass $mempoolSpaceUnfurler;
expires 10m;
try_files /dev/null @mempool-space-unfurler;
}
# unfurl handler
location /unfurl/ {
try_files /dev/null @mempool-space-unfurler;
}
location /slurp/ {
try_files /dev/null @mempool-space-slurper;
}
# catch-all for all URLs i.e. /address/foo /tx/foo /block/000
# cache 5 minutes since they change frequently
location / {
if ($unfurlbot) {
proxy_pass $mempoolSpaceUnfurler;
if ($unfurlprefix != '') {
rewrite ^(.*)$ $unfurlprefix$1 last;
}
try_files /$lang/$uri $uri /en-US/$uri /en-US/index.html =404;
expires 5m;
}
location @mempool-space-unfurler {
proxy_pass $mempoolSpaceUnfurler;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_background_update on;
proxy_cache_use_stale updating;
proxy_cache unfurler;
proxy_cache_valid 200 1h; # will re-render page if older than this
proxy_redirect off;
expires 1d;
}
location @mempool-space-slurper {
proxy_pass $mempoolSpaceUnfurler;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_background_update on;
proxy_cache_use_stale updating;
proxy_cache slurper;
proxy_cache_valid 200 1h; # will re-render page if older than this
proxy_redirect off;
expires 10d;
}

View File

@@ -1,15 +1,15 @@
upstream esplora-bitcoin-mainnet {
server [::1]:3000 fail_timeout=10s max_fails=10 weight=99999;
server unix:/bitcoin/socket/esplora-bitcoin-mainnet fail_timeout=10s max_fails=10 weight=99999;
}
upstream esplora-liquid-mainnet {
server [::1]:3001 fail_timeout=10s max_fails=10 weight=99999;
server unix:/elements/socket/esplora-liquid-mainnet fail_timeout=10s max_fails=10 weight=99999;
}
upstream esplora-bitcoin-testnet {
server [::1]:3002 fail_timeout=10s max_fails=10 weight=99999;
server unix:/bitcoin/socket/esplora-bitcoin-testnet fail_timeout=10s max_fails=10 weight=99999;
}
upstream esplora-bitcoin-signet {
server [::1]:3003 fail_timeout=10s max_fails=10 weight=99999;
server unix:/bitcoin/socket/esplora-bitcoin-signet fail_timeout=10s max_fails=10 weight=99999;
}
upstream esplora-liquid-testnet {
server [::1]:3004 fail_timeout=10s max_fails=10 weight=99999;
server unix:/elements/socket/esplora-liquid-testnet fail_timeout=10s max_fails=10 weight=99999;
}

View File

@@ -1,6 +1,6 @@
{
"SERVER": {
"HOST": "https://mempool.fra.mempool.space",
"HOST": "https://mempool.tk7.mempool.space",
"HTTP_PORT": 8001
},
"MEMPOOL": {