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

refactor: handle the typescript setup #100

Merged
merged 32 commits into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f747f2a
refactor: install and build packages instead of just installing
faustbrian Dec 10, 2018
762f809
fix: use dist files instead of bin to start core
faustbrian Dec 10, 2018
3e38107
feat: add peer file update to the update process
faustbrian Dec 11, 2018
6259c18
refactor: remove lerna clean
faustbrian Dec 14, 2018
5238fee
fix: copy config files from src instead of lib
faustbrian Dec 14, 2018
8e63fc8
fix: use correct file to configure forger
faustbrian Dec 14, 2018
a9e64a6
fix: copy the full network configuration
faustbrian Dec 17, 2018
c845a82
fix: ensure the network configuration is updated
faustbrian Dec 17, 2018
b9c2a21
refactor: do not pass the token and network to core (use .ark/config …
faustbrian Dec 17, 2018
7d955dd
fix: ensure configuration is overwritten to avoid issues with old files
faustbrian Dec 17, 2018
fb609d4
refactor: do not pass the token and network to the forger (use .ark/c…
faustbrian Dec 17, 2018
bc966fc
fix: pull from the develop branch
faustbrian Dec 17, 2018
50df447
fix: only copy network config files, not folder
faustbrian Dec 17, 2018
4f2e6a8
refactor: no longer copy network configurations
faustbrian Dec 17, 2018
74df1f3
fix: pass the network parameter to core
faustbrian Dec 17, 2018
b8e9df4
fix: pass network to bip38 configuration
faustbrian Dec 18, 2018
1891ba8
Merge branch 'master' into typescript
faustbrian Jan 22, 2019
696f0ea
fix: query the correct user column
faustbrian Jan 22, 2019
3bbfa6f
refactor: replace ARK_ with CORE_
faustbrian Jan 23, 2019
d738d89
refactor: replace ARK_ with CORE_
faustbrian Jan 23, 2019
415e66f
fix: install dotenv and env-paths if not available
faustbrian Jan 23, 2019
3ffd02a
refactor: use the systems paths that core uses
faustbrian Jan 23, 2019
b468571
fix: update core paths if the configuration is changed
faustbrian Jan 23, 2019
26564a6
fix: move folders on location changes
faustbrian Jan 23, 2019
ed7a036
fix: run utils scripts from the commander dir
faustbrian Jan 23, 2019
59c1a75
fix: require commander config before updating it
faustbrian Jan 23, 2019
92716d1
fix: check for commander dependencies and install them if needed
faustbrian Jan 23, 2019
082ab5b
fix: only check for commander deps if commander is fully installed
faustbrian Jan 23, 2019
607d596
fix: make sure the env directories exist
faustbrian Jan 24, 2019
dd25995
fix: ensure we create new directories during install
faustbrian Jan 24, 2019
4d07bb9
fix: use new config path
faustbrian Jan 24, 2019
66ef664
fix: paths
faustbrian Jan 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
88 changes: 48 additions & 40 deletions actions/apps/commander.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ commander_configure_repo ()
return
fi

__commander_configure "$choice" "$CORE_DIR" "$CORE_DATA" "$CORE_CONFIG" "$CORE_TOKEN" "$CORE_NETWORK" "$EXPLORER_REPO" "$EXPLORER_DIR"
__commander_configure "$choice" "$CORE_DIR" "$CORE_TOKEN" "$CORE_NETWORK" "$EXPLORER_REPO" "$EXPLORER_DIR"

if [[ -d "$CORE_DIR" ]]; then
warning "ARK Core will be pointed to ${CORE_REPO}. This will restart your node."
Expand Down Expand Up @@ -42,7 +42,7 @@ commander_configure_core_directory ()
return
fi

__commander_configure "$CORE_REPO" "$choice" "$CORE_DATA" "$CORE_CONFIG" "$CORE_TOKEN" "$CORE_NETWORK" "$EXPLORER_REPO" "$EXPLORER_DIR"
__commander_configure "$CORE_REPO" "$choice" "$CORE_TOKEN" "$CORE_NETWORK" "$EXPLORER_REPO" "$EXPLORER_DIR"

if [[ -d "$CORE_DIR" ]]; then
warning "ARK Core will be stopped and moved to ${CORE_DIR}. This will restart your node."
Expand All @@ -58,34 +58,6 @@ commander_configure_core_directory ()
fi
}

commander_configure_data_directory ()
{
info "Current: $CORE_DATA"
read -p "Please enter the core data directory you would like to use: " choice

if [[ -z "$choice" ]]; then
error "You have entered an empty value. Please try again."

return
fi

__commander_configure "$CORE_REPO" "$CORE_DIR" "$choice" "$CORE_CONFIG" "$CORE_TOKEN" "$CORE_NETWORK" "$EXPLORER_REPO" "$EXPLORER_DIR"
}

commander_configure_config_directory ()
{
info "Current: $CORE_CONFIG"
read -p "Please enter the core config directory you would like to use: " choice

if [[ -z "$choice" ]]; then
error "You have entered an empty value. Please try again."

return
fi

__commander_configure "$CORE_REPO" "$CORE_DIR" "$CORE_DATA" "$choice" "$CORE_TOKEN" "$CORE_NETWORK" "$EXPLORER_REPO" "$EXPLORER_DIR"
}

commander_configure_token ()
{
info "Current: $CORE_TOKEN"
Expand All @@ -97,7 +69,7 @@ commander_configure_token ()
return
fi

__commander_configure "$CORE_REPO" "$CORE_DIR" "$CORE_DATA" "$CORE_CONFIG" "$choice" "$CORE_NETWORK" "$EXPLORER_REPO" "$EXPLORER_DIR"
__commander_configure "$CORE_REPO" "$CORE_DIR" "$choice" "$CORE_NETWORK" "$EXPLORER_REPO" "$EXPLORER_DIR"
}

commander_configure_token_network ()
Expand All @@ -111,7 +83,7 @@ commander_configure_token_network ()
return
fi

__commander_configure "$CORE_REPO" "$CORE_DIR" "$CORE_DATA" "$CORE_CONFIG" "$CORE_TOKEN" "$choice" "$EXPLORER_REPO" "$EXPLORER_DIR"
__commander_configure "$CORE_REPO" "$CORE_DIR" "$CORE_TOKEN" "$choice" "$EXPLORER_REPO" "$EXPLORER_DIR"
}

commander_configure_explorer_repo ()
Expand All @@ -125,7 +97,7 @@ commander_configure_explorer_repo ()
return
fi

__commander_configure "$CORE_REPO" "$CORE_DIR" "$CORE_DATA" "$CORE_CONFIG" "$CORE_TOKEN" "$CORE_NETWORK" "$choice" "$EXPLORER_DIR"
__commander_configure "$CORE_REPO" "$CORE_DIR" "$CORE_TOKEN" "$CORE_NETWORK" "$choice" "$EXPLORER_DIR"

if [[ -d "$EXPLORER_DIR" ]]; then
warning "ARK Explorer will be pointed to ${EXPLORER_REPO}. This will restart your explorer."
Expand Down Expand Up @@ -156,7 +128,7 @@ commander_configure_explorer_directory ()
return
fi

__commander_configure "$CORE_REPO" "$CORE_DIR" "$CORE_DATA" "$CORE_CONFIG" "$CORE_TOKEN" "$CORE_NETWORK" "$EXPLORER_REPO" "$choice"
__commander_configure "$CORE_REPO" "$CORE_DIR" "$CORE_TOKEN" "$CORE_NETWORK" "$EXPLORER_REPO" "$choice"

if [[ -d "$EXPLORER_DIR" ]]; then
warning "ARK Explorer will be stopped and moved to ${EXPLORER_DIR}. This will restart your explorer."
Expand All @@ -178,12 +150,48 @@ __commander_configure ()

sed -i -e "s/CORE_REPO=$CORE_REPO/CORE_REPO=$1/g" "$commander_config"
sed -i -e "s/CORE_DIR=$CORE_DIR/CORE_DIR=$2/g" "$commander_config"
sed -i -e "s/CORE_DATA=$CORE_DATA/CORE_DATA=$3/g" "$commander_config"
sed -i -e "s/CORE_CONFIG=$CORE_CONFIG/CORE_CONFIG=$4/g" "$commander_config"
sed -i -e "s/CORE_TOKEN=$CORE_TOKEN/CORE_TOKEN=$5/g" "$commander_config"
sed -i -e "s/CORE_NETWORK=$CORE_NETWORK/CORE_NETWORK=$6/g" "$commander_config"
sed -i -e "s/EXPLORER_REPO=$EXPLORER_REPO/EXPLORER_REPO=$7/g" "$commander_config"
sed -i -e "s/EXPLORER_DIR=$EXPLORER_DIR/EXPLORER_DIR=$8/g" "$commander_config"

sed -i -e "s/CORE_TOKEN=$CORE_TOKEN/CORE_TOKEN=$3/g" "$commander_config"
sed -i -e "s/CORE_NETWORK=$CORE_NETWORK/CORE_NETWORK=$4/g" "$commander_config"

sed -i -e "s/EXPLORER_REPO=$EXPLORER_REPO/EXPLORER_REPO=$5/g" "$commander_config"
sed -i -e "s/EXPLORER_DIR=$EXPLORER_DIR/EXPLORER_DIR=$6/g" "$commander_config"

# update core paths in ~/.commander
local CORE_PATHS=$(node ${commander_dir}/utils/paths.js ${CORE_TOKEN} ${CORE_NETWORK})

local NEW_CORE_PATH_DATA=$(echo $CORE_PATHS | jq -r ".data")
local NEW_CORE_PATH_CONFIG=$(echo $CORE_PATHS | jq -r ".config")
local NEW_CORE_PATH_CACHE=$(echo $CORE_PATHS | jq -r ".cache")
local NEW_CORE_PATH_LOG=$(echo $CORE_PATHS | jq -r ".log")
local NEW_CORE_PATH_TEMP=$(echo $CORE_PATHS | jq -r ".temp")

sed -i -e "s/CORE_PATH_DATA=$CORE_PATH_DATA/CORE_PATH_DATA=$NEW_CORE_PATH_DATA/g" "$commander_config"
sed -i -e "s/CORE_PATH_CONFIG=$CORE_PATH_CONFIG/CORE_PATH_CONFIG=$NEW_CORE_PATH_CONFIG/g" "$commander_config"
sed -i -e "s/CORE_PATH_CACHE=$CORE_PATH_CACHE/CORE_PATH_CACHE=$NEW_CORE_PATH_CACHE/g" "$commander_config"
sed -i -e "s/CORE_PATH_LOG=$CORE_PATH_LOG/CORE_PATH_LOG=$NEW_CORE_PATH_LOG/g" "$commander_config"
sed -i -e "s/CORE_PATH_TEMP=$CORE_PATH_TEMP/CORE_PATH_TEMP=$NEW_CORE_PATH_TEMP/g" "$commander_config"

# move folders in case they changed
if [[ "$CORE_PATH_DATA" != "${NEW_CORE_PATH_DATA}" ]]; then
mv "${CORE_PATH_DATA}" "${NEW_CORE_PATH_DATA}"
fi

if [[ "$CORE_PATH_CONFIG" != "${NEW_CORE_PATH_CONFIG}" ]]; then
mv "${CORE_PATH_CONFIG}" "${NEW_CORE_PATH_CONFIG}"
fi

if [[ "$CORE_PATH_CACHE" != "${NEW_CORE_PATH_CACHE}" ]]; then
mv "${CORE_PATH_CACHE}" "${NEW_CORE_PATH_CACHE}"
fi

if [[ "$CORE_PATH_LOG" != "${NEW_CORE_PATH_LOG}" ]]; then
mv "${CORE_PATH_LOG}" "${NEW_CORE_PATH_LOG}"
fi

if [[ "$CORE_PATH_TEMP" != "${NEW_CORE_PATH_TEMP}" ]]; then
mv "${CORE_PATH_TEMP}" "${NEW_CORE_PATH_TEMP}"
fi

. "$commander_config"

Expand Down
6 changes: 3 additions & 3 deletions actions/apps/forger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ forger_start ()

heading "Starting Forger..."

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

if [[ -z "$bip38" ]]; then
__forger_start_without_bip38
Expand Down Expand Up @@ -99,7 +99,7 @@ __forger_configure_plain ()
read -sp "Please enter your delegate secret: " inputSecret
echo

$(node "$CORE_DIR/packages/core/bin/ark" forger-plain --config "$CORE_CONFIG" --secret "$inputSecret")
$(node "$CORE_DIR/packages/core/dist/index.js" forger-plain --secret "$inputSecret")

local status=$?

Expand All @@ -123,7 +123,7 @@ __forger_configure_bip38 ()

warning "Hang in there while we encrypt your secret..."

$(node "$CORE_DIR/packages/core/bin/ark" forger-bip38 --config "$CORE_CONFIG" --token "$CORE_TOKEN" --network "$CORE_NETWORK" --secret "$inputSecret" --password "$inputBip38")
$(node "$CORE_DIR/packages/core/dist/index.js" forger-bip38 --network "$CORE_NETWORK" --secret "$inputSecret" --password "$inputBip38")

local status=$?

Expand Down
71 changes: 33 additions & 38 deletions actions/core/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ core_configure_reset ()
if [[ "$choice" =~ ^(yes|y|Y) ]]; then
info "Resetting configuration..."

if [[ ! -d "$CORE_DATA" ]]; then
mkdir "$CORE_DATA"
fi

rm -rf "$CORE_CONFIG"

cp -r "${CORE_DIR}/packages/core/lib/config/${CORE_NETWORK}" "$CORE_CONFIG"
cp "${CORE_DIR}/packages/crypto/lib/networks/${CORE_TOKEN}/${CORE_NETWORK}.json" "$CORE_CONFIG/network.json"
__core_configure_core "${CORE_NETWORK}"

info "Reset configuration!"
else
Expand All @@ -28,13 +21,13 @@ core_configure ()

local configured=false

if [[ -d "$CORE_CONFIG" ]]; then
if [[ -d "$CORE_PATH_CONFIG" ]]; then
read -p "We found an Ark Core configuration, do you want to overwrite it? [y/N] : " choice

if [[ "$choice" =~ ^(yes|y|Y) ]]; then
__core_configure_pre

rm -rf "$CORE_CONFIG"
rm -rf "$CORE_PATH_CONFIG"

__core_configure_network

Expand Down Expand Up @@ -86,13 +79,21 @@ __core_configure_post ()
{
database_create

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

# Make sure the git commit hash is not modified by a local yarn.lock
git reset --hard | tee -a "$commander_log"
}

__core_configure_commander ()
{
sed -i -e "s/CORE_NETWORK=$CORE_NETWORK/CORE_NETWORK=$1/g" "$commander_config"

. "$commander_config"

setup_environment_directories
}

__core_configure_network ()
{
ascii
Expand All @@ -104,23 +105,23 @@ __core_configure_network ()
select opt in "${validNetworks[@]}"; do
case "$opt" in
"mainnet")
__core_configure_commander "mainnet"
__core_configure_branch "master"
__core_configure_core "mainnet"
__core_configure_commander "mainnet"
__core_configure_environment "mainnet"
break
;;
"devnet")
__core_configure_commander "devnet"
__core_configure_branch "develop"
__core_configure_core "devnet"
__core_configure_commander "devnet"
__core_configure_environment "devnet"
break
;;
"testnet")
__core_configure_commander "testnet"
__core_configure_branch "develop"
__core_configure_core "testnet"
__core_configure_commander "testnet"
__core_configure_environment "testnet"
break
;;
Expand All @@ -135,52 +136,46 @@ __core_configure_network ()

__core_configure_core ()
{
if [[ ! -d "$CORE_DATA" ]]; then
mkdir "$CORE_DATA"
if [[ ! -d "$CORE_PATH_CONFIG" ]]; then
mkdir "$CORE_PATH_CONFIG"
fi

cp -r "${CORE_DIR}/packages/core/lib/config/$1" "$CORE_CONFIG"
cp "${CORE_DIR}/packages/crypto/lib/networks/${CORE_TOKEN}/$1.json" "$CORE_CONFIG/network.json"
}

__core_configure_commander ()
{
sed -i -e "s/CORE_NETWORK=$CORE_NETWORK/CORE_NETWORK=$1/g" "$commander_config"
cp -rf "${CORE_DIR}/packages/core/src/config/$1" "${CORE_PATH_CONFIG}"
}

__core_configure_environment ()
{
heading "Creating Environment configuration..."

local envFile="${CORE_DATA}/.env"
local envFile="${CORE_PATH_CONFIG}/.env"

touch "$envFile"

grep -q '^ARK_P2P_HOST' "$envFile" 2>&1 || echo 'ARK_P2P_HOST=0.0.0.0' >> "$envFile" 2>&1
grep -q '^CORE_P2P_HOST' "$envFile" 2>&1 || echo 'CORE_P2P_HOST=0.0.0.0' >> "$envFile" 2>&1

if [[ "$1" = "testnet" ]]; then
grep -q '^ARK_P2P_PORT' "$envFile" 2>&1 || echo 'ARK_P2P_PORT=4000' >> "$envFile" 2>&1
grep -q '^CORE_P2P_PORT' "$envFile" 2>&1 || echo 'CORE_P2P_PORT=4000' >> "$envFile" 2>&1
fi

if [[ "$1" = "mainnet" ]]; then
grep -q '^ARK_P2P_PORT' "$envFile" 2>&1 || echo 'ARK_P2P_PORT=4001' >> "$envFile" 2>&1
grep -q '^CORE_P2P_PORT' "$envFile" 2>&1 || echo 'CORE_P2P_PORT=4001' >> "$envFile" 2>&1
fi

if [[ "$1" = "devnet" ]]; then
grep -q '^ARK_P2P_PORT' "$envFile" 2>&1 || echo 'ARK_P2P_PORT=4002' >> "$envFile" 2>&1
grep -q '^CORE_P2P_PORT' "$envFile" 2>&1 || echo 'CORE_P2P_PORT=4002' >> "$envFile" 2>&1
fi

grep -q '^ARK_API_HOST' "$envFile" 2>&1 || echo 'ARK_API_HOST=0.0.0.0' >> "$envFile" 2>&1
grep -q '^ARK_API_PORT' "$envFile" 2>&1 || echo 'ARK_API_PORT=4003' >> "$envFile" 2>&1
grep -q '^CORE_API_HOST' "$envFile" 2>&1 || echo 'CORE_API_HOST=0.0.0.0' >> "$envFile" 2>&1
grep -q '^CORE_API_PORT' "$envFile" 2>&1 || echo 'CORE_API_PORT=4003' >> "$envFile" 2>&1

grep -q '^ARK_WEBHOOKS_HOST' "$envFile" 2>&1 || echo 'ARK_WEBHOOKS_HOST=0.0.0.0' >> "$envFile" 2>&1
grep -q '^ARK_WEBHOOKS_PORT' "$envFile" 2>&1 || echo 'ARK_WEBHOOKS_PORT=4004' >> "$envFile" 2>&1
grep -q '^CORE_WEBHOOKS_HOST' "$envFile" 2>&1 || echo 'CORE_WEBHOOKS_HOST=0.0.0.0' >> "$envFile" 2>&1
grep -q '^CORE_WEBHOOKS_PORT' "$envFile" 2>&1 || echo 'CORE_WEBHOOKS_PORT=4004' >> "$envFile" 2>&1

grep -q '^ARK_GRAPHQL_HOST' "$envFile" 2>&1 || echo 'ARK_GRAPHQL_HOST=0.0.0.0' >> "$envFile" 2>&1
grep -q '^ARK_GRAPHQL_PORT' "$envFile" 2>&1 || echo 'ARK_GRAPHQL_PORT=4005' >> "$envFile" 2>&1
grep -q '^CORE_GRAPHQL_HOST' "$envFile" 2>&1 || echo 'CORE_GRAPHQL_HOST=0.0.0.0' >> "$envFile" 2>&1
grep -q '^CORE_GRAPHQL_PORT' "$envFile" 2>&1 || echo 'CORE_GRAPHQL_PORT=4005' >> "$envFile" 2>&1

grep -q '^ARK_JSON_RPC_HOST' "$envFile" 2>&1 || echo 'ARK_JSON_RPC_HOST=0.0.0.0' >> "$envFile" 2>&1
grep -q '^ARK_JSON_RPC_PORT' "$envFile" 2>&1 || echo 'ARK_JSON_RPC_PORT=8080' >> "$envFile" 2>&1
grep -q '^CORE_JSON_RPC_HOST' "$envFile" 2>&1 || echo 'CORE_JSON_RPC_HOST=0.0.0.0' >> "$envFile" 2>&1
grep -q '^CORE_JSON_RPC_PORT' "$envFile" 2>&1 || echo 'CORE_JSON_RPC_PORT=8080' >> "$envFile" 2>&1

success "Created Environment configuration!"
}
Expand All @@ -190,7 +185,7 @@ __core_configure_branch ()
heading "Changing git branch..."

