bitcoin.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. mode="release"
  3. function release_ {
  4. cd /home/wareck/
  5. wget -c https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1.tar.gz
  6. tar xvfz bitcoin-24.0.1.tar.gz
  7. cd bitcoin-24.0.1
  8. cd depends
  9. make download
  10. make
  11. cd ..
  12. ./autogen.sh
  13. CONFIG_SITE=/home/wareck/bitcoin-24.0.1/depends/x86_64-pc-linux-gnu/share/config.site ./configure --prefix=/home/wareck/bitcoin_binary
  14. make
  15. make install
  16. cd /home/wareck/
  17. rm bitcoin-24.0.1.tar.gz
  18. }
  19. function dev_ {
  20. cd /home/wareck
  21. if [ -d bitcoin ]
  22. then
  23. cd bitcoin
  24. git pull
  25. else
  26. git clone https://github.com/bitcoin/bitcoin.git
  27. cd bitcoin
  28. git reset --hard a46e17832fd2ecc44943ff7ccff8af443f6239b8
  29. fi
  30. sudo apt-get update
  31. sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils -y
  32. sudo apt-get install libboost-all-dev libdb-dev libdb++-dev libminiupnpc-dev libgoogle-perftools-dev libzmq3-dev -y
  33. cd depends
  34. make download
  35. make
  36. cd ..
  37. ./autogen.sh
  38. CONFIG_SITE=/home/wareck/bitcoin/depends/x86_64-pc-linux-gnu/share/config.site ./configure --prefix=/home/wareck/bitcoin_binary
  39. make -j 4
  40. make install
  41. }
  42. if [ $mode = "dev" ]
  43. then
  44. echo "Building Bitcoin devel"
  45. dev_
  46. else
  47. echo -e "Building Bitcoin release 0.23\n"
  48. release_
  49. fi