Skip to content

Commit

Permalink
fix(readme): fixed init script with broken consensus params (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
omritoptix authored May 9, 2024
1 parent e1c968f commit 302762d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ set_denom() {
fi
}

set_consensus_params() {
BLOCK_SIZE="500000"
jq --arg block_size "$BLOCK_SIZE" '.consensus_params["block"]["max_bytes"] = $block_size' "$GENESIS_FILE" >"$tmp" && mv "$tmp" "$GENESIS_FILE"
jq --arg block_size "$BLOCK_SIZE" '.consensus_params["evidence"]["max_bytes"] = $block_size' "$GENESIS_FILE" >"$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.consensus_params["block"]["max_gas"] = "400000000"' "$GENESIS_FILE" >"$tmp" && mv "$tmp" "$GENESIS_FILE"
}

SKIP_BASE_FEE=${SKIP_EVM_BASE_FEE-false}

set_EVM_params() {
jq '.consensus_params["block"]["max_bytes"] = "500000"' "$GENESIS_FILE" >"$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.consensus_params["block"]["max_gas"] = "400000000"' "$GENESIS_FILE" >"$tmp" && mv "$tmp" "$GENESIS_FILE"
jq --arg skip "$SKIP_BASE_FEE" '.app_state["feemarket"]["params"]["no_base_fee"] = ($skip == "true")' "$GENESIS_FILE" >"$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state["feemarket"]["params"]["min_gas_price"] = "0.0"' "$GENESIS_FILE" >"$tmp" && mv "$tmp" "$GENESIS_FILE"
}
Expand Down Expand Up @@ -99,6 +104,7 @@ else
sed -i "s/^minimum-gas-prices *= .*/minimum-gas-prices = \"0$BASE_DENOM\"/" "$APP_CONFIG_FILE"
fi
set_denom "$BASE_DENOM"
set_consensus_params
set_EVM_params

# --------------------- adding keys and genesis accounts --------------------- #
Expand Down

0 comments on commit 302762d

Please sign in to comment.