Update script to set all accounts' sequence to zero

This commit is contained in:
Shreerang Kale 2025-05-15 15:30:21 +05:30
parent f194d93645
commit f4ab2bf232
4 changed files with 19 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
*-deployment
*-spec.yml
mainnet-genesis
# Playbook vars
*-vars.yml

View File

@ -21,7 +21,7 @@
- The file will be generated in `<path-to-testnet-deployment>/export/testnet-state.json`
- If mainnet node will be setup in new machine, fetch the stack again:
- If mainnet node is to be setup in a new machine, fetch the stack again:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
@ -36,6 +36,12 @@
export EARLY_SUPPORTS_ACC_ADDR=<account-address-controlled-by-laconic-foundation>
```
- Copy the example variables file:
```bash
cp ~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.example.yml ~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.yml
```
- Run playbook to use exported state for generating mainnet genesis:
```bash
@ -53,7 +59,7 @@
<!-- TODO: Add steps to get private key of validator account from laconic testnet -->
- Copy the example variables file:
- Copy the example variables file if not already done:
```bash
cp ~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.example.yml ~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.yml
@ -98,6 +104,12 @@
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f
```
- Check bonds list to confirm that testnet state was transferred properly:
```bash
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query bond list'
```
## Publish Genesis File and Node Address
- Copy the genesis file to [genesis](./genesis) folder:

View File

@ -116,6 +116,9 @@ for account in mainnet_state["app_state"]["auth"]["accounts"]:
if "ModuleAccount" in account_type and account.get("name") in addresses_to_remove:
removed_addresses.add(account["base_account"]["address"])
continue
if "ModuleAccount" not in account_type:
account["sequence"] = "0"
new_accounts.append(account)
mainnet_state["app_state"]["auth"]["accounts"] = new_accounts

View File

@ -54,8 +54,7 @@ if [ -z "$account_address" ]; then
fi
# TODO: Use staking amount from output/staking-amount.json
# Get balance of account
stake_amount=$(jq -r --arg address "$account_address" --arg denom "$DENOM" '.app_state.bank.balances[] | select(.address == $address) | .coins[] | select(.denom == $denom) | .amount' $genesis_file_path)
stake_amount=900000000
# Create gentx with staked amount equal to allocated balance
laconicd genesis gentx $KEY_NAME $stake_amount$DENOM --chain-id $CHAIN_ID --keyring-backend $KEYRING