├── README.md └── update-linux.sh /README.md: -------------------------------------------------------------------------------- 1 | # Vanillacoin Install / Update Scripts 2 | 3 | ## Warning ! 4 | Please backup your existing wallet files (~/.Vanillacoin/data/ folder). 5 | I can't be responsible if you broke something. 6 | 7 | ## Req. 8 | 9 | #### Debian / Ubuntu / Raspbian 10 | ``` 11 | sudo apt-get install build-essential openssl curl git-core screen -y 12 | ``` 13 | 14 | #### Raspbian 15 | Be sure to have enough Swap to avoid 'Virtual memory exhausted: Cannot allocate memory'. 16 | Raspbian default Swap size is 100mb, please increase the size before building. 17 | 18 | Check Swap size: 19 | ``` 20 | free -m 21 | ``` 22 | 23 | Example with 1024mb as Swap size: 24 | ``` 25 | sudo nano /etc/dphys-swapfile 26 | ``` 27 | Edit the file: 28 | ``` 29 | CONF_SWAPSIZE=1024 30 | ``` 31 | Save & restart dphys-swapfile: 32 | ``` 33 | sudo /etc/init.d/dphys-swapfile stop 34 | sudo /etc/init.d/dphys-swapfile start 35 | ``` 36 | 37 | ## Install 38 | As user: 39 | ``` 40 | cd ~ 41 | bash < <(curl -s https://raw.githubusercontent.com/xCoreDev/vanillacoin-scripts/master/build-linux.sh) 42 | ``` 43 | Install script auto launch vanillacoind at the end. 44 | Resume the screen session with: 45 | ``` 46 | screen -x vanillacoind 47 | ``` 48 | Ctrl-a Ctrl-d to detach 49 | 50 | ## Launch 51 | Be sure there's no vanillacoind running before ! 52 | ``` 53 | ps x | grep '[v]anillacoind' 54 | ``` 55 | To launch: 56 | ``` 57 | cd ~/vanillacoin/ 58 | screen -d -S vanillacoind -m ./vanillacoind 59 | ``` 60 | 61 | ## Update 62 | As user: You must be in the vanillacoin/ folder before running the update script ! 63 | 64 | ``` 65 | cd ~/vanillacoin/ 66 | bash < <(curl -s https://raw.githubusercontent.com/xCoreDev/vanillacoin-scripts/master/update-linux.sh) 67 | ``` 68 | Previous binaries are saved in the backup/ dir. 69 | 70 | ## Crontab 71 | As user: 72 | Autostart Vanillacoin daemon on reboot with crontab: 73 | ``` 74 | crontab -e 75 | ``` 76 | Add this entry (edited with your username): 77 | ``` 78 | @reboot pgrep vanillacoind > /dev/null || cd /home/your_username/vanillacoin && screen -d -S vanillacoind -m ./vanillacoind 79 | ``` 80 | save & check crontab: 81 | ``` 82 | crontab -l 83 | ``` 84 | Then do a reboot test. 85 | -------------------------------------------------------------------------------- /update-linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check root or user 5 | if (( EUID == 0 )); then 6 | echo -e "\n- - - - - - - - - \n" 7 | echo "You are too root for this ! Recheck README.md file." 1>&2 8 | echo -e "\n- - - - - - - - - \n" 9 | exit 10 | fi 11 | 12 | # Check if vanillacoind is running 13 | echo "Check vanillacoind process" 14 | pgrep vanillacoind && echo "Vanillacoin daemon is a running ! Please close it first." && exit 15 | 16 | # Check path & current daemon binary 17 | echo "Check path & current binary" 18 | VANILLA_ROOT=$(pwd) 19 | if [[ ! -f "$VANILLA_ROOT/vanillacoind" ]]; then 20 | echo "Can't find current vanillacoind binary ! Check your path." 21 | exit 22 | fi 23 | 24 | # Check current deps 25 | echo "Check current deps in source dir" 26 | if [[ ! -d "$VANILLA_ROOT/vanillacoin-src/deps/boost" && "$VANILLA_ROOT/vanillacoin-src/deps/db" && "$VANILLA_ROOT/vanillacoin-src/deps/openssl" ]]; then 27 | echo "Can't find req. deps in vanillacoin-src/deps/ folder !" 28 | echo "Follow INSTALL instructions on Github." 29 | exit 30 | fi 31 | 32 | # Backup deps 33 | echo "Backup deps" 34 | mkdir -p $VANILLA_ROOT/backup/ 35 | mv -f $VANILLA_ROOT/vanillacoin-src/deps/ $VANILLA_ROOT/backup/ 36 | mv -f $VANILLA_ROOT/vanillacoind $VANILLA_ROOT/backup/vanillacoind-$(date +%s) 37 | 38 | # Clean 39 | echo "Clean before clone" 40 | rm -Rf vanillacoin-src/ 41 | 42 | # Github 43 | echo "Git clone vanillacoin in vanillacoin-src dir" 44 | git clone https://github.com/john-connor/vanillacoin.git vanillacoin-src 45 | 46 | # Restore deps 47 | echo "Restore deps" 48 | mv $VANILLA_ROOT/backup/deps/boost/ $VANILLA_ROOT/vanillacoin-src/deps/ 49 | mv $VANILLA_ROOT/backup/deps/db/ $VANILLA_ROOT/vanillacoin-src/deps/ 50 | mv $VANILLA_ROOT/backup/deps/openssl/ $VANILLA_ROOT/vanillacoin-src/deps/ 51 | rm -Rf $VANILLA_ROOT/backup/deps/ 52 | 53 | # Vanillacoin daemon 54 | cd $VANILLA_ROOT/vanillacoin-src/ 55 | echo "vanillacoind bjam build" 56 | cd test/ 57 | ../deps/boost/bjam toolset=gcc cxxflags=-std=gnu++0x release 58 | cp $VANILLA_ROOT/vanillacoin-src/test/bin/gcc-*/release/link-static/stack $VANILLA_ROOT/vanillacoind 59 | cd $VANILLA_ROOT 60 | 61 | # Start 62 | screen -d -S vanillacoind -m ./vanillacoind 63 | echo -e "\n- - - - - - - - - \n" 64 | echo " Vanillacoind launched in a screen session. To switch:" 65 | echo -e "\n- - - - - - - - - \n" 66 | echo " screen -x vanillacoind" 67 | echo " Ctrl-a Ctrl-d to detach without kill the daemon" 68 | echo -e "\n- - - - - - - - - \n" 69 | --------------------------------------------------------------------------------