Update scripts
This commit is contained in:
parent
44219c801c
commit
08847a3912
@ -9,9 +9,6 @@ services:
|
||||
CERC_PEERS: ${CERC_PEERS}
|
||||
MIN_GAS_PRICE: ${MIN_GAS_PRICE:-0.001}
|
||||
CERC_LOGLEVEL: ${CERC_LOGLEVEL:-info}
|
||||
INPUT_GENESIS_FILE: ${INPUT_GENESIS_FILE}
|
||||
INPUT_NODE_KEY_FILE: ${INPUT_NODE_KEY_FILE}
|
||||
INPUT_PRIV_VALIDATOR_KEY_FILE: ${INPUT_PRIV_VALIDATOR_KEY_FILE}
|
||||
volumes:
|
||||
- laconicd-data:/root/.laconicd
|
||||
- ../config/laconicd/run-laconicd.sh:/opt/run-laconicd.sh
|
||||
|
45
stack-orchestrator/config/mainnet-laconicd/allocate-lps.sh
Executable file
45
stack-orchestrator/config/mainnet-laconicd/allocate-lps.sh
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# Early supports: 12960 * 10^18 alps (10% of 129600 * 10^18 alps)
|
||||
EARLY_SUPPORTS="12960000000000000000000"
|
||||
|
||||
DENOM=alps
|
||||
|
||||
input_genesis_file=$INPUT_GENESIS_FILE
|
||||
if [ ! -f ${input_genesis_file} ]; then
|
||||
echo "Genesis file not provided, exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$RECIPIENT_ADDRESS" ]; then
|
||||
echo "Recipient address not provided, exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
update_genesis() {
|
||||
jq "$1" ${input_genesis_file} > ${input_genesis_file}.tmp &&
|
||||
mv ${input_genesis_file}.tmp ${input_genesis_file}
|
||||
}
|
||||
|
||||
# Add new account to auth.accounts
|
||||
update_genesis '.app_state["auth"]["accounts"] += [{"@type": "/cosmos.auth.v1beta1.BaseAccount", "address": "'$RECIPIENT_ADDRESS'", "pub_key": null, "account_number": "0", "sequence": "0"}]'
|
||||
|
||||
# Add balance for the new account
|
||||
update_genesis '.app_state["bank"]["balances"] += [{"address": "'$RECIPIENT_ADDRESS'", "coins": [{"denom": "'$DENOM'", "amount": "'$EARLY_SUPPORTS'"}]}]'
|
||||
|
||||
# Get current supply
|
||||
CURRENT_SUPPLY=$(jq -r '.app_state["bank"]["supply"][0]["amount"]' ${input_genesis_file})
|
||||
|
||||
# Calculate new supply
|
||||
NEW_SUPPLY=$((CURRENT_SUPPLY + EARLY_SUPPORTS))
|
||||
|
||||
# Update total supply
|
||||
update_genesis '.app_state["bank"]["supply"][0]["amount"] = "'$NEW_SUPPLY'"'
|
||||
|
||||
echo "Genesis file updated with new account ${RECIPIENT_ADDRESS} and allocated ${EARLY_SUPPORTS} ${DENOM}"
|
@ -6,19 +6,21 @@ fi
|
||||
|
||||
set -e
|
||||
|
||||
input_genesis_file=$INPUT_GENESIS_FILE
|
||||
NODE_HOME=/root/.laconicd
|
||||
|
||||
input_genesis_file=$NODE_HOME/tmp/genesis.json
|
||||
if [ ! -f ${input_genesis_file} ]; then
|
||||
echo "Genesis file not provided, exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
input_node_key_file=$INPUT_NODE_KEY_FILE
|
||||
input_node_key_file=$NODE_HOME/tmp/node_key.json
|
||||
if [ ! -f ${input_node_key_file} ]; then
|
||||
echo "Node key file not provided, exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
input_priv_validator_key_file=$INPUT_PRIV_VALIDATOR_KEY_FILE
|
||||
input_priv_validator_key_file=$NODE_HOME/tmp/priv_validator_key.json
|
||||
if [ ! -f ${input_priv_validator_key_file} ]; then
|
||||
echo "Priv validator key file not provided, exiting..."
|
||||
exit 1
|
||||
@ -36,8 +38,6 @@ echo "Persistent peers: $CERC_PEERS"
|
||||
echo "Min gas price: $MIN_GAS_PRICE"
|
||||
echo "Log level: $CERC_LOGLEVEL"
|
||||
|
||||
NODE_HOME=/root/.laconicd
|
||||
|
||||
# Set chain id in config
|
||||
laconicd config set client chain-id $CERC_CHAIN_ID --home $NODE_HOME
|
||||
|
Loading…
Reference in New Issue
Block a user