From 59ded9b734a0d0121c13def4c805e7fbaf4723c2 Mon Sep 17 00:00:00 2001 From: PeterNashaat Date: Sun, 13 Oct 2024 11:36:08 +0000 Subject: [PATCH 1/2] update algorand to latest --- tfgrid3/algorand/Dockerfile | 11 ++++++++--- tfgrid3/algorand/zinit/sshkey.yaml | 4 +--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tfgrid3/algorand/Dockerfile b/tfgrid3/algorand/Dockerfile index 45b6bd54..7a65a92a 100644 --- a/tfgrid3/algorand/Dockerfile +++ b/tfgrid3/algorand/Dockerfile @@ -5,8 +5,13 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt update && \ apt -y install wget curl vim net-tools iputils-ping openssh-server -RUN wget -O /sbin/zinit https://github.com/threefoldtech/zinit/releases/download/v0.2.5/zinit && \ - chmod +x /sbin/zinit +# Download and install latest zinit +RUN curl -s https://api.github.com/repos/threefoldtech/zinit/releases/latest | \ + grep "browser_download_url" | \ + cut -d '"' -f 4 | \ + wget -qi - -O /sbin/zinit + +RUN chmod +x /sbin/zinit ENV ALGORAND_DATA=/var/lib/algorand RUN echo export ALGORAND_DATA=/var/lib/algorand >> ~/.bashrc @@ -52,4 +57,4 @@ COPY zinit /etc/zinit ENTRYPOINT [ "/sbin/zinit", "init" ] -# IMAGE_TAG: threefolddev/algorand:v1.0-all \ No newline at end of file +# IMAGE_TAG: threefolddev/algorand:v1.0-all diff --git a/tfgrid3/algorand/zinit/sshkey.yaml b/tfgrid3/algorand/zinit/sshkey.yaml index 00ccfcbf..da55368c 100644 --- a/tfgrid3/algorand/zinit/sshkey.yaml +++ b/tfgrid3/algorand/zinit/sshkey.yaml @@ -7,8 +7,6 @@ exec: | chmod 700 /root/.ssh chmod 600 /root/.ssh/authorized_keys - - echo "$SSH_KEY" >> /root/.ssh/authorized_keys fi ' -oneshot: true \ No newline at end of file +oneshot: true From 5f3c2288a752741251d4cf0088c4e66dac4fcaf8 Mon Sep 17 00:00:00 2001 From: PeterNashaat Date: Wed, 30 Oct 2024 13:41:12 +0000 Subject: [PATCH 2/2] remove participant from algorand --- tfgrid3/algorand/Notes.md | 4 +-- .../algorand/scripts/configure_participant.sh | 27 ------------------- tfgrid3/algorand/zinit/participant.yaml | 5 ---- 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 tfgrid3/algorand/scripts/configure_participant.sh delete mode 100644 tfgrid3/algorand/zinit/participant.yaml diff --git a/tfgrid3/algorand/Notes.md b/tfgrid3/algorand/Notes.md index 190b14f0..e13dca75 100644 --- a/tfgrid3/algorand/Notes.md +++ b/tfgrid3/algorand/Notes.md @@ -22,7 +22,7 @@ ```bash SSH_KEY # your public ssh key NETWORK # one of algorand nets [mainnet, testnet, betanet, devnet] -NODE_TYPE # algorand node type [default, participant, relay, indexer] +NODE_TYPE # algorand node type [default, relay, indexer] ACCOUNT_MNEMONICS # account mnemonics that have some microalgo to do the participation transaction FIRST_ROUND # first validation block (get it from algoexplorer or use 20M) LAST_ROUND # last validation block (30M is reasonable range) @@ -32,4 +32,4 @@ LAST_ROUND # last validation block (30M is reasonable range) For every update - create new tag and describe the changes you made for a better history tracking. - update the tag in the dockerfile -- promote to latest after you done, so all changes can be applied across all projects using the flist. \ No newline at end of file +- promote to latest after you done, so all changes can be applied across all projects using the flist. diff --git a/tfgrid3/algorand/scripts/configure_participant.sh b/tfgrid3/algorand/scripts/configure_participant.sh deleted file mode 100644 index 0a31dd04..00000000 --- a/tfgrid3/algorand/scripts/configure_participant.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -x - -if [ $NODE_TYPE = 'participant' ]; then - export WALLET_NAME="my_wallet" - export WALLET_PASS="" - expect /scripts/wallet_new.exp - - account_import_response=$(goal account import -m "$ACCOUNT_MNEMONICS") - export ACCOUNT_ADDRESS=${account_import_response:9} - - export CATCHUP=$(curl https://algorand-catchpoints.s3.us-east-2.amazonaws.com/channel/$NETWORK/latest.catchpoint) - goal node catchup $CATCHUP - - # make sure it caught up before continue - sleep 60 - until goal node status | grep "Last Catchpoint"; do sleep 60; done - - goal account addpartkey --address $ACCOUNT_ADDRESS --roundFirstValid=$FIRST_ROUND --roundLastValid=$LAST_ROUND - - goal account changeonlinestatus --address $ACCOUNT_ADDRESS --online=true --txfile=online.txn - - goal clerk sign --infile="online.txn" --outfile="online.stxn" - - goal clerk rawsend -f online.stxn -fi \ No newline at end of file diff --git a/tfgrid3/algorand/zinit/participant.yaml b/tfgrid3/algorand/zinit/participant.yaml deleted file mode 100644 index 7492cf11..00000000 --- a/tfgrid3/algorand/zinit/participant.yaml +++ /dev/null @@ -1,5 +0,0 @@ -exec: bash /scripts/configure_participant.sh -after: - - algorand - -oneshot: true \ No newline at end of file