-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathget_geth.sh
executable file
·23 lines (19 loc) · 1.03 KB
/
get_geth.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# WARNING: the following script has a high concentration of YOLOs
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.10.26"
COMMIT="e5eb32ac"
PLATFORM=$(uname | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
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