From 6a662820b5fe791a14613603b2d8959ade263fb3 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 15 May 2025 17:22:46 +0530 Subject: [PATCH 01/14] Add script and playbook to create validator --- playbooks/validator/create-validator.yml | 30 ++++++++++++++++ run-validator.md | 36 +++++++++++++++++++ scripts/create-validator.sh | 20 +++++++++++ .../docker-compose-mainnet-laconicd.yml | 1 + 4 files changed, 87 insertions(+) create mode 100644 playbooks/validator/create-validator.yml create mode 100755 scripts/create-validator.sh diff --git a/playbooks/validator/create-validator.yml b/playbooks/validator/create-validator.yml new file mode 100644 index 0000000..6afc24d --- /dev/null +++ b/playbooks/validator/create-validator.yml @@ -0,0 +1,30 @@ +--- +- name: Create validator on running chain + hosts: localhost + vars: + data_directory: "{{ lookup('env', 'DATA_DIRECTORY') }}" + deployment_dir: "{{ lookup('env', 'MAINNET_DEPLOYMENT_DIR') }}" + key_name: "{{ lookup('env', 'KEY_NAME') }}" + pvt_key: "{{ lookup('env', 'PVT_KEY') }}" + tasks: + - name: Fail if DATA_DIRECTORY or MAINNET_DEPLOYMENT_DIR env vars are not set + fail: + msg: >- + Required environment variables are not set. + Please export both DATA_DIRECTORY and MAINNET_DEPLOYMENT_DIR before running the playbook. + when: lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == '' + + - name: Fail if pvt_key is not set + fail: + msg: >- + Neither private key (pvt_key) is set. + Please export PVT_KEY. + when: not pvt_key + + - name: Import private key in laconicd + shell: | + laconic-so deployment --dir {{ data_directory }}/{{ deployment_dir }} exec laconicd "laconicd keys import-hex {{ key_name }} {{ pvt_key }}" + + - name: Run create-validator script + shell: | + laconic-so deployment --dir {{ data_directory }}/{{ deployment_dir }} exec laconicd "export KEY_NAME={{ key_name }} /scripts/create-validator.sh" diff --git a/run-validator.md b/run-validator.md index 5126284..997b566 100644 --- a/run-validator.md +++ b/run-validator.md @@ -75,6 +75,42 @@ laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f ``` +## Create Validator + +- Get your private key from testnet deployment: + + ```bash + # Replace with the absolute path to the testnet deployment directory and with the name of your key + docker run -it \ + -v /data/laconicd-data:/root/.laconicd \ + cerc/laconicd:local bash -c "laconicd keys export --unarmored-hex --unsafe" + ``` + +- Export required env vars: + + ```bash + # private key of the existing account + export PVT_KEY= + + # desired key name + export KEY_NAME= + + export DATA_DIRECTORY= + export MAINNET_DEPLOYMENT_DIR= + ``` + +- Run ansible playbook to create validator on running chain: + + ```bash + ansible-playbook -i localhost, -c local playbooks/validator/create-validator.yml + ``` + +- Check the validator list: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query staking validators' + ``` + ## Register Your Node - Get your node's address: diff --git a/scripts/create-validator.sh b/scripts/create-validator.sh new file mode 100755 index 0000000..f714877 --- /dev/null +++ b/scripts/create-validator.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +DENOM=alnt + +# Create validator with fixed parameters +laconicd tx staking create-validator \ + --amount 900000000$DENOM \ + --pubkey $(laconicd tendermint show-validator) \ + --moniker "$CERC_MONIKER" \ + --chain-id "$CERC_CHAIN_ID" \ + --commission-rate 0.0 \ + --commission-max-rate 0.0 \ + --commission-max-change-rate 0.0 \ + --min-self-delegation 1 \ + --gas auto \ + --gas-adjustment 1.5 \ + --gas-prices $MIN_GAS_PRICE$DENOM \ + --from $KEY_NAME \ + --yes diff --git a/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml b/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml index 6822d82..f0b18c0 100644 --- a/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml +++ b/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml @@ -12,6 +12,7 @@ services: volumes: - laconicd-data:/root/.laconicd - ../config/mainnet-laconicd/run-laconicd.sh:/opt/run-laconicd.sh + - ../config/mainnet-laconicd/create-validator.sh:/scripts/create-validator.sh ports: - "6060" - "26657" -- 2.45.2 From 7caeca926f6e9f3714579762f9d2bdaaa771cf61 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 15 May 2025 18:32:54 +0530 Subject: [PATCH 02/14] Use temporary venv to use bech32 in python script --- .gitignore | 1 + scripts/generate-mainnet-genesis.sh | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index d4564bd..e2086ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *-deployment *-spec.yml mainnet-genesis +output # Playbook vars *-vars.yml diff --git a/scripts/generate-mainnet-genesis.sh b/scripts/generate-mainnet-genesis.sh index e1e4982..212bb04 100755 --- a/scripts/generate-mainnet-genesis.sh +++ b/scripts/generate-mainnet-genesis.sh @@ -37,12 +37,18 @@ docker run \ # -------- # Install required bech32 dependency -# TODO: Avoid installing bech32 system-wide -python3 -m pip install bech32 --break-system-packages +# Define and create venv if not exists +venv_dir="$PWD/venv" +if [ ! -d "$venv_dir" ]; then + python3 -m venv "$venv_dir" + "$venv_dir/bin/pip" install bech32 +fi -# Carry over state from testnet to mainnet echo "Carrying over state from testnet state to mainnet genesis..." -python3 $script_dir/transfer-state.py +"$venv_dir/bin/python" "$script_dir/transfer-state.py" + +# Clean up venv +rm -rf "$venv_dir" # -------- -- 2.45.2 From 67900cb3829115849c3f1b50b216aeb26d85a1a3 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Thu, 15 May 2025 15:59:17 +0530 Subject: [PATCH 03/14] Use calculated staking amount for running first val node --- demo.md | 33 +++++++++++++++---- .../run-first-validator.md | 10 ++++-- .../first-validator-vars.example.yml | 1 + .../first-validator/run-first-validator.yml | 11 +++++-- .../create-and-collect-gentx.sh | 11 +++++-- 5 files changed, 53 insertions(+), 13 deletions(-) rename run-first-validator.md => docs/run-first-validator.md (91%) diff --git a/demo.md b/demo.md index b17db00..ef69f6d 100644 --- a/demo.md +++ b/demo.md @@ -64,12 +64,6 @@ - '3317:1317' ``` -- Update permission for `genesis/mainnet-genesis.json`: - - ```bash - sudo chmod 777 ~/cerc/laconicd-stack/genesis/mainnet-genesis.json - ``` - - Run ansible playbook to set up and start your validator node: ```bash @@ -81,3 +75,30 @@ ```bash laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f ``` + +## Create Validator + +- Export required env vars: + + ```bash + # private key of the existing account + export PVT_KEY= + + # desired key name + export KEY_NAME= + + export DATA_DIRECTORY= + export MAINNET_DEPLOYMENT_DIR= + ``` + +- Run ansible playbook to create validator on running chain: + + ```bash + ansible-playbook -i localhost, -c local playbooks/validator/create-validator.yml + ``` + +- Check the validator list: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query staking validators' + ``` diff --git a/run-first-validator.md b/docs/run-first-validator.md similarity index 91% rename from run-first-validator.md rename to docs/run-first-validator.md index a8507c8..8b17b12 100644 --- a/run-first-validator.md +++ b/docs/run-first-validator.md @@ -79,14 +79,18 @@ # Private key of the existing account in hex format (required for gentx) pvt_key: "" - # Path to the generated mainnet genesis file generated in the previous step - genesis_file: "" + # Path to the generated mainnet genesis file + # Use the absolute path of generated output directory in the previous steps + genesis_file: "/genesis.json" + + # Path to staking-amount.json generated in previous steps + staking_amount_file: "/staking-amount.json" # Set custom moniker for the node cerc_moniker: "LaconicMainnetNode" # Set desired key name - key_name: "validator" + key_name: "laconic-validator" ``` - Export the data directory and mainnet deployment directory as environment variables: diff --git a/playbooks/first-validator/first-validator-vars.example.yml b/playbooks/first-validator/first-validator-vars.example.yml index 6d8b34f..719ff11 100644 --- a/playbooks/first-validator/first-validator-vars.example.yml +++ b/playbooks/first-validator/first-validator-vars.example.yml @@ -5,3 +5,4 @@ cerc_loglevel: "info" key_name: "validator" pvt_key: "" genesis_file: +staking_amount_file: diff --git a/playbooks/first-validator/run-first-validator.yml b/playbooks/first-validator/run-first-validator.yml index 732a7c9..5ca8530 100644 --- a/playbooks/first-validator/run-first-validator.yml +++ b/playbooks/first-validator/run-first-validator.yml @@ -20,8 +20,9 @@ fail: msg: >- Required key files are not defined. - Please set genesis_file in first-validator-vars.yml. - when: not genesis_file + Please set genesis_file and staking_amount_file in first-validator-vars.yml. + when: not genesis_file or not staking_amount_file + - name: Fetch laconicd stack shell: laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull @@ -62,6 +63,12 @@ state: directory mode: '0755' + - name: Copy staking amount file to laconicd-data tmp directory + copy: + src: "{{ staking_amount_file }}" + dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp/staking-amount.json" + mode: '0644' + - name: Copy genesis file to laconicd-data tmp directory copy: src: "{{ genesis_file }}" diff --git a/stack-orchestrator/config/mainnet-laconicd/create-and-collect-gentx.sh b/stack-orchestrator/config/mainnet-laconicd/create-and-collect-gentx.sh index 1e1e111..12e00f1 100755 --- a/stack-orchestrator/config/mainnet-laconicd/create-and-collect-gentx.sh +++ b/stack-orchestrator/config/mainnet-laconicd/create-and-collect-gentx.sh @@ -4,6 +4,7 @@ set -e NODE_HOME=/root/.laconicd genesis_file_path=$NODE_HOME/config/genesis.json +# TODO: Set to OS keyring backend KEYRING="test" if [ -f "$genesis_file_path" ]; then @@ -27,6 +28,12 @@ if [ ! -f ${input_genesis_file} ]; then exit 1 fi +staking_amount_file="$NODE_HOME/tmp/staking-amount.json" +if [ ! -f "$staking_amount_file" ]; then + echo "staking-amount.json file not provided, exiting..." + exit 1 +fi + DENOM=alnt # Strip leading and trailing quotes ("") if they exist @@ -53,8 +60,8 @@ if [ -z "$account_address" ]; then exit 1 fi -# TODO: Use staking amount from output/staking-amount.json -stake_amount=900000000 +# Set staking amount +stake_amount=$(jq -r '.amount' "$staking_amount_file") # Create gentx with staked amount equal to allocated balance laconicd genesis gentx $KEY_NAME $stake_amount$DENOM --chain-id $CHAIN_ID --keyring-backend $KEYRING -- 2.45.2 From 1d5901a401efc022dad20e560b88af3be96ec2a6 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 15 May 2025 19:14:24 +0530 Subject: [PATCH 04/14] Use calculated staked amount while creating subsequent validators --- scripts/create-validator.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/create-validator.sh b/scripts/create-validator.sh index f714877..24d0f18 100755 --- a/scripts/create-validator.sh +++ b/scripts/create-validator.sh @@ -3,9 +3,20 @@ set -e DENOM=alnt +NODE_HOME=/root/.laconicd + +staking_amount_file="$NODE_HOME/tmp/staking-amount.json" +if [ ! -f "$staking_amount_file" ]; then + echo "staking-amount.json file not provided, exiting..." + exit 1 +fi + +# Set staking amount +stake_amount=$(jq -r '.amount' "$staking_amount_file") + # Create validator with fixed parameters laconicd tx staking create-validator \ - --amount 900000000$DENOM \ + --amount $stake_amount$DENOM \ --pubkey $(laconicd tendermint show-validator) \ --moniker "$CERC_MONIKER" \ --chain-id "$CERC_CHAIN_ID" \ -- 2.45.2 From 9977c55f15ddddc607460c7d9c0230878d842dea Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 15 May 2025 19:22:11 +0530 Subject: [PATCH 05/14] Move readme steps to docs --- README.md | 4 ++-- demo.md => docs/demo.md | 2 +- run-validator.md => docs/run-validator.md | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename demo.md => docs/demo.md (98%) rename run-validator.md => docs/run-validator.md (100%) diff --git a/README.md b/README.md index 3973081..e81912c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # laconicd-stack -- Follow [run-first-validator.md](run-first-validator.md) to run the first validator node -- Follow [run-validator.md](run-validator.md) to run subsequent validator nodes +- Follow [run-first-validator.md](docs/run-first-validator.md) to run the first validator node +- Follow [run-validator.md](docs/run-validator.md) to run subsequent validator nodes diff --git a/demo.md b/docs/demo.md similarity index 98% rename from demo.md rename to docs/demo.md index ef69f6d..145fc68 100644 --- a/demo.md +++ b/docs/demo.md @@ -7,7 +7,7 @@ ## Run node -- Follow these steps to run first validator node: [run-first-validator.md](run-first-validator.md) +- Follow these steps to run first validator node: [run-first-validator.md](./run-first-validator.md) - Following steps can be used to run subsequent validator nodes diff --git a/run-validator.md b/docs/run-validator.md similarity index 100% rename from run-validator.md rename to docs/run-validator.md -- 2.45.2 From 77d3a832a752fe8f7d38f66e9c2765c34eb7459e Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 15 May 2025 19:55:14 +0530 Subject: [PATCH 06/14] Update compose file for using crate validor script --- docs/demo.md | 1 + docs/run-first-validator.md | 9 ++++++++- docs/run-validator.md | 1 + playbooks/validator/create-validator.yml | 4 ++-- scripts/create-validator.sh | 2 +- .../compose/docker-compose-mainnet-laconicd.yml | 2 +- .../config/mainnet-laconicd/create-and-collect-gentx.sh | 2 +- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/demo.md b/docs/demo.md index 145fc68..c15809d 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -93,6 +93,7 @@ - Run ansible playbook to create validator on running chain: + ```bash ansible-playbook -i localhost, -c local playbooks/validator/create-validator.yml ``` diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 8b17b12..da5ce49 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -65,7 +65,14 @@ ## Run node - +- Get your private key from testnet deployment: + + ```bash + # Replace with the absolute path to the testnet deployment directory and with the name of your key + docker run -it \ + -v /data/laconicd-data:/root/.laconicd \ + cerc/laconicd:local bash -c "laconicd keys export --unarmored-hex --unsafe" + ``` - Copy the example variables file if not already done: diff --git a/docs/run-validator.md b/docs/run-validator.md index 997b566..8b00c2d 100644 --- a/docs/run-validator.md +++ b/docs/run-validator.md @@ -101,6 +101,7 @@ - Run ansible playbook to create validator on running chain: + ```bash ansible-playbook -i localhost, -c local playbooks/validator/create-validator.yml ``` diff --git a/playbooks/validator/create-validator.yml b/playbooks/validator/create-validator.yml index 6afc24d..b2ef1fa 100644 --- a/playbooks/validator/create-validator.yml +++ b/playbooks/validator/create-validator.yml @@ -23,8 +23,8 @@ - name: Import private key in laconicd shell: | - laconic-so deployment --dir {{ data_directory }}/{{ deployment_dir }} exec laconicd "laconicd keys import-hex {{ key_name }} {{ pvt_key }}" + laconic-so deployment --dir {{ data_directory }}/{{ deployment_dir }} exec laconicd "laconicd keys import-hex {{ key_name }} {{ pvt_key }} --keyring-backend test" - name: Run create-validator script shell: | - laconic-so deployment --dir {{ data_directory }}/{{ deployment_dir }} exec laconicd "export KEY_NAME={{ key_name }} /scripts/create-validator.sh" + laconic-so deployment --dir {{ data_directory }}/{{ deployment_dir }} exec laconicd "export KEY_NAME={{ key_name }} ~/cerc/laconicd-stack/scripts/create-validator.sh" diff --git a/scripts/create-validator.sh b/scripts/create-validator.sh index 24d0f18..120089b 100755 --- a/scripts/create-validator.sh +++ b/scripts/create-validator.sh @@ -12,7 +12,7 @@ if [ ! -f "$staking_amount_file" ]; then fi # Set staking amount -stake_amount=$(jq -r '.amount' "$staking_amount_file") +stake_amount=$(jq -r '.common_staking_amount' "$staking_amount_file") # Create validator with fixed parameters laconicd tx staking create-validator \ diff --git a/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml b/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml index f0b18c0..8c5da69 100644 --- a/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml +++ b/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml @@ -12,7 +12,7 @@ services: volumes: - laconicd-data:/root/.laconicd - ../config/mainnet-laconicd/run-laconicd.sh:/opt/run-laconicd.sh - - ../config/mainnet-laconicd/create-validator.sh:/scripts/create-validator.sh + - ../../scripts/create-validator.sh:/scripts/create-validator.sh ports: - "6060" - "26657" diff --git a/stack-orchestrator/config/mainnet-laconicd/create-and-collect-gentx.sh b/stack-orchestrator/config/mainnet-laconicd/create-and-collect-gentx.sh index 12e00f1..d845554 100755 --- a/stack-orchestrator/config/mainnet-laconicd/create-and-collect-gentx.sh +++ b/stack-orchestrator/config/mainnet-laconicd/create-and-collect-gentx.sh @@ -61,7 +61,7 @@ if [ -z "$account_address" ]; then fi # Set staking amount -stake_amount=$(jq -r '.amount' "$staking_amount_file") +stake_amount=$(jq -r '.common_staking_amount' "$staking_amount_file") # Create gentx with staked amount equal to allocated balance laconicd genesis gentx $KEY_NAME $stake_amount$DENOM --chain-id $CHAIN_ID --keyring-backend $KEYRING -- 2.45.2 From 80acf3c745c3078655588b7a745ae64431987d76 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Fri, 16 May 2025 10:10:42 +0530 Subject: [PATCH 07/14] Fix script to create validator in subsequent nodes --- {genesis => config}/.gitkeep | 0 docs/run-first-validator.md | 14 +++++-- docs/run-validator.md | 5 ++- playbooks/validator/create-validator.yml | 2 +- playbooks/validator/run-validator.yml | 11 ++++- .../validator/validator-vars.example.yml | 3 +- scripts/create-validator.sh | 31 -------------- .../docker-compose-mainnet-laconicd.yml | 2 +- .../mainnet-laconicd/create-validator.sh | 40 +++++++++++++++++++ 9 files changed, 67 insertions(+), 41 deletions(-) rename {genesis => config}/.gitkeep (100%) delete mode 100755 scripts/create-validator.sh create mode 100755 stack-orchestrator/config/mainnet-laconicd/create-validator.sh diff --git a/genesis/.gitkeep b/config/.gitkeep similarity index 100% rename from genesis/.gitkeep rename to config/.gitkeep diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index da5ce49..012fa44 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -129,12 +129,18 @@ laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query bond list' ``` -## Publish Genesis File and Node Address +## Publish required artifacts -- Copy the genesis file to [genesis](./genesis) folder: +- Copy the genesis file to [config](./config) folder: ```bash - sudo cp $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/genesis.json ~/cerc/laconicd-stack/genesis/mainnet-genesis.json + cp $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/genesis.json ~/cerc/laconicd-stack/config/mainnet-genesis.json + ``` + +- Copy the staking amount file to [config](./config) folder: + + ```bash + cp /staking-amount.json ~/cerc/laconicd-stack/config/staking-amount.json ``` - Get your node's address: @@ -145,4 +151,4 @@ - Add your node's address to [node-addresses.yml](./node-addresses.yml) -- Submit a PR with this genesis file and node address so that it is available to other validators +- Submit a PR with this genesis file, staking amount file and node address so that it is available to other validators diff --git a/docs/run-validator.md b/docs/run-validator.md index 8b00c2d..3e36182 100644 --- a/docs/run-validator.md +++ b/docs/run-validator.md @@ -33,7 +33,10 @@ ```bash # Path to the genesis file published by the first validator - genesis_file: "~/cerc/laconicd-stack/genesis/mainnet-genesis.json" + genesis_file: "~/cerc/laconicd-stack/config/mainnet-genesis.json" + + # Path to the staking amount file published by the first validator + staking_amount_file: "~/cerc/laconicd-stack/config/staking-amount.json" # Set custom moniker for the node cerc_moniker: "LaconicMainnetNode" diff --git a/playbooks/validator/create-validator.yml b/playbooks/validator/create-validator.yml index b2ef1fa..feafe29 100644 --- a/playbooks/validator/create-validator.yml +++ b/playbooks/validator/create-validator.yml @@ -27,4 +27,4 @@ - name: Run create-validator script shell: | - laconic-so deployment --dir {{ data_directory }}/{{ deployment_dir }} exec laconicd "export KEY_NAME={{ key_name }} ~/cerc/laconicd-stack/scripts/create-validator.sh" + laconic-so deployment --dir {{ data_directory }}/{{ deployment_dir }} exec laconicd "KEY_NAME={{ key_name }} /scripts/create-validator.sh" diff --git a/playbooks/validator/run-validator.yml b/playbooks/validator/run-validator.yml index 9a5bd2b..8fcc0a9 100644 --- a/playbooks/validator/run-validator.yml +++ b/playbooks/validator/run-validator.yml @@ -20,8 +20,9 @@ fail: msg: >- Required key files are not defined. - Please set genesis_file in validator-vars.yml. - when: not genesis_file + Please set genesis_file and staking_amount_file in validator-vars.yml. + when: not genesis_file or not staking_amount_file + - name: Fetch laconicd stack shell: laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull @@ -63,6 +64,12 @@ state: directory mode: '0755' + - name: Copy staking amount file to laconicd-data tmp directory + copy: + src: "{{ staking_amount_file }}" + dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp/staking-amount.json" + mode: '0644' + - name: Copy genesis file to laconicd-data tmp directory copy: src: "{{ genesis_file }}" diff --git a/playbooks/validator/validator-vars.example.yml b/playbooks/validator/validator-vars.example.yml index 4fa9440..1590078 100644 --- a/playbooks/validator/validator-vars.example.yml +++ b/playbooks/validator/validator-vars.example.yml @@ -2,5 +2,6 @@ cerc_moniker: "LaconicMainnetNode" cerc_chain_id: "laconic-mainnet" min_gas_price: 0.001 cerc_loglevel: "info" -genesis_file: "~/cerc/laconicd-stack/genesis/mainnet-genesis.json" +genesis_file: "~/cerc/laconicd-stack/config/mainnet-genesis.json" +staking_amount_file: "~/cerc/laconicd-stack/config/staking-amount.json" cerc_peers: "" diff --git a/scripts/create-validator.sh b/scripts/create-validator.sh deleted file mode 100755 index 120089b..0000000 --- a/scripts/create-validator.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -set -e - -DENOM=alnt - -NODE_HOME=/root/.laconicd - -staking_amount_file="$NODE_HOME/tmp/staking-amount.json" -if [ ! -f "$staking_amount_file" ]; then - echo "staking-amount.json file not provided, exiting..." - exit 1 -fi - -# Set staking amount -stake_amount=$(jq -r '.common_staking_amount' "$staking_amount_file") - -# Create validator with fixed parameters -laconicd tx staking create-validator \ - --amount $stake_amount$DENOM \ - --pubkey $(laconicd tendermint show-validator) \ - --moniker "$CERC_MONIKER" \ - --chain-id "$CERC_CHAIN_ID" \ - --commission-rate 0.0 \ - --commission-max-rate 0.0 \ - --commission-max-change-rate 0.0 \ - --min-self-delegation 1 \ - --gas auto \ - --gas-adjustment 1.5 \ - --gas-prices $MIN_GAS_PRICE$DENOM \ - --from $KEY_NAME \ - --yes diff --git a/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml b/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml index 8c5da69..f0b18c0 100644 --- a/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml +++ b/stack-orchestrator/compose/docker-compose-mainnet-laconicd.yml @@ -12,7 +12,7 @@ services: volumes: - laconicd-data:/root/.laconicd - ../config/mainnet-laconicd/run-laconicd.sh:/opt/run-laconicd.sh - - ../../scripts/create-validator.sh:/scripts/create-validator.sh + - ../config/mainnet-laconicd/create-validator.sh:/scripts/create-validator.sh ports: - "6060" - "26657" diff --git a/stack-orchestrator/config/mainnet-laconicd/create-validator.sh b/stack-orchestrator/config/mainnet-laconicd/create-validator.sh new file mode 100755 index 0000000..639f7d6 --- /dev/null +++ b/stack-orchestrator/config/mainnet-laconicd/create-validator.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e + +DENOM=alnt + +NODE_HOME=/root/.laconicd +KEYRING="test" + +staking_amount_file="$NODE_HOME/tmp/staking-amount.json" +if [ ! -f "$staking_amount_file" ]; then + echo "staking-amount.json file not provided, exiting..." + exit 1 +fi + +# Set staking amount +stake_amount=$(jq -r '.common_staking_amount' "$staking_amount_file") + +# Create validator.json file +validator_json="$NODE_HOME/tmp/validator.json" +cat > "$validator_json" << EOF +{ + "pubkey": $(laconicd tendermint show-validator), + "amount": "${stake_amount}${DENOM}", + "moniker": "${CERC_MONIKER}", + "commission-rate": "0.0", + "commission-max-rate": "0.0", + "commission-max-change-rate": "0.0", + "min-self-delegation": "1" +} +EOF + +# Create validator using the JSON file +laconicd tx staking create-validator "$validator_json" \ + --chain-id "$CERC_CHAIN_ID" \ + --gas auto \ + --gas-adjustment 1.5 \ + --gas-prices $MIN_GAS_PRICE$DENOM \ + --from $KEY_NAME \ + --keyring-backend $KEYRING \ + --yes -- 2.45.2 From b459195eab21a72e0fddb81ec5e6feef3864d7be Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Fri, 16 May 2025 11:10:18 +0530 Subject: [PATCH 08/14] Update docs --- .gitignore | 1 - docs/demo.md | 12 +++------ docs/run-first-validator.md | 8 +++--- docs/run-validator.md | 25 +++---------------- .../first-validator-vars.example.yml | 6 ++--- .../validator/validator-vars.example.yml | 2 +- .../config/mainnet-laconicd/run-laconicd.sh | 1 - 7 files changed, 14 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index e2086ed..3be07f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *-deployment *-spec.yml -mainnet-genesis output # Playbook vars diff --git a/docs/demo.md b/docs/demo.md index c15809d..bbf9a05 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -11,14 +11,6 @@ - Following steps can be used to run subsequent validator nodes -- Fetch the stack: - - ```bash - laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull - ``` - - This command clones the entire repository into the `~/cerc` folder, which includes the genesis file published by the first validator. - - Copy the example variables file: ```bash @@ -36,6 +28,8 @@ - Update `cerc_peers` in `~/cerc/laconicd-stack/playbooks/validator/validator-vars.yml`: ```bash + cerc_moniker: "LaconicMainnetNode-2" + cerc_peers: "@host.docker.internal:26656" ``` @@ -50,7 +44,7 @@ export MAINNET_DEPLOYMENT_DIR= ``` -- Update port mappings in `~/cerc/laconicd-stack/playbooks/validator/templates/specs/spec-template.yml.j2` with: +- Update port mappings in `~/cerc/laconicd-stack/playbooks/validator/templates/specs/spec-template.yml.j2` to avoid port conflicts with first validator node: ```bash network: diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 012fa44..b9af21d 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -5,16 +5,14 @@ - [ansible](playbooks/README.md#ansible-installation) - [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install) -## Stop testnet node +## Generate mainnet genesis file -- Stop the testnet node: +- Stop the node for SAPO testnet: ```bash laconic-so deployment --dir stop ``` -## Generate mainnet genesis file - - Fetch the stack in machine where the testnet chain node is running: ```bash @@ -84,7 +82,7 @@ ```bash # Private key of the existing account in hex format (required for gentx) - pvt_key: "" + pvt_key: "" # Path to the generated mainnet genesis file # Use the absolute path of generated output directory in the previous steps diff --git a/docs/run-validator.md b/docs/run-validator.md index 3e36182..f359113 100644 --- a/docs/run-validator.md +++ b/docs/run-validator.md @@ -5,16 +5,14 @@ - [ansible](playbooks/README.md#ansible-installation) - [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install) -## Stop testnet node +## Run node -- Stop the testnet node: +- Stop the node for SAPO testnet: ```bash laconic-so deployment --dir stop ``` -## Run node - - Fetch the stack: ```bash @@ -32,26 +30,11 @@ - Update `~/cerc/laconicd-stack/playbooks/validator/validator-vars.yml` with required values: ```bash - # Path to the genesis file published by the first validator - genesis_file: "~/cerc/laconicd-stack/config/mainnet-genesis.json" - - # Path to the staking amount file published by the first validator - staking_amount_file: "~/cerc/laconicd-stack/config/staking-amount.json" - # Set custom moniker for the node - cerc_moniker: "LaconicMainnetNode" - - # Set chain ID (should match the one in the genesis file) - cerc_chain_id: "laconic-mainnet" - - # Set minimum gas price - min_gas_price: 0.001 - - # Set log level - cerc_loglevel: "info" + cerc_moniker: "" # Set persistent peers (comma-separated list of node IDs and addresses) - # You can find the list of available peers in node-addresses.yml + # You can find the list of available peers in https://git.vdb.to/cerc-io/laconicd-stack/src/branch/main/node-addresses.yml cerc_peers: "@:26656,@:26656" ``` diff --git a/playbooks/first-validator/first-validator-vars.example.yml b/playbooks/first-validator/first-validator-vars.example.yml index 719ff11..c66ff5f 100644 --- a/playbooks/first-validator/first-validator-vars.example.yml +++ b/playbooks/first-validator/first-validator-vars.example.yml @@ -2,7 +2,7 @@ cerc_moniker: "LaconicMainnetNode" cerc_chain_id: "laconic-mainnet" min_gas_price: 0.001 cerc_loglevel: "info" -key_name: "validator" +key_name: "laconic-validator" pvt_key: "" -genesis_file: -staking_amount_file: +genesis_file: "" +staking_amount_file: "" diff --git a/playbooks/validator/validator-vars.example.yml b/playbooks/validator/validator-vars.example.yml index 1590078..df003fe 100644 --- a/playbooks/validator/validator-vars.example.yml +++ b/playbooks/validator/validator-vars.example.yml @@ -1,7 +1,7 @@ -cerc_moniker: "LaconicMainnetNode" cerc_chain_id: "laconic-mainnet" min_gas_price: 0.001 cerc_loglevel: "info" genesis_file: "~/cerc/laconicd-stack/config/mainnet-genesis.json" staking_amount_file: "~/cerc/laconicd-stack/config/staking-amount.json" +cerc_moniker: "" cerc_peers: "" diff --git a/stack-orchestrator/config/mainnet-laconicd/run-laconicd.sh b/stack-orchestrator/config/mainnet-laconicd/run-laconicd.sh index 047b659..7051bea 100755 --- a/stack-orchestrator/config/mainnet-laconicd/run-laconicd.sh +++ b/stack-orchestrator/config/mainnet-laconicd/run-laconicd.sh @@ -53,7 +53,6 @@ else sed -i 's/prometheus = false/prometheus = true/g' $NODE_HOME/config/config.toml fi - echo "Starting laconicd node..." laconicd start \ --api.enable \ -- 2.45.2 From e4803f0435021ced70ed4a4c4b1f2e4414e052b1 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Fri, 16 May 2025 12:01:21 +0530 Subject: [PATCH 09/14] Update auction durations in transfer state script --- scripts/transfer-state.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/transfer-state.py b/scripts/transfer-state.py index 39ee7dc..1b0d0ab 100644 --- a/scripts/transfer-state.py +++ b/scripts/transfer-state.py @@ -69,6 +69,10 @@ mainnet_state["app_state"]["registry"] = testnet_state["app_state"]["registry"] mainnet_state["app_state"]["slashing"]["params"] = testnet_state["app_state"]["slashing"]["params"] mainnet_state["consensus"]["params"] = testnet_state["consensus"]["params"] +# Update authority auction durations from 3600s to 60s +mainnet_state["app_state"]["registry"]["params"]["authority_auction_commits_duration"] = "60s" +mainnet_state["app_state"]["registry"]["params"]["authority_auction_reveals_duration"] = "60s" + #------ # Allocate back delegation stakes -- 2.45.2 From fbdb598e797ac2fcf88050d2e8042ec32d6edc42 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Fri, 16 May 2025 13:58:54 +0530 Subject: [PATCH 10/14] Update step for getting private key in docs --- .gitignore | 1 - docs/run-first-validator.md | 17 ++++++++--------- docs/run-validator.md | 17 ++++++++--------- .../config/mainnet-laconicd/create-validator.sh | 10 ++++++++++ 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 3be07f6..9098bbb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *-deployment *-spec.yml -output # Playbook vars *-vars.yml diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index b9af21d..052b755 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -7,6 +7,14 @@ ## Generate mainnet genesis file +- Get your private key from testnet deployment: + + ```bash + laconic-so deployment --dir exec laconicd "laconicd keys export --unarmored-hex --unsafe" + ``` + + NOTE: Store this key securely as it is needed in later steps + - Stop the node for SAPO testnet: ```bash @@ -63,15 +71,6 @@ ## Run node -- Get your private key from testnet deployment: - - ```bash - # Replace with the absolute path to the testnet deployment directory and with the name of your key - docker run -it \ - -v /data/laconicd-data:/root/.laconicd \ - cerc/laconicd:local bash -c "laconicd keys export --unarmored-hex --unsafe" - ``` - - Copy the example variables file if not already done: ```bash diff --git a/docs/run-validator.md b/docs/run-validator.md index f359113..5eec5e6 100644 --- a/docs/run-validator.md +++ b/docs/run-validator.md @@ -7,6 +7,14 @@ ## Run node +- Get your private key from testnet deployment: + + ```bash + laconic-so deployment --dir exec laconicd "laconicd keys export --unarmored-hex --unsafe" + ``` + + NOTE: Store this key securely as it is needed in later steps + - Stop the node for SAPO testnet: ```bash @@ -63,15 +71,6 @@ ## Create Validator -- Get your private key from testnet deployment: - - ```bash - # Replace with the absolute path to the testnet deployment directory and with the name of your key - docker run -it \ - -v /data/laconicd-data:/root/.laconicd \ - cerc/laconicd:local bash -c "laconicd keys export --unarmored-hex --unsafe" - ``` - - Export required env vars: ```bash diff --git a/stack-orchestrator/config/mainnet-laconicd/create-validator.sh b/stack-orchestrator/config/mainnet-laconicd/create-validator.sh index 639f7d6..e9c04aa 100755 --- a/stack-orchestrator/config/mainnet-laconicd/create-validator.sh +++ b/stack-orchestrator/config/mainnet-laconicd/create-validator.sh @@ -12,6 +12,16 @@ if [ ! -f "$staking_amount_file" ]; then exit 1 fi +if [-z "$KEY_NAME" ]; then + echo "KEY_NAME environment variable not set, exiting..." + exit 1 +fi + +if [ -z "$CERC_MONIKER" ]; then + echo "CERC_MONIKER environment variable not set, exiting..." + exit 1 +fi + # Set staking amount stake_amount=$(jq -r '.common_staking_amount' "$staking_amount_file") -- 2.45.2 From c31ed033efef8cb9d19f897e637a93734f9fdccf Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 16 May 2025 14:29:00 +0530 Subject: [PATCH 11/14] Update genesis generation to use add-genesis-lockup-account command --- docs/run-first-validator.md | 5 +++- .../first-validator/generate-genesis.yml | 5 ++-- .../first-validator/run-first-validator.yml | 2 +- scripts/generate-mainnet-genesis.sh | 17 +++++++---- scripts/genesis.sh | 28 ++++++------------- 5 files changed, 28 insertions(+), 29 deletions(-) diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 052b755..171fa35 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -43,10 +43,13 @@ - Copy over the exported `testnet-state.json` file to target machine +- Copy over the LPS lockup distribution `distribution.json` file to target machine + - Set envs: ```bash export EXPORTED_STATE_PATH= + export LPS_DISTRIBUTION_PATH= export EARLY_SUPPORTS_ACC_ADDR= ``` @@ -59,7 +62,7 @@ - Run playbook to use exported state for generating mainnet genesis: ```bash - 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" + ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/generate-genesis.yml -e "exported_state_path=$EXPORTED_STATE_PATH" -e "lps_distribution_path=$LPS_DISTRIBUTION_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 diff --git a/playbooks/first-validator/generate-genesis.yml b/playbooks/first-validator/generate-genesis.yml index d265fd2..d809b0e 100644 --- a/playbooks/first-validator/generate-genesis.yml +++ b/playbooks/first-validator/generate-genesis.yml @@ -9,9 +9,10 @@ ansible.builtin.shell: cmd: "laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd setup-repositories --git-ssh --pull" + # TODO: Add a flag to control force rebuild - name: Build containers ansible.builtin.shell: - cmd: "laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers" + cmd: "laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers --force-rebuild" - name: Copy exported testnet state file ansible.builtin.copy: @@ -22,7 +23,7 @@ - block: - name: Run script to generate genesis file ansible.builtin.shell: - cmd: "CHAIN_ID={{ cerc_chain_id }} EARLY_SUPPORTS_ACC_ADDRESS={{ early_supports_acc_address }} {{ ansible_env.HOME }}/cerc/laconicd-stack/scripts/generate-mainnet-genesis.sh {{ ansible_env.HOME }}/cerc/laconicd-stack/testnet-state.json" + cmd: "CHAIN_ID={{ cerc_chain_id }} EARLY_SUPPORTS_ACC_ADDRESS={{ early_supports_acc_address }} {{ ansible_env.HOME }}/cerc/laconicd-stack/scripts/generate-mainnet-genesis.sh {{ ansible_env.HOME }}/cerc/laconicd-stack/testnet-state.json {{ lps_distribution_path }}" chdir: "{{ lookup('env', 'PWD') }}" always: - name: Clean up temporary genesis directory diff --git a/playbooks/first-validator/run-first-validator.yml b/playbooks/first-validator/run-first-validator.yml index 5ca8530..df87d38 100644 --- a/playbooks/first-validator/run-first-validator.yml +++ b/playbooks/first-validator/run-first-validator.yml @@ -33,7 +33,7 @@ - name: Build container images shell: | - laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers + laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers --force-rebuild - name: Create deployment spec file shell: | diff --git a/scripts/generate-mainnet-genesis.sh b/scripts/generate-mainnet-genesis.sh index 212bb04..476d14f 100755 --- a/scripts/generate-mainnet-genesis.sh +++ b/scripts/generate-mainnet-genesis.sh @@ -5,23 +5,30 @@ set -e set -u # Check args -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " exit 1 fi TESTNET_STATE_FILE="$1" +LPS_DISTRIBUTION_FILE="$2" MAINNET_GENESIS_DIR=mainnet-genesis OUTPUT_DIR=output +if ! jq empty $LPS_DISTRIBUTION_FILE >/dev/null 2>&1; then + echo "$LPS_DISTRIBUTION_FILE is not a valid JSON" + exit 1 +fi + # Create a required target directories mkdir -p $MAINNET_GENESIS_DIR mkdir -p $OUTPUT_DIR # -------- -# Copy testnet state file to required dir +# Copy testnet state file and distribution to required dir cp $TESTNET_STATE_FILE $MAINNET_GENESIS_DIR/testnet-state.json +cp $LPS_DISTRIBUTION_FILE $MAINNET_GENESIS_DIR/distribution.json # -------- @@ -40,8 +47,8 @@ docker run \ # Define and create venv if not exists venv_dir="$PWD/venv" if [ ! -d "$venv_dir" ]; then - python3 -m venv "$venv_dir" - "$venv_dir/bin/pip" install bech32 + python3 -m venv "$venv_dir" + "$venv_dir/bin/pip" install bech32 fi echo "Carrying over state from testnet state to mainnet genesis..." diff --git a/scripts/genesis.sh b/scripts/genesis.sh index da012c7..c84d937 100755 --- a/scripts/genesis.sh +++ b/scripts/genesis.sh @@ -16,14 +16,15 @@ if [ -z "$EARLY_SUPPORTS_ACC_ADDRESS" ]; then 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 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="alps" +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 @@ -43,22 +44,9 @@ update_genesis '.app_state["gov"]["params"]["expedited_threshold"]="1.0000000000 # 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 +# Perform lps allocations laconicd genesis add-genesis-account $EARLY_SUPPORTS_ACC_ADDRESS $EARLY_SUPPORTS_ALLOC$LPS_DENOM --keyring-backend $KEYRING --append - -# Use zero address to add an account for lps_lockup -zero_address="laconic1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqklcls0" -laconicd genesis add-genesis-account $zero_address $LOCKUP_ALLOC$LPS_DENOM --keyring-backend $KEYRING --module-name $LPS_LOCKUP_MODULE_ACCOUNT - -# Update the lps_lockup address in bank module state -lps_lockup_address=$(jq -r '.app_state.auth.accounts[] | select(.name == "lps_lockup") | .base_account.address' $HOME/.laconicd/config/genesis.json) -jq --arg old "$zero_address" --arg new "$lps_lockup_address" \ - '.app_state.bank.balances |= map(if .address == $old then .address = $new else . end)' "$mainnet_genesis_file" > tmp.$$.json \ - && mv tmp.$$.json "$mainnet_genesis_file" -jq '(.app_state.auth.accounts[] | select(.name == "lps_lockup") | .permissions) = []' "$mainnet_genesis_file" > tmp.$$.json \ - && mv tmp.$$.json "$mainnet_genesis_file" - -# TODO: Dump JSON for allocations in LPS_LOCKUP_MODULE_ACCOUNT state +laconicd genesis add-genesis-lockup-account lps_lockup $distribution_file $LOCKUP_ALLOC$LPS_DENOM # Ensure that resulting genesis file is valid laconicd genesis validate -- 2.45.2 From 696093877c2629e32faaf5cf2d9be968d886c45d Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Fri, 16 May 2025 14:39:48 +0530 Subject: [PATCH 12/14] Upadate docs --- docs/run-first-validator.md | 2 +- docs/run-validator.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 171fa35..6de1aa7 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -83,7 +83,7 @@ - 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) + # Use the private key of the existing account that was exported in previous steps pvt_key: "" # Path to the generated mainnet genesis file diff --git a/docs/run-validator.md b/docs/run-validator.md index 5eec5e6..4f18834 100644 --- a/docs/run-validator.md +++ b/docs/run-validator.md @@ -74,7 +74,7 @@ - Export required env vars: ```bash - # private key of the existing account + # Use the private key of the existing account that was exported in previous steps export PVT_KEY= # desired key name -- 2.45.2 From b86cdcb1ec7c0271ac20c788407442260a7db14f Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 16 May 2025 15:10:08 +0530 Subject: [PATCH 13/14] Add steps to check token balances on starting chain --- docs/run-first-validator.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 6de1aa7..9ce040c 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -129,6 +129,27 @@ laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query bond list' ``` +- Check `alps` and `alnt` tokens total supply: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query bank total-supply' + ``` + +- Query the `lps_lockup` account and view distribution: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query auth module-account lps_lockup' + ``` + +- Query the `lps_lockup` and early supports accounts balances: + + ```bash + lockup_account_address=$(laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query auth module-account lps_lockup -o json | jq -r .account.value.base_account.address') + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd "laconicd query bank balances $lockup_account_address" + + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd "laconicd query bank balances $EARLY_SUPPORTS_ACC_ADDR" + ``` + ## Publish required artifacts - Copy the genesis file to [config](./config) folder: -- 2.45.2 From 29d8578bfbbc2f40c288d06c73261465ee100ba6 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 16 May 2025 15:21:52 +0530 Subject: [PATCH 14/14] Fix paths --- docs/demo.md | 2 +- docs/run-validator.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/demo.md b/docs/demo.md index bbf9a05..371ab0f 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -89,7 +89,7 @@ ```bash - ansible-playbook -i localhost, -c local playbooks/validator/create-validator.yml + ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/create-validator.yml ``` - Check the validator list: diff --git a/docs/run-validator.md b/docs/run-validator.md index 4f18834..400a409 100644 --- a/docs/run-validator.md +++ b/docs/run-validator.md @@ -88,7 +88,7 @@ ```bash - ansible-playbook -i localhost, -c local playbooks/validator/create-validator.yml + ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/create-validator.yml ``` - Check the validator list: -- 2.45.2