sed -i -e "s/CORE_BRANCH=$CORE_BRANCH/CORE_BRANCH=$1/g" "$commander_config"
. "${CORE_DATA}/.env"
. "${commander_config}"

cd "$CORE_DIR"
git reset --hard | tee -a "$commander_log"
Expand Down
22 changes: 11 additions & 11 deletions actions/core/configure/database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ core_configure_database ()
{
ascii

local envFile="${CORE_DATA}/.env"
local envFile="${CORE_PATH_CONFIG}/.env"

. "$envFile"

read -p "Enter the database host, or press ENTER for the default [$ARK_DB_HOST]: " inputHost
read -p "Enter the database port, or press ENTER for the default [$ARK_DB_PORT]: " inputPort
read -p "Enter the database username, or press ENTER for the default [$ARK_DB_USERNAME]: " inputUsername
read -p "Enter the database password, or press ENTER for the default [$ARK_DB_PASSWORD]: " inputPassword
read -p "Enter the database host, or press ENTER for the default [$CORE_DB_HOST]: " inputHost
read -p "Enter the database port, or press ENTER for the default [$CORE_DB_PORT]: " inputPort
read -p "Enter the database username, or press ENTER for the default [$CORE_DB_USERNAME]: " inputUsername
read -p "Enter the database password, or press ENTER for the default [$CORE_DB_PASSWORD]: " inputPassword
read -p "Enter the database name, or press ENTER for the default [ark_${CORE_NETWORK}]: " inputDatabase

if [[ ! -z "$inputHost" ]]; then
sed -i -e "s/ARK_DB_HOST=$ARK_DB_HOST/ARK_DB_HOST=$inputHost/g" "$envFile"
sed -i -e "s/CORE_DB_HOST=$CORE_DB_HOST/CORE_DB_HOST=$inputHost/g" "$envFile"
fi

if [[ ! -z "$inputPort" ]]; then
sed -i -e "s/ARK_DB_PORT=$ARK_DB_PORT/ARK_DB_PORT=$inputPort/g" "$envFile"
sed -i -e "s/CORE_DB_PORT=$CORE_DB_PORT/CORE_DB_PORT=$inputPort/g" "$envFile"
fi

if [[ ! -z "$inputUsername" ]]; then
sed -i -e "s/ARK_DB_USERNAME=$ARK_DB_USERNAME/ARK_DB_USERNAME=$inputUsername/g" "$envFile"
sed -i -e "s/CORE_DB_USERNAME=$CORE_DB_USERNAME/CORE_DB_USERNAME=$inputUsername/g" "$envFile"
fi

if [[ ! -z "$inputPassword" ]]; then
sed -i -e "s/ARK_DB_PASSWORD=$ARK_DB_PASSWORD/ARK_DB_PASSWORD=$inputPassword/g" "$envFile"
sed -i -e "s/CORE_DB_PASSWORD=$CORE_DB_PASSWORD/CORE_DB_PASSWORD=$inputPassword/g" "$envFile"
fi

if [[ ! -z "$inputDatabase" ]]; then
sed -i -e "s/ARK_DB_DATABASE=$ARK_DB_DATABASE/ARK_DB_DATABASE=$inputDatabase/g" "$envFile"
sed -i -e "s/CORE_DB_DATABASE=$CORE_DB_DATABASE/CORE_DB_DATABASE=$inputDatabase/g" "$envFile"
else
sed -i -e "s/ARK_DB_DATABASE=$ARK_DB_DATABASE/ARK_DB_DATABASE=ark_${CORE_NETWORK}/g" "$envFile"
sed -i -e "s/CORE_DB_DATABASE=$CORE_DB_DATABASE/CORE_DB_DATABASE=CORE_${CORE_NETWORK}/g" "$envFile"
fi

. "$envFile"
Expand Down