Attempt to merge master into #5376
This commit is contained in:
@@ -84,11 +84,11 @@ pkg install -y zsh sudo git screen curl wget neovim rsync nginx openssl openssh-
|
||||
|
||||
### Node.js + npm
|
||||
|
||||
Build Node.js v16.16.0 and npm v8 from source using `nvm`:
|
||||
Build Node.js v20.17.0 and npm v9 from source using `nvm`:
|
||||
```
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | zsh
|
||||
source $HOME/.zshrc
|
||||
nvm install v16.16.0 --shared-zlib
|
||||
nvm install v20.17.0 --shared-zlib
|
||||
nvm alias default node
|
||||
```
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ txindex=1
|
||||
coinstatsindex=1
|
||||
listen=1
|
||||
discover=1
|
||||
par=16
|
||||
dbcache=8192
|
||||
mempoolfullrbf=1
|
||||
maxconnections=100
|
||||
@@ -15,6 +14,7 @@ rpcpassword=__BITCOIN_RPC_PASS__
|
||||
whitelist=127.0.0.1
|
||||
whitelist=103.99.168.0/22
|
||||
whitelist=2401:b140::/32
|
||||
blocksxor=0
|
||||
#uacomment=@wiz
|
||||
|
||||
[main]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@reboot sleep 5 ; /usr/local/bin/bitcoind -testnet >/dev/null 2>&1
|
||||
@reboot sleep 5 ; /usr/local/bin/bitcoind -testnet4 >/dev/null 2>&1
|
||||
@reboot sleep 5 ; /usr/local/bin/bitcoind -signet >/dev/null 2>&1
|
||||
@reboot sleep 10 ; screen -dmS mainnet /bitcoin/electrs/start mainnet
|
||||
@reboot sleep 10 ; screen -dmS testnet /bitcoin/electrs/start testnet
|
||||
|
||||
@@ -47,6 +47,7 @@ UNFURL_INSTALL=ON
|
||||
BITCOIN_MAINNET_ENABLE=ON
|
||||
BITCOIN_MAINNET_MINFEE_ENABLE=ON
|
||||
BITCOIN_TESTNET_ENABLE=ON
|
||||
BITCOIN_TESTNET4_ENABLE=ON
|
||||
BITCOIN_SIGNET_ENABLE=ON
|
||||
BITCOIN_MAINNET_LIGHTNING_ENABLE=ON
|
||||
BITCOIN_TESTNET_LIGHTNING_ENABLE=ON
|
||||
@@ -100,6 +101,13 @@ BITCOIN_TESTNET_P2P_PORT=18333
|
||||
BITCOIN_TESTNET_RPC_HOST=127.0.0.1
|
||||
BITCOIN_TESTNET_RPC_PORT=18332
|
||||
|
||||
# used for firewall configuration
|
||||
BITCOIN_TESTNET4_P2P_HOST=127.0.0.1
|
||||
BITCOIN_TESTNET4_P2P_PORT=48333
|
||||
# used for RPC communication
|
||||
BITCOIN_TESTNET4_RPC_HOST=127.0.0.1
|
||||
BITCOIN_TESTNET4_RPC_PORT=48332
|
||||
|
||||
# used for firewall configuration
|
||||
BITCOIN_SIGNET_P2P_HOST=127.0.0.1
|
||||
BITCOIN_SIGNET_P2P_PORT=18333
|
||||
@@ -139,6 +147,11 @@ ELECTRS_LIQUID_HTTP_PORT=3001
|
||||
ELECTRS_TESTNET_HTTP_HOST=127.0.0.1
|
||||
ELECTRS_TESTNET_HTTP_PORT=3002
|
||||
|
||||
# set either socket or TCP host/port, not both
|
||||
#ELECTRS_TESTNET4_HTTP_SOCK=/tmp/bitcoin.testnet4.electrs
|
||||
ELECTRS_TESTNET4_HTTP_HOST=127.0.0.1
|
||||
ELECTRS_TESTNET4_HTTP_PORT=3005
|
||||
|
||||
# set either socket or TCP host/port, not both
|
||||
#ELECTRS_SIGNET_HTTP_SOCK=/tmp/bitcoin.testnet.electrs
|
||||
ELECTRS_SIGNET_HTTP_HOST=127.0.0.1
|
||||
@@ -164,6 +177,11 @@ MEMPOOL_LIQUID_HTTP_PORT=8998
|
||||
MEMPOOL_TESTNET_HTTP_HOST=127.0.0.1
|
||||
MEMPOOL_TESTNET_HTTP_PORT=8997
|
||||
|
||||
# set either socket or TCP host/port, not both
|
||||
#MEMPOOL_TESTNET4_HTTP_SOCK=/tmp/bitcoin.testnet.mempool
|
||||
MEMPOOL_TESTNET4_HTTP_HOST=127.0.0.1
|
||||
MEMPOOL_TESTNET4_HTTP_PORT=8990
|
||||
|
||||
# set either socket or TCP host/port, not both
|
||||
#MEMPOOL_BISQ_HTTP_SOCK=/tmp/bitcoin.bisq.mempool
|
||||
MEMPOOL_BISQ_HTTP_HOST=127.0.0.1
|
||||
@@ -231,6 +249,7 @@ MYSQL_GROUP=mysql
|
||||
# mempool mysql user/password
|
||||
MEMPOOL_MAINNET_USER='mempool'
|
||||
MEMPOOL_TESTNET_USER='mempool_testnet'
|
||||
MEMPOOL_TESTNET4_USER='mempool_testnet4'
|
||||
MEMPOOL_SIGNET_USER='mempool_signet'
|
||||
MEMPOOL_MAINNET_LIGHTNING_USER='mempool_mainnet_lightning'
|
||||
MEMPOOL_TESTNET_LIGHTNING_USER='mempool_testnet_lightning'
|
||||
@@ -241,6 +260,7 @@ MEMPOOL_BISQ_USER='mempool_bisq'
|
||||
# generate random hex string
|
||||
MEMPOOL_MAINNET_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
|
||||
MEMPOOL_TESTNET_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
|
||||
MEMPOOL_TESTNET4_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}')
|
||||
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}')
|
||||
@@ -265,7 +285,9 @@ BITCOIN_HOME=/bitcoin
|
||||
|
||||
# bitcoin testnet data
|
||||
BITCOIN_TESTNET_DATA=${BITCOIN_HOME}/testnet3
|
||||
# bitcoin testnet data
|
||||
# bitcoin testnet4 data
|
||||
BITCOIN_TESTNET4_DATA=${BITCOIN_HOME}/testnet4
|
||||
# bitcoin signet data
|
||||
BITCOIN_SIGNET_DATA=${BITCOIN_HOME}/signet
|
||||
|
||||
# bitcoin electrs source/binaries
|
||||
@@ -279,6 +301,9 @@ ELECTRS_MAINNET_DATA=${ELECTRS_DATA_ROOT}/mainnet
|
||||
# bitcoin testnet electrs database, only a few GB
|
||||
ELECTRS_TESTNET_ZPOOL=${ZPOOL}
|
||||
ELECTRS_TESTNET_DATA=${ELECTRS_DATA_ROOT}/testnet
|
||||
# bitcoin testnet4 electrs database, only a few GB
|
||||
ELECTRS_TESTNET4_ZPOOL=${ZPOOL}
|
||||
ELECTRS_TESTNET4_DATA=${ELECTRS_DATA_ROOT}/testnet4
|
||||
# bitcoin signet electrs database, only a few GB
|
||||
ELECTRS_SIGNET_ZPOOL=${ZPOOL}
|
||||
ELECTRS_SIGNET_DATA=${ELECTRS_DATA_ROOT}/signet
|
||||
@@ -332,7 +357,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=v25.1
|
||||
BITCOIN_LATEST_RELEASE=v28.0
|
||||
echo -n '.'
|
||||
|
||||
BISQ_REPO_URL=https://github.com/bisq-network/bisq
|
||||
@@ -392,9 +417,9 @@ 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 llvm10 jq base64 libzmq4)
|
||||
FREEBSD_PKG+=(openssh-portable py311-pip rust llvm17 jq base64 libzmq4)
|
||||
FREEBSD_PKG+=(boost-libs autoconf automake gmake gcc libevent libtool pkgconf)
|
||||
FREEBSD_PKG+=(nginx rsync py39-certbot-nginx mariadb1011-server keybase)
|
||||
FREEBSD_PKG+=(nginx rsync py311-certbot-nginx mariadb1011-server)
|
||||
FREEBSD_PKG+=(geoipupdate redis)
|
||||
|
||||
FREEBSD_UNFURL_PKG=()
|
||||
@@ -567,6 +592,15 @@ zfsCreateFilesystems()
|
||||
done
|
||||
fi
|
||||
|
||||
# Bitcoin Testnet4
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
zfs create -o "mountpoint=${BITCOIN_TESTNET4_DATA}" "${ZPOOL}/bitcoin/testnet4"
|
||||
for folder in chainstate indexes blocks
|
||||
do
|
||||
zfs create -o "mountpoint=${BITCOIN_TESTNET4_DATA}/${folder}" "${ZPOOL}/bitcoin/testnet4/${folder}"
|
||||
done
|
||||
fi
|
||||
|
||||
# Bitcoin Signet
|
||||
if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
zfs create -o "mountpoint=${BITCOIN_SIGNET_DATA}" "${ZPOOL}/bitcoin/signet"
|
||||
@@ -594,6 +628,15 @@ zfsCreateFilesystems()
|
||||
done
|
||||
fi
|
||||
|
||||
# electrs testnet4 data
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
zfs create -o "mountpoint=${ELECTRS_TESTNET4_DATA}" "${ELECTRS_TESTNET4_ZPOOL}/electrs/testnet4"
|
||||
for folder in cache history txstore
|
||||
do
|
||||
zfs create -o "mountpoint=${ELECTRS_TESTNET4_DATA}/newindex/${folder}" "${ELECTRS_TESTNET4_ZPOOL}/electrs/testnet4/${folder}"
|
||||
done
|
||||
fi
|
||||
|
||||
# electrs signet data
|
||||
if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
zfs create -o "mountpoint=${ELECTRS_SIGNET_DATA}" "${ELECTRS_SIGNET_ZPOOL}/electrs/signet"
|
||||
@@ -651,6 +694,15 @@ ext4CreateDir()
|
||||
done
|
||||
fi
|
||||
|
||||
# Bitcoin Testnet4
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
mkdir -p "${BITCOIN_TESTNET4_DATA}"
|
||||
for folder in chainstate indexes blocks
|
||||
do
|
||||
mkdir -p "${BITCOIN_TESTNET4_DATA}/${folder}"
|
||||
done
|
||||
fi
|
||||
|
||||
# Bitcoin Signet
|
||||
if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
mkdir -p "${BITCOIN_SIGNET_DATA}"
|
||||
@@ -678,6 +730,15 @@ ext4CreateDir()
|
||||
done
|
||||
fi
|
||||
|
||||
# electrs testnet4 data
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
mkdir -p "${ELECTRS_TESTNET4_DATA}"
|
||||
for folder in cache history txstore
|
||||
do
|
||||
mkdir -p "${ELECTRS_TESTNET4_DATA}/newindex/${folder}"
|
||||
done
|
||||
fi
|
||||
|
||||
# electrs signet data
|
||||
if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
mkdir -p "${ELECTRS_SIGNET_DATA}"
|
||||
@@ -769,6 +830,7 @@ LN-Mainnet:Enable Bitcoin Mainnet Lightning:ON
|
||||
LN-Testnet:Enable Bitcoin Testnet Lightning:ON
|
||||
LN-Signet:Enable Bitcoin Signet Lightning:ON
|
||||
Testnet:Enable Bitcoin Testnet:ON
|
||||
Testnet4:Enable Bitcoin Testnet4:ON
|
||||
Signet:Enable Bitcoin Signet:ON
|
||||
Liquid:Enable Elements Liquid:ON
|
||||
Liquidtestnet:Enable Elements Liquidtestnet:ON
|
||||
@@ -818,13 +880,19 @@ else
|
||||
BITCOIN_TESTNET_ENABLE=OFF
|
||||
fi
|
||||
|
||||
if grep Testnet4 $tempfile >/dev/null 2>&1;then
|
||||
BITCOIN_TESTNET4_ENABLE=ON
|
||||
else
|
||||
BITCOIN_TESTNET4_ENABLE=OFF
|
||||
fi
|
||||
|
||||
if grep Signet $tempfile >/dev/null 2>&1;then
|
||||
BITCOIN_SIGNET_ENABLE=ON
|
||||
else
|
||||
BITCOIN_SIGNET_ENABLE=OFF
|
||||
fi
|
||||
|
||||
if [ "${BITCOIN_MAINNET_ENABLE}" = ON -o "${BITCOIN_MAINNET_MINFEE_ENABLE}" = ON -o "${BITCOIN_TESTNET_ENABLE}" = ON -o "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
if [ "${BITCOIN_MAINNET_ENABLE}" = ON -o "${BITCOIN_MAINNET_MINFEE_ENABLE}" = ON -o "${BITCOIN_TESTNET_ENABLE}" = ON -o "${BITCOIN_TESTNET4_ENABLE}" = ON -o "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
BITCOIN_INSTALL=ON
|
||||
else
|
||||
BITCOIN_INSTALL=OFF
|
||||
@@ -872,7 +940,7 @@ else
|
||||
CLN_INSTALL=OFF
|
||||
fi
|
||||
|
||||
if [ "${BITCOIN_MAINNET_ENABLE}" = ON -o "${BITCOIN_TESTNET_ENABLE}" = ON -o "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
if [ "${BITCOIN_MAINNET_ENABLE}" = ON -o "${BITCOIN_TESTNET_ENABLE}" = ON -o "${BITCOIN_TESTNET4_ENABLE}" = ON -o "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
BITCOIN_ELECTRS_INSTALL=ON
|
||||
else
|
||||
BITCOIN_ELECTRS_INSTALL=OFF
|
||||
@@ -1216,6 +1284,9 @@ if [ "${BITCOIN_ELECTRS_INSTALL}" = ON ];then
|
||||
if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
|
||||
osSudo "${ROOT_USER}" chown -R "${BITCOIN_USER}:${BITCOIN_GROUP}" "${ELECTRS_TESTNET_DATA}"
|
||||
fi
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
osSudo "${ROOT_USER}" chown -R "${BITCOIN_USER}:${BITCOIN_GROUP}" "${ELECTRS_TESTNET4_DATA}"
|
||||
fi
|
||||
if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
osSudo "${ROOT_USER}" chown -R "${BITCOIN_USER}:${BITCOIN_GROUP}" "${ELECTRS_SIGNET_DATA}"
|
||||
fi
|
||||
@@ -1520,7 +1591,7 @@ fi
|
||||
# Bitcoin instance for Mainnet Minfee #
|
||||
#######################################
|
||||
|
||||
if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
|
||||
if [ "${BITCOIN_MAINNET_MINFEE_ENABLE}" = ON ];then
|
||||
echo "[*] Installing Bitcoin Minfee service"
|
||||
case $OS in
|
||||
|
||||
@@ -1550,6 +1621,23 @@ if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
|
||||
esac
|
||||
fi
|
||||
|
||||
#################################
|
||||
# Bitcoin instance for Testnet4 #
|
||||
#################################
|
||||
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
echo "[*] Installing Bitcoin Testnet service"
|
||||
case $OS in
|
||||
|
||||
FreeBSD)
|
||||
;;
|
||||
|
||||
Debian)
|
||||
osSudo "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/linux/bitcoin-testnet4.service" "${DEBIAN_SERVICE_HOME}"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
###############################
|
||||
# Bitcoin instance for Signet #
|
||||
###############################
|
||||
@@ -1616,6 +1704,14 @@ if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
|
||||
echo "[*] FIXME: must only crontab enabled daemons"
|
||||
fi
|
||||
|
||||
#########################################
|
||||
# Electrs instance for Bitcoin Testnet4 #
|
||||
#########################################
|
||||
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
echo "[*] FIXME: must only crontab enabled daemons"
|
||||
fi
|
||||
|
||||
#######################################
|
||||
# Electrs instance for Bitcoin Signet #
|
||||
#######################################
|
||||
@@ -1668,11 +1764,15 @@ case $OS in
|
||||
echo "[*] Installing Electrs Testnet Cronjob"
|
||||
crontab_bitcoin+="@reboot sleep 70 ; screen -dmS testnet /bitcoin/electrs/start testnet\n"
|
||||
fi
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
echo "[*] Installing Electrs Testnet4 Cronjob"
|
||||
crontab_bitcoin+="@reboot sleep 110 ; screen -dmS testnet4 /bitcoin/electrs/start testnet4\n"
|
||||
fi
|
||||
if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
echo "[*] Installing Electrs Signet Cronjob"
|
||||
crontab_bitcoin+="@reboot sleep 90 ; screen -dmS signet /bitcoin/electrs/start signet\n"
|
||||
fi
|
||||
if [ "${BITCOIN_MAINNET_ENABLE}" = ON -o "${BITCOIN_TESTNET_ENABLE}" = ON -o "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
if [ "${BITCOIN_MAINNET_ENABLE}" = ON -o "${BITCOIN_TESTNET_ENABLE}" = ON -o "${BITCOIN_TESTNET4_ENABLE}" = ON -o "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
echo "${crontab_bitcoin}" | crontab -u "${BITCOIN_USER}" -
|
||||
fi
|
||||
|
||||
@@ -1700,7 +1800,7 @@ fi
|
||||
|
||||
##### Mempool -> Bitcoin Mainnet instance
|
||||
|
||||
if [ "${BITCOIN_MAINNET_ENABLE}" = ON -o "${BITCOIN_TESTNET_ENABLE}" = ON -o "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
if [ "${BITCOIN_MAINNET_ENABLE}" = ON -o "${BITCOIN_TESTNET_ENABLE}" = ON -o "${BITCOIN_TESTNET4_ENABLE}" = ON -o "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
echo "[*] Creating Mempool instance for 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"
|
||||
@@ -1727,6 +1827,15 @@ if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
|
||||
osSudo "${MEMPOOL_USER}" sh -c "cd ${MEMPOOL_HOME}/testnet && git checkout ${MEMPOOL_LATEST_RELEASE}"
|
||||
fi
|
||||
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
echo "[*] Creating Mempool instance for Bitcoin Testnet4"
|
||||
osSudo "${MEMPOOL_USER}" git config --global advice.detachedHead false
|
||||
osSudo "${MEMPOOL_USER}" git clone --branch "${MEMPOOL_REPO_BRANCH}" "${MEMPOOL_REPO_URL}" "${MEMPOOL_HOME}/testnet4"
|
||||
|
||||
echo "[*] Checking out Mempool ${MEMPOOL_LATEST_RELEASE} for Bitcoin Testnet4"
|
||||
osSudo "${MEMPOOL_USER}" sh -c "cd ${MEMPOOL_HOME}/testnet4 && git checkout ${MEMPOOL_LATEST_RELEASE}"
|
||||
fi
|
||||
|
||||
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
|
||||
@@ -1804,6 +1913,9 @@ grant all on mempool.* to '${MEMPOOL_MAINNET_USER}'@'localhost' identified by '$
|
||||
create database mempool_testnet;
|
||||
grant all on mempool_testnet.* to '${MEMPOOL_TESTNET_USER}'@'localhost' identified by '${MEMPOOL_TESTNET_PASS}';
|
||||
|
||||
create database mempool_testnet4;
|
||||
grant all on mempool_testnet4.* to '${MEMPOOL_TESTNET4_USER}'@'localhost' identified by '${MEMPOOL_TESTNET4_PASS}';
|
||||
|
||||
create database mempool_signet;
|
||||
grant all on mempool_signet.* to '${MEMPOOL_SIGNET_USER}'@'localhost' identified by '${MEMPOOL_SIGNET_PASS}';
|
||||
|
||||
@@ -1832,6 +1944,8 @@ 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_TESTNET4_USER="${MEMPOOL_TESTNET4_USER}"
|
||||
declare -x MEMPOOL_TESTNET4_PASS="${MEMPOOL_TESTNET4_PASS}"
|
||||
declare -x MEMPOOL_SIGNET_USER="${MEMPOOL_SIGNET_USER}"
|
||||
declare -x MEMPOOL_SIGNET_PASS="${MEMPOOL_SIGNET_PASS}"
|
||||
declare -x MEMPOOL_MAINNET_LIGHTNING_USER="${MEMPOOL_MAINNET_LIGHTNING_USER}"
|
||||
@@ -1900,9 +2014,9 @@ case $OS in
|
||||
moused_nondefault_enable="NO"
|
||||
|
||||
nginx_enable="YES"
|
||||
nginx_profiles="mempool"
|
||||
nginx_mempool_flags="-p /mempool"
|
||||
nginx_mempool_configfile="/mempool/mempool/nginx/nginx.conf"
|
||||
#nginx_profiles="mempool"
|
||||
#nginx_mempool_flags="-p /mempool"
|
||||
#nginx_mempool_configfile="/mempool/mempool.space/nginx/nginx.conf"
|
||||
|
||||
mysql_enable="YES"
|
||||
mysql_dbdir="/mysql"
|
||||
@@ -1932,6 +2046,9 @@ EOF
|
||||
if [ "${BITCOIN_TESTNET_ENABLE}" = ON ];then
|
||||
osSudo "${ROOT_USER}" systemctl enable bitcoin-testnet.service
|
||||
fi
|
||||
if [ "${BITCOIN_TESTNET4_ENABLE}" = ON ];then
|
||||
osSudo "${ROOT_USER}" systemctl enable bitcoin-testnet4.service
|
||||
fi
|
||||
if [ "${BITCOIN_SIGNET_ENABLE}" = ON ];then
|
||||
osSudo "${ROOT_USER}" systemctl enable bitcoin-signet.service
|
||||
fi
|
||||
|
||||
22
production/linux/bitcoin-testnet4.service
Normal file
22
production/linux/bitcoin-testnet4.service
Normal file
@@ -0,0 +1,22 @@
|
||||
[Unit]
|
||||
Description=Bitcoind-testnet4
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/bitcoind -conf=bitcoin.conf -daemon -testnet4 -printtoconsole -pid=/bitcoin/bitcoind-testnet4.pid
|
||||
ExecStop=/usr/local/bin/bitcoin-cli -testnet4 stop
|
||||
|
||||
Type=forking
|
||||
PIDFile=/bitcoin/bitcoind-testnet4.pid
|
||||
Restart=on-failure
|
||||
|
||||
User=bitcoin
|
||||
Group=bitcoin
|
||||
|
||||
PrivateTmp=true
|
||||
ProtectSystem=full
|
||||
NoNewPrivileges=true
|
||||
PrivateDevices=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -40,7 +40,7 @@ update_repo()
|
||||
git fetch origin || exit 1
|
||||
for remote in origin;do
|
||||
git remote add "${remote}" "https://github.com/${remote}/mempool" >/dev/null 2>&1
|
||||
git fetch "${remote}" || exit 1
|
||||
git fetch "${remote}" --tags || exit 1
|
||||
done
|
||||
|
||||
if [ $(git tag -l "${REF}") ];then
|
||||
@@ -131,7 +131,7 @@ export NVM_DIR="${HOME}/.nvm"
|
||||
source "${NVM_DIR}/nvm.sh"
|
||||
|
||||
# what to look for
|
||||
frontends=(mainnet liquid onbtc bitb)
|
||||
frontends=(mainnet liquid onbtc bitb meta)
|
||||
backends=(mainnet testnet testnet4 signet liquid liquidtestnet onbtc bitb)
|
||||
frontend_repos=()
|
||||
backend_repos=()
|
||||
@@ -148,7 +148,7 @@ for repo in $backends;do
|
||||
done
|
||||
|
||||
# update all repos
|
||||
for repo in $backend_repos;do
|
||||
for repo in $frontend_repos $backend_repos;do
|
||||
update_repo "${repo}"
|
||||
done
|
||||
|
||||
|
||||
@@ -150,5 +150,9 @@
|
||||
"MEMPOOL_SERVICES": {
|
||||
"API": "https://mempool.space/api/v1/services",
|
||||
"ACCELERATIONS": true
|
||||
},
|
||||
"WALLETS": {
|
||||
"ENABLED": true,
|
||||
"WALLETS": ["BITB", "3350"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
"MEMPOOL_WEBSITE_URL": "https://mempool.space",
|
||||
"LIQUID_WEBSITE_URL": "https://liquid.network",
|
||||
"BISQ_WEBSITE_URL": "https://bisq.markets",
|
||||
"MAINNET_BLOCK_AUDIT_START_HEIGHT": 773911,
|
||||
"TESTNET_BLOCK_AUDIT_START_HEIGHT": 2417829,
|
||||
"SIGNET_BLOCK_AUDIT_START_HEIGHT": 127609,
|
||||
"MAINNET_TX_FIRST_SEEN_START_HEIGHT": 838316,
|
||||
"ITEMS_PER_PAGE": 25,
|
||||
"LIGHTNING": true,
|
||||
"ACCELERATOR": true,
|
||||
|
||||
19
production/mempool-frontend-config.meta.json
Normal file
19
production/mempool-frontend-config.meta.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"OFFICIAL_MEMPOOL_SPACE": true,
|
||||
"TESTNET_ENABLED": true,
|
||||
"TESTNET4_ENABLED": true,
|
||||
"LIQUID_ENABLED": true,
|
||||
"LIQUID_TESTNET_ENABLED": true,
|
||||
"BISQ_ENABLED": true,
|
||||
"BISQ_SEPARATE_BACKEND": true,
|
||||
"SIGNET_ENABLED": true,
|
||||
"MEMPOOL_WEBSITE_URL": "https://mempool.space",
|
||||
"LIQUID_WEBSITE_URL": "https://liquid.network",
|
||||
"BISQ_WEBSITE_URL": "https://bisq.markets",
|
||||
"ITEMS_PER_PAGE": 25,
|
||||
"LIGHTNING": true,
|
||||
"ACCELERATOR": true,
|
||||
"PUBLIC_ACCELERATIONS": true,
|
||||
"AUDIT": true,
|
||||
"CUSTOMIZATION": "custom-meta-config.json"
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env zsh
|
||||
rm $HOME/*/backend/mempool-config.json
|
||||
rm $HOME/*/frontend/mempool-frontend-config.json
|
||||
rm -f $HOME/*/backend/mempool-config.json
|
||||
rm -f $HOME/*/frontend/mempool-frontend-config.json
|
||||
rm -f $HOME/*/frontend/projects/mempool/mempool-frontend-config.json
|
||||
exit 0
|
||||
|
||||
@@ -15,7 +15,7 @@ screen -dmS x startx
|
||||
sleep 3
|
||||
|
||||
# start unfurlers for each frontend
|
||||
for site in mainnet liquid onbtc bitb;do
|
||||
for site in mainnet liquid onbtc bitb meta;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'
|
||||
|
||||
1
production/mempool-update-repo
Executable file
1
production/mempool-update-repo
Executable file
@@ -0,0 +1 @@
|
||||
cd ~/mempool && git pull origin master && cd ~/mempool.space && git stash && git pull origin master && git stash pop ; exit
|
||||
@@ -32,6 +32,7 @@ map $http_accept_language $header_lang {
|
||||
~*^vi vi;
|
||||
~*^zh zh;
|
||||
~*^lt lt;
|
||||
~*^hr hr;
|
||||
}
|
||||
map $cookie_lang $lang {
|
||||
default $header_lang;
|
||||
@@ -67,4 +68,5 @@ map $cookie_lang $lang {
|
||||
~*^vi vi;
|
||||
~*^zh zh;
|
||||
~*^lt lt;
|
||||
~*^hr hr;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
# routing #
|
||||
###########
|
||||
|
||||
location /api/v1/accelerations {
|
||||
try_files /dev/null @mempool-api-v1-services-cache-short;
|
||||
}
|
||||
location /api/v1/assets {
|
||||
try_files /dev/null @mempool-api-v1-services-cache-short;
|
||||
}
|
||||
@@ -95,6 +92,7 @@ location @mempool-api-v1-services-cache-disabled-addcors {
|
||||
set $cors_methods 'GET, POST, PUT, DELETE, OPTIONS';
|
||||
set $cors_origin 'https://mempool.space';
|
||||
set $cors_headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
|
||||
set $cors_expose_headers 'X-Total-Count';
|
||||
set $cors_credentials 'true';
|
||||
|
||||
# set CORS for approved hostnames
|
||||
@@ -103,6 +101,7 @@ location @mempool-api-v1-services-cache-disabled-addcors {
|
||||
set $cors_methods 'GET, POST, PUT, DELETE, OPTIONS';
|
||||
set $cors_origin "$http_origin";
|
||||
set $cors_headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
|
||||
set $cors_expose_headers 'X-Total-Count';
|
||||
set $cors_credentials 'true';
|
||||
}
|
||||
|
||||
@@ -111,6 +110,7 @@ location @mempool-api-v1-services-cache-disabled-addcors {
|
||||
add_header Access-Control-Allow-Origin "$cors_origin" always;
|
||||
add_header Access-Control-Allow-Headers "$cors_headers" always;
|
||||
add_header Access-Control-Allow-Credentials "$cors_credentials" always;
|
||||
add_header Access-Control-Expose-Headers "$cors_expose_headers" always;
|
||||
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
@@ -175,6 +175,7 @@ location @mempool-api-v1-services-cache-short-addcors {
|
||||
set $cors_methods 'GET, POST, PUT, DELETE, OPTIONS';
|
||||
set $cors_origin 'https://mempool.space';
|
||||
set $cors_headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
|
||||
set $cors_expose_headers 'X-Total-Count';
|
||||
set $cors_credentials 'true';
|
||||
|
||||
# set CORS for approved hostnames
|
||||
@@ -183,6 +184,7 @@ location @mempool-api-v1-services-cache-short-addcors {
|
||||
set $cors_methods 'GET, POST, PUT, DELETE, OPTIONS';
|
||||
set $cors_origin "$http_origin";
|
||||
set $cors_headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
|
||||
set $cors_expose_headers 'X-Total-Count';
|
||||
set $cors_credentials 'true';
|
||||
}
|
||||
|
||||
@@ -191,6 +193,7 @@ location @mempool-api-v1-services-cache-short-addcors {
|
||||
add_header Access-Control-Allow-Origin "$cors_origin" always;
|
||||
add_header Access-Control-Allow-Headers "$cors_headers" always;
|
||||
add_header Access-Control-Allow-Credentials "$cors_credentials" always;
|
||||
add_header Access-Control-Expose-Headers "$cors_expose_headers" always;
|
||||
|
||||
# add our own cache headers
|
||||
add_header 'Pragma' 'public';
|
||||
|
||||
@@ -32,6 +32,9 @@ location /api/v1/mining {
|
||||
location /api/v1/fees/recommended {
|
||||
try_files /dev/null @mempool-api-v1-cache-hot;
|
||||
}
|
||||
location /api/v1/accelerations {
|
||||
try_files /dev/null @mempool-api-v1-cache-hot;
|
||||
}
|
||||
|
||||
# it's ok to cache blockchain data "forever", so we do 30d
|
||||
location /api/v1/block/ {
|
||||
@@ -52,10 +55,10 @@ location /api/block/ {
|
||||
rewrite ^/api/(.*) /$1 break;
|
||||
try_files /dev/null @esplora-api-cache-forever;
|
||||
}
|
||||
# other API responses cannot be cached
|
||||
# we cache for 1s to mitigate DoS attacks
|
||||
location /api/ {
|
||||
rewrite ^/api/(.*) /$1 break;
|
||||
try_files /dev/null @esplora-api-cache-disabled;
|
||||
try_files /dev/null @esplora-api-cache-minimal;
|
||||
}
|
||||
|
||||
###########
|
||||
@@ -168,6 +171,23 @@ location @esplora-api-cache-disabled {
|
||||
expires -1;
|
||||
}
|
||||
|
||||
location @esplora-api-cache-minimal {
|
||||
proxy_pass $esploraMainnet;
|
||||
|
||||
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 apihot;
|
||||
proxy_cache_valid 200 1s;
|
||||
proxy_redirect off;
|
||||
|
||||
expires 1s;
|
||||
}
|
||||
|
||||
location @esplora-api-cache-forever {
|
||||
proxy_pass $esploraMainnet;
|
||||
|
||||
|
||||
@@ -47,10 +47,10 @@ location /testnet/api/block/ {
|
||||
rewrite ^/testnet/api/(.*) /$1 break;
|
||||
try_files /dev/null @esplora-testnet-api-cache-forever;
|
||||
}
|
||||
# other API responses cannot be cached
|
||||
# we cache for 1s to mitigate DoS attacks
|
||||
location /testnet/api/ {
|
||||
rewrite ^/testnet/api/(.*) /$1 break;
|
||||
try_files /dev/null @esplora-testnet-api-cache-disabled;
|
||||
try_files /dev/null @esplora-testnet-api-cache-minimal;
|
||||
}
|
||||
|
||||
###########
|
||||
@@ -160,3 +160,20 @@ location @esplora-testnet-api-cache-forever {
|
||||
|
||||
expires 30d;
|
||||
}
|
||||
|
||||
location @esplora-testnet-api-cache-minimal {
|
||||
proxy_pass $esploraTestnet;
|
||||
|
||||
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 off;
|
||||
proxy_cache_use_stale error;
|
||||
proxy_cache apihot;
|
||||
proxy_cache_valid 200 1s;
|
||||
proxy_redirect off;
|
||||
|
||||
expires 1s;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ http {
|
||||
#listen [::]:443 ssl http2;
|
||||
server_name _;
|
||||
|
||||
# set cors headers if necessary
|
||||
set $cors_approved_origin '';
|
||||
|
||||
# tor v3
|
||||
listen 127.0.0.1:81;
|
||||
set $onion "__NGINX_MEMPOOL_ONION__";
|
||||
@@ -80,6 +83,9 @@ http {
|
||||
#listen [::]:443 ssl http2;
|
||||
server_name _;
|
||||
|
||||
# set cors headers if necessary
|
||||
set $cors_approved_origin '';
|
||||
|
||||
# tor v3
|
||||
listen 127.0.0.1:83;
|
||||
set $onion "__NGINX_LIQUID_ONION__";
|
||||
|
||||
@@ -8,8 +8,11 @@ add_header Onion-Location http://$onion.onion$request_uri;
|
||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
|
||||
|
||||
# generate frame configuration from origin header
|
||||
set $frameOptions "DENY";
|
||||
set $contentSecurityPolicy "frame-ancestors 'none'";
|
||||
if ($frameOptions = '')
|
||||
{
|
||||
set $frameOptions "DENY";
|
||||
set $contentSecurityPolicy "frame-ancestors 'none'";
|
||||
}
|
||||
|
||||
# used for iframes on https://mempool.space/network
|
||||
if ($http_referer ~ ^https://mempool.space/)
|
||||
|
||||
17
production/unfurler-config.meta.json
Normal file
17
production/unfurler-config.meta.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"SERVER": {
|
||||
"HOST": "https://metaplanet.mempool.space",
|
||||
"HTTP_PORT": 8005
|
||||
},
|
||||
"MEMPOOL": {
|
||||
"HTTP_HOST": "http://127.0.0.1",
|
||||
"HTTP_PORT": 85,
|
||||
"NETWORK": "meta"
|
||||
},
|
||||
"PUPPETEER": {
|
||||
"CLUSTER_SIZE": 8,
|
||||
"EXEC_PATH": "/usr/local/bin/chrome",
|
||||
"MAX_PAGE_AGE": 86400,
|
||||
"RENDER_TIMEOUT": 3000
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user