From 74e5f470e2e00f849c94647af23efe66453412d7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 13 May 2025 18:57:09 +0530 Subject: [PATCH] Perform alps allocations --- scripts/generate-mainnet-genesis.sh | 5 ++++- scripts/genesis.sh | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/scripts/generate-mainnet-genesis.sh b/scripts/generate-mainnet-genesis.sh index bc24eb2..d9c6e7f 100755 --- a/scripts/generate-mainnet-genesis.sh +++ b/scripts/generate-mainnet-genesis.sh @@ -5,7 +5,7 @@ set -e set -u # Check args -if [ "$#" -ne 2 ]; then +if [ "$#" -ne 1 ]; then echo "Usage: $0 " exit 1 fi @@ -36,6 +36,9 @@ echo "Exported state from testnet" docker run -it \ -v ./$MAINNET_GENESIS_DIR:/root/.laconicd \ -v ./scripts:/scripts \ + -e "CHAIN_ID=$CHAIN_ID" \ + -e "EARLY_SUPPORTS_ACC_ADDRESS=$EARLY_SUPPORTS_ACC_ADDRESS" \ + -e "LPS_LOCKUP_ACC_ADDRESS=$LPS_LOCKUP_ACC_ADDRESS" \ cerc/laconicd:local bash -c "/scripts/genesis.sh" # Copy over the genesis file to output folder diff --git a/scripts/genesis.sh b/scripts/genesis.sh index 4c5dee0..8a60944 100755 --- a/scripts/genesis.sh +++ b/scripts/genesis.sh @@ -10,6 +10,20 @@ CHAINID=${CHAINID:-"laconic-mainnet"} MONIKER=${MONIKER:-"mainnet-node"} NODE_HOME="/root/.laconicd" +EARLY_SUPPORTS_ACC_ADDRESS=${EARLY_SUPPORTS_ACC_ADDRESS} +LPS_LOCKUP_ACC_ADDRESS=${LPS_LOCKUP_ACC_ADDRESS} + +if [ -z "$EARLY_SUPPORTS_ACC_ADDRESS" ] || [ -z "$LPS_LOCKUP_ACC_ADDRESS" ]; then + echo "EARLY_SUPPORTS_ACC_ADDRESS or LPS_LOCKUP_ACC_ADDRESS not provided, exiting..." + exit 1 +fi + +# alps allocations +# Total supply: 129600 * 10^18 alps +EARLY_SUPPORTS_ALLOC="12960000000000000000000" # Early supports: 12960 * 10^18 alps (10% of total supply) +LOCKUP_ALLOC="116640000000000000000000" # Lockup: 116640 * 10^18 alps (90% of total supply) +LPS_LOCKUP_MODULE_ACCOUNT="lps_lockup" + testnet_state_file="$NODE_HOME/testnet-state.json" mainnet_genesis_file="$NODE_HOME/config/genesis.json" @@ -22,7 +36,12 @@ jq --slurpfile nested $testnet_state_file '.consensus.auth = $nested[0].consensu # Update any module params if required here -# TODO: Perform alps allocations +# Perform alps allocations +laconicd genesis add-genesis-account $ADDRESS $EARLY_SUPPORTS$DENOM --keyring-backend $KEYRING + +# Use zero address to add an account for lps_lockup +zero_address="laconic1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqklcls0" +laconicd genesis add-genesis-account $zero_address $EARLY_SUPPORTS$DENOM --keyring-backend $KEYRING --module-name $LPS_LOCKUP_MODULE_ACCOUNT # Ensure that resulting genesis file is valid laconicd genesis validate