Skip to content

Commit

Permalink
ops: Set UTXO and history limit based on hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz committed Sep 30, 2023
1 parent 52001bf commit 09a11b1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
20 changes: 17 additions & 3 deletions electrs-start-mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@
#export PATH="${HOME}/.cargo/bin:${PATH}"

# don't bother making electrs.core files
ulimit -c
ulimit -c 0

# get credentials from bitcoin.conf directly
BITCOIN_RPC_USER=$(grep 'rpcuser=' ${HOME}/bitcoin.conf|cut -d = -f2|head -1)
BITCOIN_RPC_PASS=$(grep 'rpcpassword=' ${HOME}/bitcoin.conf|cut -d = -f2|head -1)
BITCOIN_RPC_USER=$(grep 'rpcuser=' "${HOME}/bitcoin.conf"|cut -d = -f2|head -1)
BITCOIN_RPC_PASS=$(grep 'rpcpassword=' "${HOME}/bitcoin.conf"|cut -d = -f2|head -1)

# base limits
UTXOS_LIMIT=500
ELECTRUM_TXS_LIMIT=500

# increase limits based on hostname
NODENAME=$(hostname|cut -d . -f1)
LOCATION=$(hostname|cut -d . -f2)
if [ "${NODENAME}" = "node201" ];then
UTXOS_LIMIT=9000
ELECTRUM_TXS_LIMIT=9000
fi

# run in loop in case of crash
until false
Expand All @@ -24,6 +36,8 @@ do
--cookie "${BITCOIN_RPC_USER}:${BITCOIN_RPC_PASS}" \
--cors '*' \
--address-search \
--utxos-limit "${UTXOS_LIMIT}" \
--electrum-txs-limit "${ELECTRUM_TXS_LIMIT}" \
-vvv
sleep 1
done
16 changes: 15 additions & 1 deletion electrs-start-signet
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@
#export PATH="${HOME}/.cargo/bin:${PATH}"

# don't bother making electrs.core files
ulimit -c
ulimit -c 0

# get credentials from bitcoin.conf directly
BITCOIN_RPC_USER=$(grep 'rpcuser=' "${HOME}/bitcoin.conf"|cut -d = -f2|head -1)
BITCOIN_RPC_PASS=$(grep 'rpcpassword=' "${HOME}/bitcoin.conf"|cut -d = -f2|head -1)

# base limits
UTXOS_LIMIT=500
ELECTRUM_TXS_LIMIT=500

# increase limits based on hostname
NODENAME=$(hostname|cut -d . -f1)
LOCATION=$(hostname|cut -d . -f2)
if [ "${NODENAME}" = "node201" ];then
UTXOS_LIMIT=9000
ELECTRUM_TXS_LIMIT=9000
fi

# run in loop in case of crash
until false
do
Expand All @@ -25,6 +37,8 @@ do
--cookie "${BITCOIN_RPC_USER}:${BITCOIN_RPC_PASS}" \
--cors '*' \
--address-search \
--utxos-limit "${UTXOS_LIMIT}" \
--electrum-txs-limit "${ELECTRUM_TXS_LIMIT}" \
-vvv
sleep 1
done
20 changes: 17 additions & 3 deletions electrs-start-testnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@
#export PATH="${HOME}/.cargo/bin:${PATH}"

# don't bother making electrs.core files
ulimit -c
ulimit -c 0

# get credentials from bitcoin.conf directly
BITCOIN_RPC_USER=$(grep 'rpcuser=' ${HOME}/bitcoin.conf|cut -d = -f2|head -1)
BITCOIN_RPC_PASS=$(grep 'rpcpassword=' ${HOME}/bitcoin.conf|cut -d = -f2|head -1)
BITCOIN_RPC_USER=$(grep 'rpcuser=' "${HOME}/bitcoin.conf"|cut -d = -f2|head -1)
BITCOIN_RPC_PASS=$(grep 'rpcpassword=' "${HOME}/bitcoin.conf"|cut -d = -f2|head -1)

# base limits
UTXOS_LIMIT=500
ELECTRUM_TXS_LIMIT=500

# increase limits based on hostname
NODENAME=$(hostname|cut -d . -f1)
LOCATION=$(hostname|cut -d . -f2)
if [ "${NODENAME}" = "node201" ];then
UTXOS_LIMIT=9000
ELECTRUM_TXS_LIMIT=9000
fi

# run in loop in case of crash
until false
Expand All @@ -25,6 +37,8 @@ do
--cookie "${BITCOIN_RPC_USER}:${BITCOIN_RPC_PASS}" \
--cors '*' \
--address-search \
--utxos-limit "${UTXOS_LIMIT}" \
--electrum-txs-limit "${ELECTRUM_TXS_LIMIT}" \
-vvv
sleep 1
done

0 comments on commit 09a11b1

Please sign in to comment.