Reviewed-on: #27 Co-authored-by: Nabarun <nabarun@deepstacksoft.com> Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
62 lines
2.2 KiB
Bash
Executable File
62 lines
2.2 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}
|
|
|
|
# Skipping early supports account allocation
|
|
# if [ -z "$EARLY_SUPPORTS_ACC_ADDRESS" ]; then
|
|
# echo "EARLY_SUPPORTS_ACC_ADDRESS not provided, exiting..."
|
|
# exit 1
|
|
# fi
|
|
|
|
# lps allocations
|
|
# Total supply: 129600 lps
|
|
|
|
# Old plan, will allocate 100% to lockup module instead
|
|
# EARLY_SUPPORTS_ALLOC="25920" # Early supports: 25920 lps (20% of total supply)
|
|
# LOCKUP_ALLOC="103680" # Lockup: 103680 lps (80% of total supply)
|
|
|
|
|
|
LOCKUP_ALLOC="129600" # Lockup: 129600 lps (100% 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"'
|
|
|
|
# Skipping early supports account allocation
|
|
# laconicd genesis add-genesis-account $EARLY_SUPPORTS_ACC_ADDRESS $EARLY_SUPPORTS_ALLOC$LPS_DENOM --keyring-backend $KEYRING --append
|
|
|
|
# Perform lps allocations
|
|
laconicd genesis add-genesis-lockup-account lps_lockup $distribution_file $LOCKUP_ALLOC$LPS_DENOM
|
|
|
|
# Ensure that resulting genesis file is valid
|
|
laconicd genesis validate
|