Skip to content

Instantly share code, notes, and snippets.

@alex-red
Last active January 31, 2018 04:50
Show Gist options
  • Save alex-red/8da4f57c85e05c2cb27b118357dec4e3 to your computer and use it in GitHub Desktop.
Save alex-red/8da4f57c85e05c2cb27b118357dec4e3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
iota_nelson_db="/home/$(whoami)/iota/nelsondb"
public_ip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
echo "Grabbing needed docker images..."
docker pull romansemko/nelson.cli
docker pull iotaledger/iri
echo "Done!"
mkdir -p /home/$(whoami)/iota/nelsondb
echo "Nelson DB stored at: $iota_nelson_db"
echo "Running IOTA Node..."
docker run -d --net host -p 14265:14265 --name iota-node iotaledger/iri
echo "Done!"
echo "Running IOTA Nelson..."
docker run -d --net host -p 18600:18600 --name iota-nelson -v $iota_nelson_db:/data romansemko/nelson.cli --getNeighbors --apiHostname 0.0.0.0 --name IotaPRL
echo "Done!"
echo "IOTA Nelson service running at 0.0.0.0:18600"
echo "Access externally from http://$public_ip:18600"
# OPTIONAL (WEB GUI)
# Install IOTA Nelson GUI, comment out the lines below to enable
# May take a long time due to need to build image from scratch
# ============================================================
# echo "Installing and running Nelson GUI"
# git clone https://github.com/SemkoDev/nelson.gui.git /home/$(whoami)/iota/iota-gui
# # Needed to install yarn in docker
# sed -i -e 's/npm install \-g yarn/npm config set unsafe-perm true \&\& npm install \-g yarn/' /home/$(whoami)/iota/iota-gui/Dockerfile
# # Needed to view iota out of localhost, comment out to remain on localhost
# sed -i -e "s/localhost/$public_ip/" /home/$(whoami)/iota/iota-gui/src/redux/nelson-api.js
# docker build -t "iota-nelson-gui" /home/$(whoami)/iota/iota-gui/
# # docker pull romansemko/nelson.gui # Can't use because it is not updated
# docker run -d --net host -p 5000:5000 --name iota-nelson-gui iota-nelson-gui
# echo "Nelson GUI running at http://$public_ip:5000"
# echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment