From b844e667181a1c44806d107d4a54c384ded91698 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 15 May 2025 19:55:14 +0530 Subject: [PATCH] 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