cores: use new updater

This commit is contained in:
nahuhh 2025-01-13 23:42:08 +00:00
parent 6cd8be6926
commit a3b7271fb3
3 changed files with 2 additions and 67 deletions

View file

@ -34,7 +34,7 @@ else
echo "Updating basicswap-bash scripts" && sleep 1
if [[ -d basicswap-bash ]]; then
cd basicswap-bash
git pull || { $red"Failed to clone repo. Cancelling update.\n"; exit; }
git pull || { $red"Failed to update repo. Cancelling update.\n"; exit; }
else
git clone https://github.com/nahuhh/basicswap-bash || { $red"Failed to clone repo. Cancelling update.\n"; exit; }
cd basicswap-bash
@ -44,9 +44,6 @@ else
rm -rf $HOME/.local/bin/bsx $HOME/.local/bin/basicswap-bash
cp -r basic* bsx* $HOME/.local/bin/
# Copy core_versions to basicswap folder
mv core_versions $SWAP_DATADIR/basicswap/core_versions
# Update BasicSwap, coincurve and coin cores
./bsx/update.sh
fi

View file

@ -1,54 +1,3 @@
#!/bin/bash
#set -x
export SWAP_DATADIR=$HOME/coinswaps
if [[ $USER == amnesia ]]; then
export SWAP_DATADIR=$HOME/Persistent/coinswaps
fi
BINDIR=$SWAP_DATADIR/bin
echo "Checking for Coin updates" && sleep 1
chain=(
bitcoin
bitcoincash
dash
decred
firo
litecoin
particl
pivx
monero
wownero
)
list=""
select=""
for coin in "${chain[@]}"; do
if [[ $coin == bitcoincash ]]; then
coind="bitcoin"
elif [[ $coin == decred ]]; then
coind="dcr"
else
coind="$coin"
fi
if [[ -d $BINDIR/$coin ]]; then
UPDATE=$($BINDIR/$coin/"$coind"d --version | head -n 1 | grep -Fxf $SWAP_DATADIR/basicswap/core_versions)
if [[ -z $UPDATE ]]; then
select+="$coin,"
list="${select%,}"
fi
fi
done
if [[ -n $list ]]; then
withoutCoins=""
if [[ ! $list =~ "particl" ]]; then
withoutCoins="--withoutcoins=particl"
fi
echo "Updating $list"
. $SWAP_DATADIR/venv/bin/activate
basicswap-prepare --datadir=$SWAP_DATADIR --preparebinonly --withcoins=$list "${withoutCoins}"
else
echo "Coin Cores are up to date"
fi
basicswap-prepare --datadir=$SWAP_DATADIR --upgradecores

View file

@ -1,11 +0,0 @@
Bitcoin Core version v28.0.0
Bitcoin Cash Node Daemon version v27.1.0-9f9aa5a6e
Dash Core version v22.0.0
dcrd version 1.8.1+release (Go version go1.21.1 linux/amd64)
Dogecoin Core version v23.2.1
Firo Core Daemon version v0.14.14.0-ge0c423805
Litecoin Core version v0.21.4
Particl Core version v23.2.7.0
PIVX Core Daemon version v5.6.1.0-af60f19642
Monero 'Fluorine Fermi' (v0.18.3.4-release)
Wownero 'Kunty Karen' (v0.11.3.0-release)