From 4d46146657613d96681d186a81865a0ffc6eefc0 Mon Sep 17 00:00:00 2001 From: nahuhh <50635951+nahuhh@users.noreply.github.com> Date: Mon, 16 Sep 2024 00:14:47 +0000 Subject: [PATCH] update cores --- bsx/auto_coinupd8.sh | 85 ++++++++++++++++++++++++++++++++++++++++++++ bsx/update.sh | 22 ++++++++---- core_versions | 9 +++++ 3 files changed, 109 insertions(+), 7 deletions(-) create mode 100755 bsx/auto_coinupd8.sh create mode 100644 core_versions diff --git a/bsx/auto_coinupd8.sh b/bsx/auto_coinupd8.sh new file mode 100755 index 0000000..b04c8ca --- /dev/null +++ b/bsx/auto_coinupd8.sh @@ -0,0 +1,85 @@ +#!/bin/bash +#set -x + +SWAP_DATADIR=$HOME/coinswaps +echo "Checking for Coin updates" && sleep 1 + +if [[ -d $SWAP_DATADIR/bin/bitcoin ]]; then + BTC=$($SWAP_DATADIR/bin/bitcoin/bitcoind --version | grep version | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + if [[ -z $BTC ]]; then + echo "Updating Bitcoin" + Bitcoin="bitcoin," + fi +fi + +if [[ -d $SWAP_DATADIR/bin/dash ]]; then + DASH=$($SWAP_DATADIR/bin/dash/dashd --version | grep version | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + if [[ -z $DASH ]]; then + echo "Updating Dash" + Dash="dash," + fi +fi + +if [[ -d $SWAP_DATADIR/bin/decred ]]; then + DCR=$($SWAP_DATADIR/bin/decred/dcrd --version | grep version | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + if [[ -z $DCR ]]; then + echo "Updating Decred" + Decred="decred," + fi +fi + +if [[ -d $SWAP_DATADIR/bin/firo ]]; then + FIRO=$($SWAP_DATADIR/bin/firo/firod --version | grep version | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + if [[ -z $FIRO ]]; then + echo "Updating Firo" + Firo="firo," + fi +fi + +if [[ -d $SWAP_DATADIR/bin/litecoin ]]; then + LTC=$($SWAP_DATADIR/bin/litecoin/litecoind --version | grep version | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + if [[ -z $LTC ]]; then + echo "Updating Litecoin" + Litecoin="litecoin," + fi +fi + +if [[ -d $SWAP_DATADIR/bin/particl ]]; then + PART=$($SWAP_DATADIR/bin/particl/particld --version | grep version | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + if [[ -z $PART ]]; then + echo "Updating Particl" + fi +fi + +if [[ -d $SWAP_DATADIR/bin/pivx ]]; then + PIVX=$($SWAP_DATADIR/bin/pivx/pivxd --version | grep version | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + if [[ -z $PIVX ]]; then + echo "Updating PIVX" + Pivx="pivx," + fi +fi + +if [[ -d $SWAP_DATADIR/bin/monero ]]; then + XMR=$($SWAP_DATADIR/bin/monero/monerod --version | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + if [[ -z $XMR ]]; then + echo "Updating Monero" + Monero="monero," + fi +fi + +if [[ -d $SWAP_DATADIR/bin/wownero ]]; then + WOW=$($SWAP_DATADIR/bin/wownero/wownerod --version | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + if [[ -z $WOW ]]; then + echo "Updating Wownero" + Wownero="wownero," + fi +fi + +sleep 1 + +if [[ -n $Bitcoin ]] || [[ -n $Dash ]] || [[ -n $Decred ]] || [[ -n $Firo ]] || [[ -n $Litecoin ]] || [[ -n $Particl ]] || [[ -n $Pivx ]] || [[ -n $Monero ]] || [[ -n $Wownero ]]; then + . $SWAP_DATADIR/venv/bin/activate + basicswap-prepare --datadir=$SWAP_DATADIR --preparebinonly --withcoins="$Bitcoin$Dash$Decred$Firo$Litecoin$Pivx$Monero$Wownero"particl +else + echo "Coin Cores are up to date" +fi diff --git a/bsx/update.sh b/bsx/update.sh index cea2f21..2cd07d4 100755 --- a/bsx/update.sh +++ b/bsx/update.sh @@ -5,21 +5,29 @@ cd $SWAP_DATADIR/basicswap echo "Updating basicswap-bash scripts" && sleep 1 git clone https://github.com/nahuhh/basicswap-bash -b dev cd basicswap-bash + # Move scripts rm -rf $HOME/.local/bin/bsx mv -f basic* bsx* $HOME/.local/bin/ -# Cleanup install -cd $SWAP_DATADIR/basicswap -rm -rf basicswap-bash + +# Copy core_versions to basicswap folder +mv core_versions $SWAP_DATADIR/basicswap/core_versions echo "Updating BasicSwapDEX" && sleep 1 # Delete dangling build folder. Same as --no-cache for docker rm -rf $SWAP_DATADIR/basicswap/build + # Switch to new repo: basicswap/basicswap +cd $SWAP_DATADIR/basicswap git remote set-url origin https://github.com/basicswap/basicswap -# Fix conflicts from force-pushes and rebase -git checkout master -# Pull repo +# git checkout master git pull -# Install + +# Update BasicSwap $SWAP_DATADIR/venv/bin/pip install . + +# Update Coin Cores +$HOME/.local/bin/bsx/auto_coinupd8.sh + +# Cleanup +rm -rf basicswap-bash core_versions diff --git a/core_versions b/core_versions new file mode 100644 index 0000000..3d30bf9 --- /dev/null +++ b/core_versions @@ -0,0 +1,9 @@ +Bitcoin Core version v26.0.0 +dcrd version 1.8.1+release (Go version go1.21.1 linux/amd64) +Dash Core version v20.0.2 +Firo Core Daemon version v0.14.14.0-ge0c423805 +Litecoin Core version v0.21.3 +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.1.0-release)