Compare commits
1 Commits
main
...
ng-use-cal
Author | SHA1 | Date | |
---|---|---|---|
fa861bcf34 |
@ -1,3 +1,3 @@
|
||||
# laconicd-stack
|
||||
|
||||
- Follow [run-first-validator.md](run-first-validator.md) to run the first validator node
|
||||
- Follow [run-first-validator.md](./docs/run-first-validator.md) to run the first validator node
|
||||
|
@ -64,14 +64,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-generated-genesis-file>"
|
||||
# Path to the generated mainnet genesis file
|
||||
# Use the absolute path of generated output directory in the previous steps
|
||||
genesis_file: "<absolute-path-to-generated-output-dir>/genesis.json"
|
||||
|
||||
# Path to staking-amount.json generated in previous steps
|
||||
staking_amount_file: "<absolute-path-to-generated-output-dir>/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:
|
@ -5,3 +5,4 @@ cerc_loglevel: "info"
|
||||
key_name: "validator"
|
||||
pvt_key: ""
|
||||
genesis_file:
|
||||
staking_amount_file:
|
||||
|
@ -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
|
||||
|
||||
@ -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 }}"
|
||||
|
@ -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,9 +60,8 @@ if [ -z "$account_address" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# TODO: Use staking amount from output/staking-amount.json
|
||||
# Get balance of account
|
||||
stake_amount=$(jq -r --arg address "$account_address" --arg denom "$DENOM" '.app_state.bank.balances[] | select(.address == $address) | .coins[] | select(.denom == $denom) | .amount' $genesis_file_path)
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user