laconicd-stack/scripts/genesis.sh
shreerang 3d7ba45796 Add playbook to send create-validator tx for subsequent nodes (#3)
Part of https://www.notion.so/Create-stacks-for-mainnet-1f2a6b22d4728034be4be2c51decf94e of cerc-io/laconicd#66
- Use calculated staking amount for running validator nodes

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Reviewed-on: #3
Co-authored-by: shreerang <shreerang@noreply.git.vdb.to>
Co-committed-by: shreerang <shreerang@noreply.git.vdb.to>
2025-05-16 09:54:09 +00:00

53 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# Exit on error
set -e
set -u
# Note: Needs to be run in a docker container with image cerc/laconicd:local
KEYRING="test"
NODE_HOME="/root/.laconicd"
EARLY_SUPPORTS_ACC_ADDRESS=${EARLY_SUPPORTS_ACC_ADDRESS}
if [ -z "$EARLY_SUPPORTS_ACC_ADDRESS" ]; then
echo "EARLY_SUPPORTS_ACC_ADDRESS not provided, exiting..."
exit 1
fi
# lps allocations
# Total supply: 129600 lps
EARLY_SUPPORTS_ALLOC="25920" # Early supports: 25920 lps (20% of total supply)
LOCKUP_ALLOC="103680" # Lockup: 103680 lps (80% of total supply)
LPS_LOCKUP_MODULE_ACCOUNT="lps_lockup"
LPS_DENOM="lps"
testnet_state_file="$NODE_HOME/testnet-state.json"
distribution_file="$NODE_HOME/distribution.json"
mainnet_genesis_file="$NODE_HOME/config/genesis.json"
# Update any module params if required here
update_genesis() {
jq "$1" $NODE_HOME/config/genesis.json > $NODE_HOME/config/tmp_genesis.json &&
mv $NODE_HOME/config/tmp_genesis.json $NODE_HOME/config/genesis.json
}
# Set distribution community tax to 1 for disabling staking rewards and redirect them to the community pool
update_genesis '.app_state["distribution"]["params"]["community_tax"]="1.000000000000000000"'
# Increase threshold in gov proposals for making it difficult to spend community pool funds
echo "Setting high threshold for accepting governance proposal"
update_genesis '.app_state["gov"]["params"]["quorum"]="1.000000000000000000"'
# Set expedited threshold to 100%
update_genesis '.app_state["gov"]["params"]["expedited_threshold"]="1.000000000000000000"'
# Set normal threshold to 99% since it needs to be lesser than expedited threshold
update_genesis '.app_state["gov"]["params"]["threshold"]="0.990000000000000000"'
# Perform lps allocations
laconicd genesis add-genesis-account $EARLY_SUPPORTS_ACC_ADDRESS $EARLY_SUPPORTS_ALLOC$LPS_DENOM --keyring-backend $KEYRING --append
laconicd genesis add-genesis-lockup-account lps_lockup $distribution_file $LOCKUP_ALLOC$LPS_DENOM
# Ensure that resulting genesis file is valid
laconicd genesis validate