Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Improve script #210

Merged
merged 2 commits into from
Jun 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 35 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ fi
# Future improvement: pull dynamically from version list

CLI_LATEST_VERSION="0.6.3"
TEST_CLI_LATEST_VERSION="0.7.0"

# CLI_PROD_VERSION_NUMBERS=("0.5.8" "0.5.8.1" "0.6.0" "0.6.1" "0.6.2" "0.6.2-TSS-0.1.2" "0.6.3")
# CLI_TESTNET_VERSION_NUMBERS=("0.5.8" "0.5.8.1" "0.6.0" "0.6.1" "0.6.2" "0.6.2-TSS-0.1.2" "0.6.3")

FULLNODE_LATEST_VERSION="0.6.3-hotfix"
#FULLNODE_LATEST_VERSION="0.6.3-hotfix-2"
# FULLNODE_PROD_VERSION_NUMBERS=("0.5.8" "0.5.9" "0.5.10" "0.6.0" "0.6.1" "0.6.2" "0.6.3" "0.6.3-hotfix")
# FULLNODE_TESTNET_VERSION_NUMBERS=("0.5.8" "0.5.10" "0.6.0" "0.6.1" "0.6.1-hotfix" "0.6.2" "0.6.3" "0.6.3-hotfix")

Expand All @@ -140,15 +142,21 @@ GH_REPO_URL="https://github.com/binance-chain/node-binary/raw/master"
for NETWORK in "prod" "testnet"; do
if [ "$NETWORK" = "prod" ]; then
FILENAME="bnbcli"
CLI_VERSION_PATH="cli/$NETWORK/$CLI_LATEST_VERSION/$DETECTED_OS/$FILENAME"
CLI_BINARY_URL="$GH_REPO_URL/$CLI_VERSION_PATH"
cd $USR_LOCAL_BIN
echo "... Downloading $FILENAME executable version:" $CLI_LATEST_VERSION
wget -q --show-progress "$CLI_BINARY_URL"
chmod 755 "./$FILENAME"
else
FILENAME="tbnbcli"
CLI_VERSION_PATH="cli/$NETWORK/$TEST_CLI_LATEST_VERSION/$DETECTED_OS/$FILENAME"
CLI_BINARY_URL="$GH_REPO_URL/$CLI_VERSION_PATH"
cd $USR_LOCAL_BIN
echo "... Downloading $FILENAME executable version:" $TEST_CLI_LATEST_VERSION
wget -q --show-progress "$CLI_BINARY_URL"
chmod 755 "./$FILENAME"
fi
CLI_VERSION_PATH="cli/$NETWORK/$CLI_LATEST_VERSION/$DETECTED_OS/$FILENAME"
CLI_BINARY_URL="$GH_REPO_URL/$CLI_VERSION_PATH"
cd $USR_LOCAL_BIN
echo "... Downloading $FILENAME executable version:" $CLI_LATEST_VERSION
wget -q --show-progress "$CLI_BINARY_URL"
chmod 755 "./$FILENAME"
done

# Download Light Node
Expand All @@ -161,7 +169,26 @@ wget -q --show-progress "$LIGHTNODE_BINARY_URL"
chmod 755 "./lightd"

# Download Full Node
FULLNODE_VERSION_PATH="fullnode/prod/$FULLNODE_LATEST_VERSION"

echo "... Choose node type to install"
echo "... Choose Network Version"
OPTION_NETWORK=("Mainnet" "Testnet")
PS3='Choose Network Type: '
select opt in "${OPTION_NETWORK[@]}"; do
case $opt in
"Mainnet")
FULLNODE_LATEST_VERSION="0.6.3-hotfix-2"
FULLNODE_VERSION_PATH="fullnode/prod/$FULLNODE_LATEST_VERSION"
break
;;
"Testnet")
FULLNODE_LATEST_VERSION="0.7.0"
FULLNODE_VERSION_PATH="fullnode/testnet/$FULLNODE_LATEST_VERSION"
break
;;
esac
done

FULLNODE_CONFIG_URL="$GH_REPO_URL/$FULLNODE_VERSION_PATH/config"
FULLNODE_BINARY_URL="$GH_REPO_URL/$FULLNODE_VERSION_PATH/$DETECTED_OS/bnbchaind"

Expand Down