Last active
February 28, 2020 03:29
-
-
Save fr1t2/0bac6a7e0fddfd347558b262a30fdba6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# add swap space for AWS servers if needed | |
if free | awk '/^Swap:/ {exit !$2}'; then | |
echo 'Swap exsists' | |
else | |
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo swapon --show | |
sudo cp /etc/fstab /etc/fstab.bak | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab | |
sudo sysctl vm.swappiness=10 | |
sudo sysctl vm.vfs_cache_pressure=50 | |
fi | |
# Update | |
sudo apt update && sudo apt upgrade -y | |
sudo apt-get -y install swig3.0 python3-dev python3-pip build-essential pkg-config libssl-dev libffi-dev libhwloc-dev libboost-dev | |
# cmake | |
cd /opt && sudo wget https://github.com/Kitware/CMake/releases/download/v3.10.3/cmake-3.10.3.tar.gz && sudo tar zxvf cmake-3.10.3.tar.gz && cd cmake-3.10.3/ && sudo ./configure && sudo make -j2 && echo -e '## Adding cmake version 3.10.3\nPATH=$PATH:/opt/cmake-3.10.3/bin' >> ~/.bashrc && source ~/.bashrc | |
# fix path for --user | |
export PATH=$HOME/.local/bin:$PATH | |
pip3 install --user pip | |
pip3 install --user -U setuptools | |
git clone https://github.com/theqrl/qrl -b dev | |
cd qrl | |
pip3 install --user -r requirements.txt | |
pip3 install --user . | |
mkdir /home/ubuntu/.qrl | |
sudo chown -R $USER:$USER /home/ubuntu/.qrl | |
sudo chown -R $USER:$USER /home/ubuntu/QRL | |
echo "Create QRL config.yml file" | |
# QRL config file | |
cat <<EOF > /home/ubuntu/.qrl/config.yml | |
# ############################# # | |
# Mining Configuration # | |
# ############################# # | |
# mining_enabled: False | |
# mining_address: '' | |
# mining_thread_count: 0 # 0 to auto detect thread count based on CPU/GPU number of processors | |
EOF | |
echo "start qrl" | |
screen -d -m start_qrl | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment