Skip to content

Commit

Permalink
chore(lint): apply shfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Mar 11, 2024
1 parent 2fa89d0 commit 6c1dbbe
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 51 deletions.
8 changes: 4 additions & 4 deletions local_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ if [[ $overwrite == "y" || $overwrite == "Y" ]]; then
sed -i.bak 's/pruning-keep-recent = "0"/pruning-keep-recent = "2"/g' "$APP_TOML"
sed -i.bak 's/pruning-interval = "0"/pruning-interval = "10"/g' "$APP_TOML"

# make sure the localhost IP is 0.0.0.0
sed -i.bak 's/localhost/0.0.0.0/g' "$CONFIG"
sed -i.bak 's/localhost/0.0.0.0/g' "$APP_TOML"
sed -i.bak 's/127.0.0.1/0.0.0.0/g' "$APP_TOML"
# make sure the localhost IP is 0.0.0.0
sed -i.bak 's/localhost/0.0.0.0/g' "$CONFIG"
sed -i.bak 's/localhost/0.0.0.0/g' "$APP_TOML"
sed -i.bak 's/127.0.0.1/0.0.0.0/g' "$APP_TOML"

# Allocate genesis accounts (cosmos formatted addresses)
for KEY in "${KEYS[@]}"; do
Expand Down
78 changes: 39 additions & 39 deletions networks/init-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,49 @@ current_dir="$PWD"
CHAINDIR="$current_dir/build/.testnets"

for node in {0..3}; do
NODE_DIR="$CHAINDIR/node$node"
GENESIS="$NODE_DIR/exocored/config/genesis.json"
TMP_GENESIS="$NODE_DIR/exocored/config/tmp_genesis.json"
APP_TOML="$NODE_DIR/exocored/config/app.toml"
CONFIG_TOML="$NODE_DIR/exocored/config/config.toml"
# If TMP_GENESIS directory does not exist, create it
TMP_GENESIS_DIR=$(dirname "$TMP_GENESIS")
if [ ! -d "$TMP_GENESIS_DIR" ]; then
mkdir -p "$TMP_GENESIS_DIR"
fi
# used to exit on first error (any non-zero exit code)
set -e
NODE_DIR="$CHAINDIR/node$node"
GENESIS="$NODE_DIR/exocored/config/genesis.json"
TMP_GENESIS="$NODE_DIR/exocored/config/tmp_genesis.json"
APP_TOML="$NODE_DIR/exocored/config/app.toml"
CONFIG_TOML="$NODE_DIR/exocored/config/config.toml"
# If TMP_GENESIS directory does not exist, create it
TMP_GENESIS_DIR=$(dirname "$TMP_GENESIS")
if [ ! -d "$TMP_GENESIS_DIR" ]; then
mkdir -p "$TMP_GENESIS_DIR"
fi
# used to exit on first error (any non-zero exit code)
set -e

# Update total supply with claim values
# Bc is required to add this big numbers
# total_supply=$(bc <<< "$amount_to_claim+$validators_supply")
#total_supply=20000000000000000000000
#jq -r --arg total_supply "$total_supply" '.app_state.bank.supply[0].amount=$total_supply' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
# Set gas limit in genesis
jq '.consensus_params["block"]["max_gas"]="1000000000"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
# Set claims start time
current_date=$(date -u +"%Y-%m-%dT%TZ")
jq -r --arg current_date "$current_date" '.app_state["claims"]["params"]["airdrop_start_time"]=$current_date' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
# make sure the localhost IP is 0.0.0.0
sed -i.bak 's/localhost/0.0.0.0/g' "$CONFIG_TOML"
sed -i.bak 's/localhost/0.0.0.0/g' "$APP_TOML"
sed -i.bak 's/127.0.0.1/0.0.0.0/g' "$APP_TOML"
# Update total supply with claim values
# Bc is required to add this big numbers
# total_supply=$(bc <<< "$amount_to_claim+$validators_supply")
#total_supply=20000000000000000000000
#jq -r --arg total_supply "$total_supply" '.app_state.bank.supply[0].amount=$total_supply' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
# Set gas limit in genesis
jq '.consensus_params["block"]["max_gas"]="1000000000"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
# Set claims start time
current_date=$(date -u +"%Y-%m-%dT%TZ")
jq -r --arg current_date "$current_date" '.app_state["claims"]["params"]["airdrop_start_time"]=$current_date' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
# make sure the localhost IP is 0.0.0.0
sed -i.bak 's/localhost/0.0.0.0/g' "$CONFIG_TOML"
sed -i.bak 's/localhost/0.0.0.0/g' "$APP_TOML"
sed -i.bak 's/127.0.0.1/0.0.0.0/g' "$APP_TOML"

