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

Commit

Permalink
chore: remove mainnet checks (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian committed Dec 3, 2018
1 parent c2511b1 commit 642524d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 34 deletions.
34 changes: 13 additions & 21 deletions actions/apps/forger.sh
Expand Up @@ -4,40 +4,32 @@ forger_start ()
{
ascii

if [[ "$CORE_NETWORK" != "mainnet" ]]; then
heading "Starting Forger..."
heading "Starting Forger..."

local bip38=$(jq -r '.bip38 // empty' "$CORE_CONFIG/delegates.json")
local bip38=$(jq -r '.bip38 // empty' "$CORE_CONFIG/delegates.json")

if [[ -z "$bip38" ]]; then
__forger_start_without_bip38
else
__forger_start_with_bip38
fi

forger_status

success "Started Forger!"
if [[ -z "$bip38" ]]; then
__forger_start_without_bip38
else
warning "Forger is disabled!"
__forger_start_with_bip38
fi

forger_status

success "Started Forger!"
}

forger_restart ()
{
ascii

if [[ "$CORE_NETWORK" != "mainnet" ]]; then
heading "Restarting Forger..."
heading "Restarting Forger..."

pm2 restart $commander_ecosystem --only ark-core-forger >> "$commander_log" 2>&1
pm2 restart $commander_ecosystem --only ark-core-forger >> "$commander_log" 2>&1

forger_status
forger_status

success "Restarted Forger!"
else
warning "Forger is disabled!"
fi
success "Restarted Forger!"
}

forger_stop ()
Expand Down
4 changes: 2 additions & 2 deletions actions/core/configure.sh
Expand Up @@ -86,6 +86,7 @@ __core_configure_post ()
{
database_create

lerna clean --yes
lerna bootstrap | tee -a "$commander_log"

# Make sure the git commit hash is not modified by a local yarn.lock
Expand All @@ -103,8 +104,7 @@ __core_configure_network ()
select opt in "${validNetworks[@]}"; do
case "$opt" in
"mainnet")
# TODO: switch freezer to master on release date
__core_configure_branch "freezer"
__core_configure_branch "master"
__core_configure_core "mainnet"
__core_configure_commander "mainnet"
__core_configure_environment "mainnet"
Expand Down
1 change: 1 addition & 0 deletions actions/core/update.sh
Expand Up @@ -40,6 +40,7 @@ core_update ()
git reset --hard | tee -a "$commander_log"
git checkout "$CORE_BRANCH" | tee -a "$commander_log"
git pull | tee -a "$commander_log"
lerna clean --yes
lerna bootstrap

# Make sure the git commit hash is not modified by a local yarn.lock
Expand Down
2 changes: 1 addition & 1 deletion menus/commander/help.sh
Expand Up @@ -25,7 +25,7 @@ menu_manage_commander_help ()
echo

text_yellow " Configure Token Network (N)"
text_white " lets you configure a different custom token network (devnet by default)."
text_white " lets you configure a different custom token network (mainnet by default)."
echo

text_yellow " Configure Explorer Repository (S)"
Expand Down
14 changes: 4 additions & 10 deletions modules/environment.sh
Expand Up @@ -52,12 +52,12 @@ setup_environment ()
touch "$commander_config"

echo "CORE_REPO=https://github.com/ArkEcosystem/core" >> "$commander_config" 2>&1
echo "CORE_BRANCH=develop" >> "$commander_config" 2>&1
echo "CORE_BRANCH=master" >> "$commander_config" 2>&1
echo "CORE_DIR=${HOME}/ark-core" >> "$commander_config" 2>&1
echo "CORE_DATA=${HOME}/.ark" >> "$commander_config" 2>&1
echo "CORE_CONFIG=${HOME}/.ark/config" >> "$commander_config" 2>&1
echo "CORE_TOKEN=ark" >> "$commander_config" 2>&1
echo "CORE_NETWORK=devnet" >> "$commander_config" 2>&1
echo "CORE_NETWORK=mainnet" >> "$commander_config" 2>&1
echo "EXPLORER_REPO=https://github.com/ArkEcosystem/explorer" >> "$commander_config" 2>&1
echo "EXPLORER_DIR=${HOME}/ark-explorer" >> "$commander_config" 2>&1

Expand All @@ -77,7 +77,7 @@ setup_environment ()
fi

if ! grep -q "CORE_BRANCH" "${commander_config}"; then
echo "CORE_BRANCH=develop" >> "$commander_config" 2>&1
echo "CORE_BRANCH=master" >> "$commander_config" 2>&1
fi

if ! grep -q "CORE_DIR" "${commander_config}"; then
Expand All @@ -97,7 +97,7 @@ setup_environment ()
fi

if ! grep -q "CORE_NETWORK" "${commander_config}"; then
echo "CORE_NETWORK=devnet" >> "$commander_config" 2>&1
echo "CORE_NETWORK=mainnet" >> "$commander_config" 2>&1
fi

if ! grep -q "EXPLORER_REPO" "${commander_config}"; then
Expand All @@ -110,12 +110,6 @@ setup_environment ()

. "$commander_config"

if [[ "$CORE_NETWORK" = "mainnet" ]]; then
sed -i -e "s/CORE_BRANCH=$CORE_BRANCH/CORE_BRANCH=freezer/g" "$commander_config"

. "$commander_config"
fi

setup_environment_file
fi
}

0 comments on commit 642524d

Please sign in to comment.