Skip to content

Instantly share code, notes, and snippets.

@Alexhuszagh
Created May 28, 2018 21:49
Show Gist options
  • Save Alexhuszagh/370417099c1cb8929247d70726ba8315 to your computer and use it in GitHub Desktop.
Save Alexhuszagh/370417099c1cb8929247d70726ba8315 to your computer and use it in GitHub Desktop.
NEM NIS Installer (Ubuntu 17.04)
#!/bin/bash
# Update and add the Java repository
apt update
apt install -y software-properties-common
add-apt-repository -y ppa:webupd8team/java
# Update and install Java
apt update
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
apt install -y oracle-java8-installer
# Install curl to download files, and JQ/GPG to verify sigs
apt install -y curl jq gpgv1
apt upgrade -y
# Find latest version and download latest versions
export nem_domain=https://bob.nem.ninja && \
export version=$(curl $nem_domain/version.txt) && \
export nis_sig=$nem_domain/nis-$version.tgz.sig && \
export nis_installer=$nem_domain/nis-$version.tgz && \
curl $nis_sig -o nis-ncc.tgz.sig && \
curl $nis_installer -o nis-ncc.tgz
# Verify the key (old verification method)
#gpg --keyserver keys.gnupg.net --recv-key A46494A9
#gpg --verify nis-ncc.tgz.sig nis-ncc.tgz
# New signature scheme, not always published
#sha=$(curl -L -s http://bigalice3.nem.ninja:7890/transaction/get?hash=$(cat nis-ncc.tgz.sig | grep txId | sed -e 's/txId: //') | jq -r '.transaction.message.payload[10:74]') && \
# echo "$sha nis-ncc.tgz" > /tmp/sum && \
# sha256sum -c /tmp/sum
#rm nis-ncc.tgz.sig
# Extract NIS data
tar xvf nis-ncc.tgz
# Start the node in background
cd package && \
nohup ./nix.runConsole.sh && nohup ./nix.runNis.sh && \
cd / &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment