Advertisement
Sweetening

Bitcoin_mine.sh

May 11th, 2024
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Made by Taylor Christian Newsome | SleepTheGod | ClumsyLulz
  4.  
  5. # Set script variables
  6. MINER_VERSION="0.24.1"
  7. MINER_DOWNLOAD_URL="https://github.com/bitcoin-abc/bitcoin-abc/releases/download/v$MINER_VERSION/bitcoin-abc-$MINER_VERSION-x86_64-linux-gnu.tar.gz"
  8. MINER_DIR="/opt/bitcoin-miner"
  9. BTC_CORE_VERSION="24.0.1"
  10. BTC_CORE_DOWNLOAD_URL="https://bitcoincore.org/bin/linux/bitcoin-$BTC_CORE_VERSION-x86_64-linux-gnu.tar.gz"
  11. BTC_CORE_DIR="/opt/bitcoind"
  12.  
  13. # Check for required tools
  14. if [[ ! -x "$(command -v wget)" ]]; then
  15. echo "Error: wget is not installed. Please install wget before running this script."
  16. exit 1
  17. fi
  18.  
  19. # Install Bitcoin Miner
  20. if [[ ! -d "$MINER_DIR" ]]; then
  21. # Download and extract Bitcoin Miner
  22. echo "Downloading Bitcoin Miner..."
  23. wget -O - "$MINER_DOWNLOAD_URL" | tar -xzvf - -C "$MINER_DIR"
  24.  
  25. if [[ $? -ne 0 ]]; then
  26. echo "Error: Failed to download and extract Bitcoin Miner. Please check your internet connection and try again."
  27. exit 1
  28. fi
  29. fi
  30.  
  31. # Install Bitcoin Core
  32. if [[ ! -d "$BTC_CORE_DIR" ]]; then
  33. # Download and extract Bitcoin Core
  34. echo "Downloading Bitcoin Core..."
  35. wget -O - "$BTC_CORE_DOWNLOAD_URL" | tar -xzvf - -C "$BTC_CORE_DIR"
  36.  
  37. if [[ $? -ne 0 ]]; then
  38. echo "Error: Failed to download and extract Bitcoin Core. Please check your internet connection and try again."
  39. exit 1
  40. fi
  41. fi
  42.  
  43. # Auto-configure Bitcoin Core
  44. echo "Auto-configuring Bitcoin Core..."
  45. "$BTC_CORE_DIR/bitcoind" -datadir="$BTC_CORE_DIR" -conf="$BTC_CORE_DIR/bitcoin.conf" &> /dev/null &
  46.  
  47. # Start Bitcoin Miner
  48. echo "Starting Bitcoin Miner..."
  49. "$MINER_DIR/bitcoin-abc" -server -gen -stratumpool=stratum.bitcoin.cz:2800
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement