Compare commits
6 Commits
iv-rename-
...
main
Author | SHA1 | Date | |
---|---|---|---|
57e66ac5d6 | |||
79d128d667 | |||
2db37927a0 | |||
78fcfff36a | |||
f28e95fb33 | |||
77decda197 |
@ -14,6 +14,8 @@ services:
|
|||||||
AUTHORITY_GRACE_PERIOD: ${AUTHORITY_GRACE_PERIOD}
|
AUTHORITY_GRACE_PERIOD: ${AUTHORITY_GRACE_PERIOD}
|
||||||
GENESIS_FILE: /var/tmp/genesis.json
|
GENESIS_FILE: /var/tmp/genesis.json
|
||||||
MONIKER: ${MONIKER:-localtestnet}
|
MONIKER: ${MONIKER:-localtestnet}
|
||||||
|
CHAINID: ${CHAINID:-laconic_9000-1}
|
||||||
|
MIN_GAS_PRICE: ${MIN_GAS_PRICE:-0.001}
|
||||||
volumes:
|
volumes:
|
||||||
- laconicd-data:/root/.laconicd
|
- laconicd-data:/root/.laconicd
|
||||||
- genesis-config:/var/tmp
|
- genesis-config:/var/tmp
|
||||||
|
@ -105,17 +105,23 @@ Instructions for running a laconicd fixturenet along with registry CLI and conso
|
|||||||
# Enable authority auctions (default: false)
|
# Enable authority auctions (default: false)
|
||||||
AUTHORITY_AUCTION_ENABLED=true
|
AUTHORITY_AUCTION_ENABLED=true
|
||||||
|
|
||||||
# Authority auctions commits duration (in secs) (default: 24hrs)
|
# Authority auctions commits duration (in secs) (default: 1hr)
|
||||||
AUTHORITY_AUCTION_COMMITS_DURATION=3600
|
AUTHORITY_AUCTION_COMMITS_DURATION=3600
|
||||||
|
|
||||||
# Authority auctions reveals duration (in secs) (default: 24hrs)
|
# Authority auctions reveals duration (in secs) (default: 1hr)
|
||||||
AUTHORITY_AUCTION_REVEALS_DURATION=3600
|
AUTHORITY_AUCTION_REVEALS_DURATION=3600
|
||||||
|
|
||||||
# Authority grace period (set bond to authority within this) (in secs) (default: 2 * 24hrs)
|
# Authority grace period (set bond to authority within this) (in secs) (default: 2 * 1hr)
|
||||||
AUTHORITY_GRACE_PERIOD=7200
|
AUTHORITY_GRACE_PERIOD=7200
|
||||||
|
|
||||||
# Node moniker (default: "localtestnet")
|
# Node moniker (default: "localtestnet")
|
||||||
MONIKER=
|
MONIKER=
|
||||||
|
|
||||||
|
# Chain ID of the network (default: "laconic_9000-1")
|
||||||
|
CHAINID=
|
||||||
|
|
||||||
|
# Minimum gas price in alnt to accept for transactions (default: "0.001")
|
||||||
|
MIN_GAS_PRICE=
|
||||||
```
|
```
|
||||||
|
|
||||||
* Inside the `laconic-console-deployment` deployment directory, open `config.env` file and set following env variables:
|
* Inside the `laconic-console-deployment` deployment directory, open `config.env` file and set following env variables:
|
||||||
@ -132,8 +138,13 @@ Instructions for running a laconicd fixturenet along with registry CLI and conso
|
|||||||
# Gas limit for txs (default: 200000)
|
# Gas limit for txs (default: 200000)
|
||||||
CERC_LACONICD_GAS=
|
CERC_LACONICD_GAS=
|
||||||
|
|
||||||
# Max fees for txs (default: 200000alnt)
|
# Max fees for txs (default: 200alnt)
|
||||||
CERC_LACONICD_FEES=
|
CERC_LACONICD_FEES=
|
||||||
|
|
||||||
|
# Gas price to use for txs (default: 0.001alnt)
|
||||||
|
# Use for auto fees calculation, gas and fees not required to be set in that case
|
||||||
|
# Reference: https://git.vdb.to/cerc-io/laconic-registry-cli#gas-and-fees
|
||||||
|
CERC_LACONICD_GASPRICE=
|
||||||
```
|
```
|
||||||
|
|
||||||
## Start the deployment
|
## Start the deployment
|
||||||
|
@ -0,0 +1,94 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on error
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ "$#" -ne 3 ]; then
|
||||||
|
echo "Usage: $0 <subscribed-participants-csv> <participant-allocation> <validator-allocation>"
|
||||||
|
echo "Example: $0 /home/user/subscribed-participants.csv 1000000 1000000000000"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SUBSCRIBED_PARTICIPANTS_CSV="$1"
|
||||||
|
PARTICIPANT_ALLOCATION="$2"
|
||||||
|
VALIDATOR_ALLOCATION="$3"
|
||||||
|
STAGE1_GENESIS_DIR=stage1-genesis
|
||||||
|
|
||||||
|
# Create a temporary target directory
|
||||||
|
mkdir -p $STAGE1_GENESIS_DIR
|
||||||
|
|
||||||
|
# --------
|
||||||
|
|
||||||
|
# Parse the input CSV file to create stage1 onboarding module state
|
||||||
|
# Input CSV columns:
|
||||||
|
# 5: laconic_address, 6: nitro_address, 7: role, 8: hashed_subscriber_id, 11: funding_amount
|
||||||
|
|
||||||
|
stage1_participants_file="$STAGE1_GENESIS_DIR/stage1-participants.json"
|
||||||
|
jq -R -s --arg participant_allocation "$PARTICIPANT_ALLOCATION" --arg validator_allocation "$VALIDATOR_ALLOCATION" -f <(cat <<'EOF'
|
||||||
|
# Split the input into lines
|
||||||
|
split("\n") |
|
||||||
|
# Skip the first line (header) and filter out empty lines
|
||||||
|
.[1:] | map(select(length > 0)) |
|
||||||
|
# For each line, split it into fields by comma
|
||||||
|
map(split(",") | map(gsub("^\"|\"$"; ""))) |
|
||||||
|
# Create objects from the relevant fields
|
||||||
|
map({
|
||||||
|
cosmos_address: .[5],
|
||||||
|
nitro_address: .[6],
|
||||||
|
role: .[7],
|
||||||
|
kyc_id: .[8]
|
||||||
|
})
|
||||||
|
EOF
|
||||||
|
) < "$SUBSCRIBED_PARTICIPANTS_CSV" > "$stage1_participants_file"
|
||||||
|
|
||||||
|
echo "Exported participants for stage1 onboarding module state"
|
||||||
|
|
||||||
|
# --------
|
||||||
|
|
||||||
|
# Parse the input CSV file to calculate allocations on stage1
|
||||||
|
# Use provided input amounts if funding amount not present in the CSV
|
||||||
|
|
||||||
|
stage1_allocations_file="$STAGE1_GENESIS_DIR/stage1-allocations.json"
|
||||||
|
jq -R -s --arg participant_allocation "$PARTICIPANT_ALLOCATION" --arg validator_allocation "$VALIDATOR_ALLOCATION" -f <(cat <<'EOF'
|
||||||
|
# Split the input into lines
|
||||||
|
split("\n") |
|
||||||
|
# Skip the first line (header) and filter out empty lines
|
||||||
|
.[1:] | map(select(length > 0)) |
|
||||||
|
# For each line, split it into fields by comma
|
||||||
|
map(split(",") | map(gsub("^\"|\"$"; ""))) |
|
||||||
|
# Create objects from the relevant fields
|
||||||
|
map({
|
||||||
|
cosmos_address: .[5],
|
||||||
|
balance: (
|
||||||
|
if .[11] == "" or .[11] == null then
|
||||||
|
if .[7] == "validator" then $validator_allocation else $participant_allocation end
|
||||||
|
else .[11] end
|
||||||
|
)
|
||||||
|
})
|
||||||
|
EOF
|
||||||
|
) < "$SUBSCRIBED_PARTICIPANTS_CSV" > "$stage1_allocations_file"
|
||||||
|
|
||||||
|
echo "Calculated allocations for stage 1 chain"
|
||||||
|
|
||||||
|
# --------
|
||||||
|
|
||||||
|
# Run a script with cerc/laconicd:local to generate the genesis file
|
||||||
|
# with onboarding module state and given allocations
|
||||||
|
docker run -it \
|
||||||
|
-v ./$STAGE1_GENESIS_DIR:/root/.laconicd \
|
||||||
|
-v ./scripts:/scripts \
|
||||||
|
cerc/laconicd:local bash -c "/scripts/genesis.sh"
|
||||||
|
|
||||||
|
# Copy over the genesis file to output folder
|
||||||
|
OUTPUT_DIR=output
|
||||||
|
mkdir -p $OUTPUT_DIR
|
||||||
|
cp ./$STAGE1_GENESIS_DIR/config/genesis.json $OUTPUT_DIR/genesis.json
|
||||||
|
|
||||||
|
echo "Genesis file for stage1 written to $OUTPUT_DIR/genesis.json"
|
||||||
|
|
||||||
|
# --------
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
echo "Please remove the temporary data directory: sudo rm -rf $STAGE1_GENESIS_DIR"
|
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on error
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ "$#" -ne 2 ]; then
|
||||||
|
echo "Usage: $0 <stage1-participants-json> <stage1-allocations-json>"
|
||||||
|
echo "Example: $0 ./stage-participants.json ./stage1-allocations.json"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
STAGE1_PARTICIPANTS_FILE="$1"
|
||||||
|
STAGE1_ALLOCATIONS_FILE="$2"
|
||||||
|
STAGE1_GENESIS_DIR=stage1-genesis
|
||||||
|
|
||||||
|
# Create a temporary target directory
|
||||||
|
mkdir -p $STAGE1_GENESIS_DIR
|
||||||
|
|
||||||
|
# --------
|
||||||
|
|
||||||
|
# Copy over the stage1-participants json file for genesis.sh to use
|
||||||
|
cp $STAGE1_PARTICIPANTS_FILE "$STAGE1_GENESIS_DIR/stage1-participants.json"
|
||||||
|
echo "Copied over stage1 participants json file to mount dir"
|
||||||
|
|
||||||
|
# Copy over the stage1-participants json file for genesis.sh to use
|
||||||
|
cp $STAGE1_ALLOCATIONS_FILE "$STAGE1_GENESIS_DIR/stage1-allocations.json"
|
||||||
|
echo "Copied over stage1 allocations json file to mount dir"
|
||||||
|
|
||||||
|
# --------
|
||||||
|
|
||||||
|
# Run a script with cerc/laconicd:local to generate the genesis file
|
||||||
|
# with onboarding module state and given allocations
|
||||||
|
docker run -it \
|
||||||
|
-v ./$STAGE1_GENESIS_DIR:/root/.laconicd \
|
||||||
|
-v ./scripts:/scripts \
|
||||||
|
cerc/laconicd:local bash -c "/scripts/genesis.sh"
|
||||||
|
|
||||||
|
# Copy over the genesis file to output folder
|
||||||
|
OUTPUT_DIR=output
|
||||||
|
mkdir -p $OUTPUT_DIR
|
||||||
|
cp ./$STAGE1_GENESIS_DIR/config/genesis.json $OUTPUT_DIR/genesis.json
|
||||||
|
|
||||||
|
echo "Genesis file for stage1 written to $OUTPUT_DIR/genesis.json"
|
||||||
|
|
||||||
|
# --------
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
echo "Please remove the temporary data directory: sudo rm -rf $STAGE1_GENESIS_DIR"
|
@ -21,23 +21,24 @@ mkdir -p $STAGE1_GENESIS_DIR
|
|||||||
|
|
||||||
# --------
|
# --------
|
||||||
|
|
||||||
# Export onboarding module state from stage0 laconicd chain
|
# Export participants from onboarding module state on stage0 laconicd chain
|
||||||
|
# Use cerc/laconicd-stage0:local image for stage0 laconicd build
|
||||||
|
|
||||||
onboarding_state_file="$STAGE1_GENESIS_DIR/stage0-onboarding-state.json"
|
stage1_participants_file="$STAGE1_GENESIS_DIR/stage1-participants.json"
|
||||||
docker run -it \
|
docker run -it \
|
||||||
-v ${STAGE0_DEPLOYMENT_DIR}/data/laconicd-data:/root/stage0-deployment/.laconicd \
|
-v ${STAGE0_DEPLOYMENT_DIR}/data/laconicd-data:/root/stage0-deployment/.laconicd \
|
||||||
cerc/laconicd:local bash -c "laconicd export --home /root/stage0-deployment/.laconicd" \
|
cerc/laconicd-stage0:local bash -c "laconicd export --home /root/stage0-deployment/.laconicd" \
|
||||||
| jq .app_state.onboarding > "$onboarding_state_file"
|
| jq .app_state.onboarding.participants > "$stage1_participants_file"
|
||||||
|
|
||||||
stage0_participants=$(cat "$onboarding_state_file" | jq .participants)
|
stage1_participants=$(cat "$stage1_participants_file")
|
||||||
|
|
||||||
echo "Exported onboarding module state from stage 0 chain"
|
echo "Exported participants for stage1 onboarding module state"
|
||||||
|
|
||||||
# --------
|
# --------
|
||||||
|
|
||||||
# For each participant, using ETH account holdings, figure out balance allocation for stage1
|
# For each participant, using ETH account holdings, figure out balance allocation for stage1
|
||||||
stage1_allocations_file="$STAGE1_GENESIS_DIR/stage1-allocations.json"
|
stage1_allocations_file="$STAGE1_GENESIS_DIR/stage1-allocations.json"
|
||||||
jq -n --argjson participants "$stage0_participants" --arg participant_allocation "$PARTICIPANT_ALLOCATION" --arg validator_allocation "$VALIDATOR_ALLOCATION" '
|
jq -n --argjson participants "$stage1_participants" --arg participant_allocation "$PARTICIPANT_ALLOCATION" --arg validator_allocation "$VALIDATOR_ALLOCATION" '
|
||||||
[
|
[
|
||||||
$participants[] |
|
$participants[] |
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,80 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on error
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
|
CHAINID=${CHAINID:-"laconic-testnet-2"}
|
||||||
|
STAGE2_MONIKER=${MONIKER:-"localtestnet-stage-2"}
|
||||||
|
NODE_HOME="$HOME/.laconicd"
|
||||||
|
|
||||||
|
# Existing key
|
||||||
|
KEY="alice"
|
||||||
|
KEYRING=${KEYRING:-"test"}
|
||||||
|
DENOM=${DENOM:-"alnt"}
|
||||||
|
STAKING_AMOUNT=${STAKING_AMOUNT:-"1000000000000000"}
|
||||||
|
|
||||||
|
stage1_state="$NODE_HOME/stage1-state.json"
|
||||||
|
stage2_genesis_file="$NODE_HOME/config/genesis.json"
|
||||||
|
|
||||||
|
remove_module_accounts () {
|
||||||
|
bonded_tokens_pool_address=$(jq -r '.app_state.auth.accounts[] | select(.name == "bonded_tokens_pool") | .base_account.address' $stage2_genesis_file)
|
||||||
|
bonded_tokens_pool_balance=$(jq -r --arg ADDRESS "$bonded_tokens_pool_address" '( .app_state.bank.balances[]? | select(.address == $ADDRESS) | .coins[]? | select(.denom == "alnt") | .amount ) // "0"' $stage2_genesis_file)
|
||||||
|
|
||||||
|
not_bonded_tokens_pool_address=$(jq -r '.app_state.auth.accounts[] | select(.name == "not_bonded_tokens_pool") | .base_account.address' $stage2_genesis_file)
|
||||||
|
not_bonded_tokens_pool_balance=$(jq -r --arg ADDRESS "$not_bonded_tokens_pool_address" '( .app_state.bank.balances[]? | select(.address == $ADDRESS) | .coins[]? | select(.denom == "alnt") | .amount ) // "0"' $stage2_genesis_file)
|
||||||
|
|
||||||
|
distribution_address=$(jq -r '.app_state.auth.accounts[] | select(.name == "distribution") | .base_account.address' $stage2_genesis_file)
|
||||||
|
distribution_balance=$(jq -r --arg ADDRESS "$distribution_address" '( .app_state.bank.balances[]? | select(.address == $ADDRESS) | .coins[]? | select(.denom == "alnt") | .amount ) // "0"' $stage2_genesis_file)
|
||||||
|
|
||||||
|
# Remove the entry from auth.accounts
|
||||||
|
jq "del(.app_state.auth.accounts[] | select(.base_account.address == \"$bonded_tokens_pool_address\"))" $stage2_genesis_file > tmp.$$.json && mv tmp.$$.json $stage2_genesis_file
|
||||||
|
jq "del(.app_state.auth.accounts[] | select(.base_account.address == \"$not_bonded_tokens_pool_address\"))" $stage2_genesis_file > tmp.$$.json && mv tmp.$$.json $stage2_genesis_file
|
||||||
|
jq "del(.app_state.auth.accounts[] | select(.base_account.address == \"$distribution_address\"))" $stage2_genesis_file > tmp.$$.json && mv tmp.$$.json $stage2_genesis_file
|
||||||
|
|
||||||
|
# Remove the entry from bank.balances
|
||||||
|
jq "del(.app_state.bank.balances[] | select(.address == \"$bonded_tokens_pool_address\"))" $stage2_genesis_file > tmp.$$.json && mv tmp.$$.json $stage2_genesis_file
|
||||||
|
jq "del(.app_state.bank.balances[] | select(.address == \"$not_bonded_tokens_pool_address\"))" $stage2_genesis_file > tmp.$$.json && mv tmp.$$.json $stage2_genesis_file
|
||||||
|
jq "del(.app_state.bank.balances[] | select(.address == \"$distribution_address\"))" $stage2_genesis_file > tmp.$$.json && mv tmp.$$.json $stage2_genesis_file
|
||||||
|
|
||||||
|
# Subtract the balance from bank supply
|
||||||
|
bank_supply=$(jq -r '(.app_state.bank.supply[] | select(.denom == "alnt") | .amount)' $stage2_genesis_file)
|
||||||
|
new_supply=$(echo "$bank_supply - $bonded_tokens_pool_balance - $not_bonded_tokens_pool_balance - $distribution_balance" | bc)
|
||||||
|
|
||||||
|
# Update genesis file with the new amount
|
||||||
|
jq --arg NEW_SUPPLY "$new_supply" '(.app_state.bank.supply[] | select(.denom == "alnt") | .amount) |= $NEW_SUPPLY' $stage2_genesis_file > tmp.$$.json && mv tmp.$$.json $stage2_genesis_file
|
||||||
|
}
|
||||||
|
|
||||||
|
# Remove existing data but keep keys
|
||||||
|
laconicd cometbft unsafe-reset-all
|
||||||
|
|
||||||
|
# Remove existing genesis file and gentxs
|
||||||
|
rm -r $NODE_HOME/config/gentx || true
|
||||||
|
rm $stage2_genesis_file || true
|
||||||
|
|
||||||
|
# Initialize node with given chain id and moniker
|
||||||
|
laconicd config set client chain-id $CHAINID
|
||||||
|
laconicd init $STAGE2_MONIKER --chain-id $CHAINID --default-denom alnt
|
||||||
|
|
||||||
|
# Import required module state
|
||||||
|
jq --slurpfile nested $stage1_state '.app_state.auth = $nested[0].app_state.auth' "$stage2_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage2_genesis_file"
|
||||||
|
jq --slurpfile nested $stage1_state '.app_state.bank = $nested[0].app_state.bank' "$stage2_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage2_genesis_file"
|
||||||
|
jq --slurpfile nested $stage1_state '.app_state.bond = $nested[0].app_state.bond' "$stage2_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage2_genesis_file"
|
||||||
|
jq --slurpfile nested $stage1_state '.app_state.onboarding = $nested[0].app_state.onboarding' "$stage2_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage2_genesis_file"
|
||||||
|
jq --slurpfile nested $stage1_state '.app_state.registry = $nested[0].app_state.registry' "$stage2_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage2_genesis_file"
|
||||||
|
|
||||||
|
# Remove bonded_tokens_pool, not_bonded_tokens_pool distribution module accounts as we're skipping their state
|
||||||
|
remove_module_accounts
|
||||||
|
|
||||||
|
# Set all account sequences to 0
|
||||||
|
jq '(.app_state.auth.accounts[] | select(has("sequence")) | .sequence) = "0"' "$stage2_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage2_genesis_file"
|
||||||
|
|
||||||
|
# Sign genesis transaction
|
||||||
|
# 10^15 alnt
|
||||||
|
laconicd genesis gentx $KEY $STAKING_AMOUNT$DENOM --keyring-backend $KEYRING --chain-id $CHAINID
|
||||||
|
|
||||||
|
# Collect genesis txs
|
||||||
|
laconicd genesis collect-gentxs
|
||||||
|
|
||||||
|
# Run this to ensure everything worked and that the genesis file is setup correctly
|
||||||
|
laconicd genesis validate
|
@ -6,24 +6,31 @@ set -u
|
|||||||
|
|
||||||
# Note: Needs to be run in a docker container with image cerc/laconicd:local
|
# Note: Needs to be run in a docker container with image cerc/laconicd:local
|
||||||
|
|
||||||
CHAINID="laconic_9000-1"
|
CHAINID=${CHAINID:-"laconic_9000-1"}
|
||||||
STAGE1_MONIKER=localtestnet-stage-1
|
STAGE1_MONIKER=${MONIKER:-"localtestnet-stage-1"}
|
||||||
NODE_HOME="/root/.laconicd"
|
NODE_HOME="/root/.laconicd"
|
||||||
|
|
||||||
onboarding_state_file="$NODE_HOME/stage0-onboarding-state.json"
|
stage1_participants_file="$NODE_HOME/stage1-participants.json"
|
||||||
stage1_allocations_file="$NODE_HOME/stage1-allocations.json"
|
stage1_allocations_file="$NODE_HOME/stage1-allocations.json"
|
||||||
stage1_genesis_file="$NODE_HOME/config/genesis.json"
|
stage1_genesis_file="$NODE_HOME/config/genesis.json"
|
||||||
|
|
||||||
laconicd init $STAGE1_MONIKER --chain-id $CHAINID --default-denom alnt
|
laconicd init $STAGE1_MONIKER --chain-id $CHAINID --default-denom alnt
|
||||||
|
|
||||||
# Update onboarding module state with participants from stage0
|
# Update onboarding module state with participants
|
||||||
participants=$(jq -c '.participants' $onboarding_state_file)
|
jq --argfile p "$stage1_participants_file" '.app_state.onboarding.participants = $p' "$stage1_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage1_genesis_file"
|
||||||
jq --argjson p "$participants" '.app_state.onboarding.participants = $p' "$stage1_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage1_genesis_file"
|
|
||||||
|
|
||||||
# Disable bank module transfers
|
# Disable bank module transfers
|
||||||
jq '.app_state["bank"]["params"]["default_send_enabled"]=false' "$stage1_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage1_genesis_file"
|
# jq '.app_state["bank"]["params"]["default_send_enabled"]=false' "$stage1_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage1_genesis_file"
|
||||||
|
|
||||||
|
# Update staking module params
|
||||||
|
jq '.app_state["staking"]["params"]["max_validators"]=100' "$stage1_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage1_genesis_file"
|
||||||
|
|
||||||
|
# Update slashing module params
|
||||||
|
jq '.app_state["slashing"]["params"]["signed_blocks_window"]="2400"' "$stage1_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage1_genesis_file"
|
||||||
|
jq '.app_state["slashing"]["params"]["min_signed_per_window"]="0.5"' "$stage1_genesis_file" > tmp.$$.json && mv tmp.$$.json "$stage1_genesis_file"
|
||||||
|
|
||||||
# Read and assign allocations
|
# Read and assign allocations
|
||||||
|
echo "Adding genesis accounts with allocations..."
|
||||||
jq -c '.[]' "$stage1_allocations_file" | while IFS= read -r line; do
|
jq -c '.[]' "$stage1_allocations_file" | while IFS= read -r line; do
|
||||||
cosmos_address=$(jq -r '.cosmos_address' <<< "$line")
|
cosmos_address=$(jq -r '.cosmos_address' <<< "$line")
|
||||||
balance=$(jq -r '.balance' <<< "$line")
|
balance=$(jq -r '.balance' <<< "$line")
|
||||||
|
25
stack-orchestrator/stacks/fixturenet-laconicd/scripts/initialize-stage2.sh
Executable file
25
stack-orchestrator/stacks/fixturenet-laconicd/scripts/initialize-stage2.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on error
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Prerequisite: stage1 exported state present at $STAGE2_DEPLOYMENT/data/laconicd-data/stage1-state.json
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ "$#" -lt 2 ]; then
|
||||||
|
echo "Usage: $0 <stage2-deployment-dir> <stage2-chain-id> <node-moniker> <node-keyring-backend> [node-staking-amount]"
|
||||||
|
echo "Example: $0 /srv/stage2-deployment laconic-testnet-2 LaconicStage2 os 1000000000000000"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
STAGE2_DEPLOYMENT=$1
|
||||||
|
CHAINID=$2
|
||||||
|
MONIKER=$3
|
||||||
|
KEYRING=$4
|
||||||
|
STAKING_AMOUNT=$5
|
||||||
|
|
||||||
|
# Generate genesis file for state2 chain and init node
|
||||||
|
docker run -it \
|
||||||
|
-v $STAGE2_DEPLOYMENT/data/laconicd-data:/root/.laconicd \
|
||||||
|
-v ./scripts:/scripts \
|
||||||
|
cerc/laconicd:local bash -c "CHAINID=$CHAINID MONIKER=$MONIKER KEYRING=$KEYRING STAKING_AMOUNT=$STAKING_AMOUNT /scripts/generate-stage2-genesis.sh"
|
@ -2,7 +2,7 @@ version: "1.0"
|
|||||||
name: fixturenet-laconicd
|
name: fixturenet-laconicd
|
||||||
description: "A laconicd fixturenet"
|
description: "A laconicd fixturenet"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/laconicd
|
- git.vdb.to/cerc-io/laconicd@v0.1.9
|
||||||
containers:
|
containers:
|
||||||
- cerc/laconicd
|
- cerc/laconicd
|
||||||
pods:
|
pods:
|
||||||
|
Loading…
Reference in New Issue
Block a user