Update distribution params to disable staking rewards

This commit is contained in:
Nabarun 2025-05-15 12:04:54 +05:30
parent 0a4c5bd25a
commit 5dd89f83ee
9 changed files with 48 additions and 9 deletions

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
*-deployment
*-spec.yml
# Playbook vars
playbooks/first-validator/first-validator-vars.yml

View File

@ -1,4 +1,4 @@
cerc_moniker: "MainnetNode"
cerc_moniker: "LaconicMainnetNode"
cerc_chain_id: "laconic-mainnet"
min_gas_price: 0.001
cerc_loglevel: "info"

View File

@ -20,7 +20,7 @@
fail:
msg: >-
Required key files are not defined.
Please set genesis_file in run-first-validator-vars.yml.
Please set genesis_file in first-validator-vars.yml.
when: not genesis_file
- name: Fetch laconicd stack
shell: laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
@ -72,7 +72,7 @@
- name: Fail if pvt_key is not set
fail:
msg: >-
Private key (pvt_key) is not set in run-first-validator-vars.yml.
Private key (pvt_key) is not set in first-validator-vars.yml.
This is required for creating the gentx.
when: not pvt_key

View File

@ -42,11 +42,23 @@
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/generate-genesis.yml -e "exported_state_path=$EXPORTED_STATE_PATH" -e "early_supports_acc_address=$EARLY_SUPPORTS_ACC_ADDR"
```
- Genesis file will be generated in output directory along with a file specifying the staking amount
```bash
# List files in output directory - genesis.json and staking-amount.json
ls -l output
```
## Run node
<!-- TODO: Add steps to get private key of validator account from laconic testnet -->
- Update [run-first-validator-vars.yml](playbooks/first-validator/run-first-validator-vars.yml) with required values:
- 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
```
- Update `~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.yml` with required values:
```bash
# Private key of the existing account in hex format (required for gentx)
@ -56,7 +68,7 @@
genesis_file: "<path-to-generated-genesis-file>"
# Set custom moniker for the node
cerc_moniker: "MainnetNode"
cerc_moniker: "LaconicMainnetNode"
# Set desired key name
key_name: "validator"

View File

@ -59,7 +59,6 @@ docker run \
# Copy over the genesis file to output folder
cp ./$MAINNET_GENESIS_DIR/config/genesis.json $OUTPUT_DIR/genesis.json
# TODO: chown the output dir to user
echo "Genesis file for mainnet written to $OUTPUT_DIR/genesis.json"
# --------

View File

@ -27,6 +27,21 @@ testnet_state_file="$NODE_HOME/testnet-state.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 alps allocations
laconicd genesis add-genesis-account $EARLY_SUPPORTS_ACC_ADDRESS $EARLY_SUPPORTS_ALLOC$LPS_DENOM --keyring-backend $KEYRING --append

View File

@ -4,7 +4,7 @@ services:
image: cerc/laconicd:local
command: ["bash", "-c", "/opt/run-laconicd.sh"]
environment:
CERC_MONIKER: ${CERC_MONIKER:-MainnetNode}
CERC_MONIKER: ${CERC_MONIKER}
CERC_CHAIN_ID: ${CERC_CHAIN_ID:-laconic-mainnet}
CERC_PEERS: ${CERC_PEERS}
MIN_GAS_PRICE: ${MIN_GAS_PRICE:-0.001}

View File

@ -42,6 +42,18 @@ sed -i 's/cors_allowed_origins.*$/cors_allowed_origins = ["*"]/' $NODE_HOME/conf
# Update config with persistent peers
sed -i "s/^persistent_peers *=.*/persistent_peers = \"$CERC_PEERS\"/g" $NODE_HOME/config/config.toml
# Enable telemetry (prometheus metrics: http://localhost:1317/metrics?format=prometheus)
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/enabled = false/enabled = true/g' $NODE_HOME/config/app.toml
sed -i '' 's/prometheus-retention-time = 0/prometheus-retention-time = 60/g' $NODE_HOME/config/app.toml
sed -i '' 's/prometheus = false/prometheus = true/g' $NODE_HOME/config/config.toml
else
sed -i 's/enabled = false/enabled = true/g' $NODE_HOME/config/app.toml
sed -i 's/prometheus-retention-time = 0/prometheus-retention-time = 60/g' $NODE_HOME/config/app.toml
sed -i 's/prometheus = false/prometheus = true/g' $NODE_HOME/config/config.toml
fi
echo "Starting laconicd node..."
laconicd start \
--api.enable \

View File

@ -1,3 +1 @@
# mainnet-laconicd
Instructions for running validator nodes