Skip to content

Instantly share code, notes, and snippets.

@mailopl
Created May 21, 2018 22:07
Show Gist options
  • Save mailopl/8d90d290f63fcdc0c4774662599aaa4c to your computer and use it in GitHub Desktop.
Save mailopl/8d90d290f63fcdc0c4774662599aaa4c to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "------------------------------------"
echo " NIMIQ Skypool installation script "
echo "------------------------------------"
printf "Enter machine name: "
read -r name
printf "Enter wallet address: "
read -r address
## Update and upgrade packages
echo "Upgrading packages..."
apt-get update > /dev/null 2>&1
apt-get -y upgrade > /dev/null 2>&1
## Install dependecies
echo "Installing dependencies..."
apt-get install -y vim curl sed htop gnupg locales tmux git build-essential unzip wget > /dev/null 2>&1
## Install node/yarn/gulp
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs
npm install -g yarn
yarn global add gulp
npm install n
cd node_modules/n/bin
./n stable
cd
## Checkout NIMIQ core
echo "Cloning NIMIQ network core..."
git clone https://github.com/nimiq-network/core > /dev/null 2>&1
## Get Skypool
echo "Downloading Skypool..."
wget https://github.com/skypool-org/skypool-nimiq-miner/releases/download/v1.2.0/skypool-nimiq-v1.2.0-linux-x64-fast.zip > /dev/null 2>&1
## Extract Skypool source files
echo "Extracting Skypool..."
unzip skypool-nimiq-v1.2.0-linux-x64-fast.zip > /dev/null 2>&1
mv skypool-nimiq-v1.2.0-linux-x64-fast skypool-nimiq
## Update config file
echo "Updating config file..."
cd skypool-nimiq
sed -i 's/"name": ".*"/"name": "'"$name"'"/g' config.txt > /dev/null 2>&1
sed -i 's/"address": ".*"/"address": "'"$address"'"/g' config.txt > /dev/null 2>&1
dpkg-reconfigure locales
echo 'Installation completed.'
echo '-------------------------------'
echo 'To start mining enter the command below'
echo './skypool-nimiq/skypool-node-client &>> skypool.log &'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment