Last active
May 30, 2018 20:19
-
-
Save Alexhuszagh/10fc07468897c0a11fe853b84a4a4049 to your computer and use it in GitHub Desktop.
NEM NIS Dockerfile
This file contains hidden or 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
FROM ubuntu:18.04 | |
# Update and add the ethereum repository | |
RUN apt update | |
RUN apt install -y software-properties-common | |
RUN add-apt-repository -y ppa:webupd8team/java | |
# Update and install Java | |
RUN apt update | |
RUN 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 | |
RUN apt install -y curl jq gpgv1 | |
RUN apt upgrade -y | |
# Find latest version and download latest versions | |
RUN 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) | |
#RUN gpg --keyserver keys.gnupg.net --recv-key A46494A9 | |
#RUN gpg --verify nis-ncc.tgz.sig nis-ncc.tgz | |
# New signature scheme, not always published | |
RUN 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 | |
RUN rm nis-ncc.tgz.sig | |
# Extract NIS data | |
RUN tar xvf nis-ncc.tgz | |
ENTRYPOINT cd package && \ | |
nohup ./nix.runConsole.sh && nohup ./nix.runNis.sh && \ | |
cd / & \ | |
/bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment