- Create account.
- Enable multi-factor authentication.
- Enable API access.
- Create API key.
- Restrict API access to IP of gateway (consider).
- Create Droplet on DigitalOcean.
- Use Ubuntu LTS.
- Choose specifications.
- Activate backups?
- Select SSH key.
- Open console and note its fingerprint. Compare at SSH login.
vpsip=
cat << EOF >> ~/.ssh/config
Host southxchange
User nu
HostName $vpsip
EOF
ssh root@southxchange
Passwordless logins are denied by default.
adduser nu --disabled-pass‐word
mkdir /home/nu/.ssh
chown nu:nu /home/nu/.ssh
chmod 700 /home/nu/.ssh
cat /root/.ssh/authorized_keys >> /home/nu/.ssh/authorized_keys
chown nu:nu /home/nu/.ssh/authorized_keys
apt install -y unzip
apt-add-repository ppa:webupd8team/java
Press Enter.
apt update
apt install -y oracle-java8-installer
Accept the terms for Java. (Enter, Left, Enter)
Firewall:
ufw allow ssh/tcp
ufw show added
ufw enable
Press Y, Enter.
Automatic security updates:
Won't reboot.
dpkg-reconfigure --priority=low unattended-upgrades
ssh nu@southxchange
curl -LO https://bitbucket.org/JordanLeePeershares/nubottrading/downloads/nubot-v0.5.0-RC11.zip
unzip nubot-v0.5.0-RC11.zip
ln -s nubot-v0.5.0-RC11.zip southxchange_usnbt-usd
Key for protected credentials in NuBot.
AUTHKEY=
echo "$AUTHKEY" > ~/southxchange_usnbt-usd/res/authkey.txt
cd southxchange_usnbt-usd/config
ln -s ../../southxchange_usnbt-usd.json nubot-config.json
APIKEY=
APISECRET=
cat << EOF > ~/southxchange_usnbt-usd.json
{
"exchangeName": "southxchange",
"pair": "nbt_btc",
"txFee": 0.4,
"apiKey": "$APIKEY",
"apiSecret": "$APISECRET",
"bypassStreaming": false,
"streamingServer": "price.crypto-daio.co.uk:5556",
"verbosity": "high",
"executeOrders": true,
"bookDisableTier2": true,
"bookBuyWall": 10,
"bookBuyOffset": 0.005,
"bookSellWall": 10,
"bookSellOffset": 0.005,
"submitLiquidity": false,
"mailNotifications": "none"
}
EOF
cat << 'EOF' > ~/start
#!/usr/bin/env sh
tmux new-session -d -s "NuBot" -n "Debug" "$SHELL"
tmux new-window -n "USNBT-USD" "cd southxchange_usnbt-usd && java -jar NuBot.jar -server -cfg=../southxchange_usnbt-usd.json ; $SHELL || $SHELL"
EOF
chmod +x ~/start
crontab -e
@reboot /home/nu/start