coins: add bitcoincash

This commit is contained in:
nahuhh 2024-11-30 12:38:34 +00:00
parent b52b7e8c92
commit 7f8b90fea4
4 changed files with 19 additions and 13 deletions

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
## Prompt for user input ## Prompt for user input
printf "\n\nThe following coins can be added (case sensitive)\nbitcoin\ndash\ndecred\nfiro\nlitecoin\npivx\nwownero\n\n" printf "\n\nThe following coins can be added (case sensitive)\nbitcoin\nbitcoincash\ndash\ndecred\nfiro\nlitecoin\npivx\nwownero\n\n"
read -p 'Full name of coin to add [example: litecoin] ' addcoin read -p 'Full name of coin to add [example: litecoin] ' addcoin
## Confirm ## Confirm
read -p $'\nAdd '$addcoin' to your BasicSwap install, correct? Press ENTER to continue. CTRL-C to exit' read -p $'\nAdd '$addcoin' to your BasicSwap install, correct? Press ENTER to continue. CTRL-C to exit'

View file

@ -10,6 +10,7 @@ echo "Checking for Coin updates" && sleep 1
chain=( chain=(
bitcoin bitcoin
bitcoincash
dash dash
decred decred
firo firo
@ -23,22 +24,26 @@ wownero
list="" list=""
select="" select=""
for coin in "${chain[@]}"; do 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 if [[ -d $BINDIR/$coin ]]; then
if [[ $coin == decred ]]; then UPDATE=$($BINDIR/$coin/"$coind"d --version | head -n 1 | grep -Fxf $SWAP_DATADIR/basicswap/core_versions)
UPDATE=$($BINDIR/$coin/dcrd --version | head -n 1 | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) fi
else
UPDATE=$($BINDIR/$coin/"$coin"d --version | head -n 1 | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) if [[ -z $UPDATE ]]; then
fi select+="$coin,"
if [[ -z $UPDATE ]]; then list="${select%,}"
select+="$coin,"
list=${select%,}
fi
fi fi
done done
echo "Updating $list"
if [[ -n $select ]]; then if [[ -n $select ]]; then
echo "Updating $list"
. $SWAP_DATADIR/venv/bin/activate . $SWAP_DATADIR/venv/bin/activate
basicswap-prepare --datadir=$SWAP_DATADIR --preparebinonly --withcoins=$list basicswap-prepare --datadir=$SWAP_DATADIR --preparebinonly --withcoins=$list
else else

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
## Prompt for user input ## Prompt for user input
printf "\n\nThe following coins can be disabled (case sensitive)\nbitcoin\ndash\ndecred\nfiro\nlitecoin\nmonero\npivx\nwownero\n\n" printf "\n\nThe following coins can be disabled (case sensitive)\nbitcoin\nbitcoincash\ndash\ndecred\nfiro\nlitecoin\nmonero\npivx\nwownero\n\n"
read -p 'Full name of coin to disable [example: wownero] ' disablecoin read -p 'Full name of coin to disable [example: wownero] ' disablecoin
## Confirm ## Confirm
printf "\nDisable $disablecoin on your BasicSwap install, correct? Press any key to continue. CTRL-C to exit\n" printf "\nDisable $disablecoin on your BasicSwap install, correct? Press any key to continue. CTRL-C to exit\n"

View file

@ -1,4 +1,5 @@
Bitcoin Core version v26.0.0 Bitcoin Core version v26.0.0
Bitcoin Cash Node Daemon version v27.1.0-9f9aa5a6e
dcrd version 1.8.1+release (Go version go1.21.1 linux/amd64) dcrd version 1.8.1+release (Go version go1.21.1 linux/amd64)
Dash Core version v21.1.0 Dash Core version v21.1.0
Firo Core Daemon version v0.14.14.0-ge0c423805 Firo Core Daemon version v0.14.14.0-ge0c423805