# enable prometheus metrics
sed -i.bak 's/prometheus = false/prometheus = true/' "$CONFIG_TOML"
sed -i.bak 's/prometheus-retention-time = 0/prometheus-retention-time = 1000000000000/g' "$APP_TOML"
sed -i.bak 's/enabled = false/enabled = true/g' "$APP_TOML"
# enable prometheus metrics
sed -i.bak 's/prometheus = false/prometheus = true/' "$CONFIG_TOML"
sed -i.bak 's/prometheus-retention-time = 0/prometheus-retention-time = 1000000000000/g' "$APP_TOML"
sed -i.bak 's/enabled = false/enabled = true/g' "$APP_TOML"

# use timeout_commit 1s to make test faster
sed -i.bak 's/timeout_commit = "3s"/timeout_commit = "1s"/g' "$CONFIG_TOML"
# use timeout_commit 1s to make test faster
sed -i.bak 's/timeout_commit = "3s"/timeout_commit = "1s"/g' "$CONFIG_TOML"

# Enable the APIs for the tests to be successful
sed -i.bak 's/enable = false/enable = true/g' "$APP_TOML"
sed -i.bak 's/swagger = false/swagger = true/g' "$APP_TOML"
sed -i.bak 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' "$APP_TOML"
# Enable the APIs for the tests to be successful
sed -i.bak 's/enable = false/enable = true/g' "$APP_TOML"
sed -i.bak 's/swagger = false/swagger = true/g' "$APP_TOML"
sed -i.bak 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' "$APP_TOML"

# remove seeds
sed -i.bak 's/seeds = "[^"]*"/seeds = ""/' "$CONFIG_TOML"
# remove seeds
sed -i.bak 's/seeds = "[^"]*"/seeds = ""/' "$CONFIG_TOML"

echo "Modified configurations for node$node"
echo "Modified configurations for node$node"
done
6 changes: 3 additions & 3 deletions networks/local/exocore/wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
# shellcheck disable=SC3040
(set -o pipefail 2> /dev/null) && set -o pipefail
(set -o pipefail 2>/dev/null) && set -o pipefail
set -x

BINARY=/exocore/${BINARY:-exocored}
Expand All @@ -21,7 +21,7 @@ export CLIENT_TOML="$EHOME/config/client.toml"
#sed -i.bak 's/chain-id =.*/chain-id = "evmos_9000-8808"/g' "${CLIENT_TOML_TMP}"

if [ -d "$(dirname "${EHOME}"/"${LOG}")" ]; then
"${BINARY}" --home "${EHOME}" "$@" | tee "${EHOME}/${LOG}"
"${BINARY}" --home "${EHOME}" "$@" | tee "${EHOME}/${LOG}"
else
"${BINARY}" --home "${EHOME}" "$@"
"${BINARY}" --home "${EHOME}" "$@"
fi
11 changes: 6 additions & 5 deletions scripts/start-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ echo "init exocore with moniker=\"${MONIKER}\" and chain-id=\"${CHAINID}\""
./exocored init "${MONIKER}" --chain-id "${CHAINID}" --home "${DATA_DIR}"
echo "prepare genesis: Allocate genesis accounts"
./exocored add-genesis-account \
"$(./exocored keys show "${KEY}" -a --home "${DATA_DIR}" --keyring-backend test)" 1000000000000000000aevmos,1000000000000000000stake \
--home "${DATA_DIR}" --keyring-backend test
"$(./exocored keys show "${KEY}" -a --home "${DATA_DIR}" --keyring-backend test)" 1000000000000000000aevmos,1000000000000000000stake \
--home "${DATA_DIR}" --keyring-backend test
echo "prepare genesis: Sign genesis transaction"
./exocored gentx "${KEY}" 1000000000000000000stake --keyring-backend test --home "${DATA_DIR}" --keyring-backend test --chain-id "${CHAINID}"
echo "prepare genesis: Collect genesis tx"
Expand All @@ -23,8 +23,9 @@ echo "prepare genesis: Run validate-genesis to ensure everything worked and that

echo "starting exocore node in background ..."
./exocored start --pruning=nothing --rpc.unsafe \
--keyring-backend test --home "${DATA_DIR}" \
>"${DATA_DIR}"/node.log 2>&1 & disown
--keyring-backend test --home "${DATA_DIR}" \
>"${DATA_DIR}"/node.log 2>&1 &
disown

echo "started exocore node"
tail -f /dev/null
tail -f /dev/null

0 comments on commit 6c1dbbe

Please sign in to comment.