Skip to content

Commit

Permalink
feat: init balance of relayers in genesis state (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutianwu authored Jan 4, 2023
1 parent d8b2af9 commit 657204f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions deployment/localup/localup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function init() {

# create genesis accounts
${bin} keys add validator${i} --keyring-backend test --home ${workspace}/.local/validator${i} > ${workspace}/.local/validator${i}/info 2>&1
${bin} keys add relayer${i} --keyring-backend test --home ${workspace}/.local/relayer${i} > ${workspace}/.local/relayer${i}/info 2>&1
${bin} keys add relayer_bls${i} --keyring-backend test --home ${workspace}/.local/relayer${i} --algo eth_bls > ${workspace}/.local/relayer${i}/info 2>&1
${bin} keys add relayer${i} --keyring-backend test --home ${workspace}/.local/relayer${i} > ${workspace}/.local/relayer${i}/relayer_info 2>&1
${bin} keys add relayer_bls${i} --keyring-backend test --home ${workspace}/.local/relayer${i} --algo eth_bls > ${workspace}/.local/relayer${i}/relayer_bls_info 2>&1
done
}

Expand All @@ -45,13 +45,24 @@ function generate_genesis() {
validator_addrs+=("$(${bin} keys show validator${i} -a --keyring-backend test --home ${workspace}/.local/validator${i})")
done

declare -a relayer_addrs=()
for ((i=0;i<${size};i++));do
# export validator addresses
relayer_addrs+=("$(${bin} keys show relayer${i} -a --keyring-backend test --home ${workspace}/.local/relayer${i})")
done

mkdir -p ${workspace}/.local/gentx
for ((i=0;i<${size};i++));do
for validator_addr in "${validator_addrs[@]}";do
# init genesis account in genesis state
${bin} add-genesis-account $validator_addr ${GENESIS_ACCOUNT_BALANCE}${STAKING_BOND_DENOM} --home ${workspace}/.local/validator${i}
done

for relayer_addr in "${relayer_addrs[@]}";do
# init genesis account in genesis state
${bin} add-genesis-account $relayer_addr ${GENESIS_ACCOUNT_BALANCE}${STAKING_BOND_DENOM} --home ${workspace}/.local/validator${i}
done

rm -rf ${workspace}/.local/validator${i}/config/gentx/

validatorAddr=${validator_addrs[$i]}
Expand Down

0 comments on commit 657204f

Please sign in to comment.