Skip to content

Commit

Permalink
Hardcode VERSION and COMMIT values in get_geth
Browse files Browse the repository at this point in the history
  • Loading branch information
vrde committed May 9, 2019
1 parent a97f30e commit c5f5870
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions get_geth.sh
@@ -1,18 +1,23 @@
#!/bin/bash
# WARNING: the following script has a high concentration of YOLOs

# Note: $HOMEDIR is defined in main.js, check it out

set -e

# Note: $HOMEDIR is defined in main.js, check it out
HOMEDIR=${HOMEDIR:-"."}

# Unfortunately GitHub ratelimits the following requests when running on travis. That's the reason why I had to hardcode the values of VERSION and COMMIT for now.
# VERSION=$(curl -s https://api.github.com/repos/ethereum/go-ethereum/releases/latest | python -c "import sys, json; print(json.load(sys.stdin)['tag_name'])")
# COMMIT=$(curl -s https://api.github.com/repos/ethereum/go-ethereum/commits/${VERSION} | python -c "import sys, json; print(json.load(sys.stdin)['sha'])")
VERSION="1.8.27"
COMMIT="4bcc0a37"
PLATFORM=$(uname | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

VERSION=$(curl -s https://api.github.com/repos/ethereum/go-ethereum/releases/latest | python -c "import sys, json; print(json.load(sys.stdin)['tag_name'])")
COMMIT=$(curl -s https://api.github.com/repos/ethereum/go-ethereum/commits/${VERSION} | python -c "import sys, json; print(json.load(sys.stdin)['sha'])")
NAME="geth-${PLATFORM}-amd64-${VERSION:1}-${COMMIT:0:8}"
NAME="geth-${PLATFORM}-amd64-${VERSION}-${COMMIT}"
DOWNLOAD_URL="https://gethstore.blob.core.windows.net/builds/${NAME}.tar.gz"
TMP_FILE=$(mktemp)

echo "Downloading ${DOWNLOAD_URL}"
curl --fail ${DOWNLOAD_URL} | tar -Oxzf - ${NAME}/geth > ${TMP_FILE}
mv ${TMP_FILE} ${HOMEDIR}/geth
chmod +x ${HOMEDIR}/geth

0 comments on commit c5f5870

Please sign in to comment.