-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update pregenesis.sh
script for testnet4
#628
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ done | |
echo "Running with SEED_FAUCET_USDC=$SEED_FAUCET_USDC..." | ||
|
||
source "./testing/genesis.sh" | ||
CHAIN_ID="dydx-testnet-3" | ||
CHAIN_ID="dydx-testnet-4" | ||
FAUCET_ACCOUNTS=( | ||
"dydx1g2ygh8ufgwwpg5clp2qh3tmcmlewuyt2z6px8k" # main faucet | ||
"dydx1fzhzmcvcy7nycvu46j9j4f7f8cnqxn3770q260" # backup #1 | ||
|
@@ -60,9 +60,7 @@ TMP_CHAIN_DIR="/tmp/chain" | |
TMP_EXCHANGE_CONFIG_JSON_DIR="/tmp/exchange_config" | ||
AWS_REGION="us-east-2" | ||
|
||
# initialize faucet address with 1e27 native tokens. | ||
FAUCET_STAKE_BALANCE=1000000000000000000000000000 | ||
# initialize faucet with 1e13 micro USDC (10 million USDC). | ||
# initialize faucet with 1e13 micro USDC (10 million USDC). Only used when `SEED_FAUCET_USDC` is true. | ||
FAUCET_USDC_BALANCE=10000000000000 | ||
|
||
# Define monikers for each validator. These are made up strings and can be anything. | ||
|
@@ -163,19 +161,12 @@ function overwrite_genesis_public_testnet() { | |
dasel put -t string -f "$GENESIS" '.app_state.gov.params.quorum' -v '0.33400' # 33.4% | ||
dasel put -t string -f "$GENESIS" '.app_state.gov.params.threshold' -v '0.50000' # 50% | ||
dasel put -t string -f "$GENESIS" '.app_state.gov.params.veto_threshold' -v '0.33400' # 33.4% | ||
|
||
# Consensus params | ||
dasel put -t string -f "$GENESIS" '.consensus_params.block.max_bytes' -v '22020096' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for my own understanding, why are we removing this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nvm, I think this is removed so we can keep the 4mib value that we settled one |
||
dasel put -t string -f "$GENESIS" '.consensus_params.block.max_gas' -v '-1' | ||
} | ||
|
||
create_pregenesis_file() { | ||
VAL_HOME_DIR="$TMP_CHAIN_DIR/.dydxprotocol" | ||
VAL_CONFIG_DIR="$VAL_HOME_DIR/config" | ||
|
||
VALIDATOR_INITIAL_STAKE_BALANCE=100000000000 | ||
VALIDATOR_INITIAL_SELF_DELEGATION=$((VALIDATOR_INITIAL_STAKE_BALANCE/2)) | ||
|
||
# This initializes the $VAL_HOME_DIR folder. | ||
$DYDX_BINARY init "test-moniker" -o --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" | ||
|
||
|
@@ -191,7 +182,7 @@ create_pregenesis_file() { | |
edit_genesis "$VAL_CONFIG_DIR" "" "" "$TMP_EXCHANGE_CONFIG_JSON_DIR" "./testing/delaymsg_config" "" | ||
overwrite_genesis_public_testnet | ||
|
||
FAUCET_BALANCE="${FAUCET_STAKE_BALANCE}$NATIVE_TOKEN" | ||
FAUCET_BALANCE="${FAUCET_NATIVE_TOKEN_BALANCE}$NATIVE_TOKEN" | ||
# If SEED_FAUCET_USDC is true, faucet is initalized with USDC balance in addition to native token balance. | ||
if [ "$SEED_FAUCET_USDC" = true ]; then | ||
FAUCET_BALANCE="${FAUCET_BALANCE},${FAUCET_USDC_BALANCE}$USDC_DENOM" | ||
|
@@ -225,12 +216,12 @@ create_pregenesis_file() { | |
echo "${MNEMONICS[$i]}" | $DYDX_BINARY keys add "${MONIKERS[$i]}" --recover --keyring-backend=test --home "$INDIVIDUAL_VAL_HOME_DIR" | ||
|
||
# Initialize the validator account in `genesis.json` under their individual home directory, which is used to create their gentx. | ||
$DYDX_BINARY add-genesis-account "${VALIDATOR_ACCOUNTS[$i]}" "${VALIDATOR_INITIAL_STAKE_BALANCE}$NATIVE_TOKEN" --home "$INDIVIDUAL_VAL_HOME_DIR" | ||
$DYDX_BINARY add-genesis-account "${VALIDATOR_ACCOUNTS[$i]}" "${TESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE}$NATIVE_TOKEN" --home "$INDIVIDUAL_VAL_HOME_DIR" | ||
|
||
# Initialize the validator account in `genesis.json` under the common home directory, which is used as the output geneis file. | ||
$DYDX_BINARY add-genesis-account "${VALIDATOR_ACCOUNTS[$i]}" "${VALIDATOR_INITIAL_STAKE_BALANCE}$NATIVE_TOKEN" --home "$VAL_HOME_DIR" | ||
$DYDX_BINARY add-genesis-account "${VALIDATOR_ACCOUNTS[$i]}" "${TESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE}$NATIVE_TOKEN" --home "$VAL_HOME_DIR" | ||
|
||
$DYDX_BINARY gentx "${MONIKERS[$i]}" "${VALIDATOR_INITIAL_SELF_DELEGATION}$NATIVE_TOKEN" --moniker="${MONIKERS[$i]}" --keyring-backend=test --chain-id=$CHAIN_ID --home "$INDIVIDUAL_VAL_HOME_DIR" --ip="${IPS[$i]}" | ||
$DYDX_BINARY gentx "${MONIKERS[$i]}" "${TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT}$NATIVE_TOKEN" --moniker="${MONIKERS[$i]}" --keyring-backend=test --chain-id=$CHAIN_ID --home "$INDIVIDUAL_VAL_HOME_DIR" --ip="${IPS[$i]}" | ||
|
||
# Copy the gentx to a shared directory. | ||
cp -a "$INDIVIDUAL_VAL_CONFIG_DIR/gentx/." "$TMP_GENTX_DIR" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~60 validators + 3 faucet + 1 rewards vester = 60 million + 150 million + 10 million = 220 million = 22% of total supply.
Note we will need to manually update the bridge module balance after
gentx
process is complete to make it add up to 1 billion total supply