diff --git a/local_node.sh b/local_node.sh index 3ece7b261..5c6036d4e 100755 --- a/local_node.sh +++ b/local_node.sh @@ -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 diff --git a/networks/init-node.sh b/networks/init-node.sh index 0690b40a6..376c604bb 100755 --- a/networks/init-node.sh +++ b/networks/init-node.sh @@ -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 diff --git a/networks/local/exocore/wrapper.sh b/networks/local/exocore/wrapper.sh index d780d8408..cb53eb02c 100755 --- a/networks/local/exocore/wrapper.sh +++ b/networks/local/exocore/wrapper.sh @@ -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} @@ -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 diff --git a/scripts/start-docker.sh b/scripts/start-docker.sh index 92643fc23..d944cb87f 100755 --- a/scripts/start-docker.sh +++ b/scripts/start-docker.sh @@ -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" @@ -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 \ No newline at end of file +tail -f /dev/null