mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-25 07:45:18 +00:00
seed dev-wallet power on internal testnet (#1442)
the seed script will issue & delegate enough KAVA to the genesis validators to have enough power to pass gov proposals by itself.
This commit is contained in:
parent
67e1938190
commit
66a60fa6d8
16
.github/scripts/seed-internal-testnet.sh
vendored
16
.github/scripts/seed-internal-testnet.sh
vendored
@ -19,7 +19,7 @@ echo "${DEV_WALLET_MNEMONIC}" | kava keys add --recover dev-wallet
|
||||
echo "sweet ocean blush coil mobile ten floor sample nuclear power legend where place swamp young marble grit observe enforce lake blossom lesson upon plug" | kava keys add --recover --eth dev-erc20-deployer-wallet
|
||||
|
||||
# fund evm-contract-deployer account (using issuance)
|
||||
yes y | kava tx issuance issue 200000000ukava kava1van3znl6597xgwwh46jgquutnqkwvwszjg04fz --from dev-wallet --gas-prices 0.5ukava
|
||||
kava tx issuance issue 200000000ukava kava1van3znl6597xgwwh46jgquutnqkwvwszjg04fz --from dev-wallet --gas-prices 0.5ukava -y
|
||||
|
||||
# deploy and fund USDC ERC20 contract
|
||||
USD_CONTRACT_DEPLOY=$(npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" deploy-erc20 "USD Coin" USDC 6)
|
||||
@ -45,3 +45,17 @@ npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" mint-erc20 "$USDT_CONTRAC
|
||||
DAI_CONTRACT_DEPLOY=$(npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" deploy-erc20 "DAI" DAI 18)
|
||||
DAI_CONTRACT_ADDRESS=${DAI_CONTRACT_DEPLOY: -42}
|
||||
npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" mint-erc20 "$DAI_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000
|
||||
|
||||
# give dev-wallet enough delegation power to pass proposals by itself
|
||||
# enumerate all genesis validators
|
||||
GENTX_VALIDATORS=($(curl -s "${CHAIN_API_URL}" | jq -r '.result.genesis.app_state.genutil.gen_txs[].body.messages[0].validator_address'))
|
||||
|
||||
# issue 300KAVA to delegate to each validator
|
||||
kava tx issuance issue "$((${#GENTX_VALIDATORS[@]}*300000000))"ukava kava1vlpsrmdyuywvaqrv7rx6xga224sqfwz3fyfhwq \
|
||||
--from dev-wallet --gas-prices 0.5ukava -y
|
||||
|
||||
# delegate 300KAVA to each validator
|
||||
for validator in "${GENTX_VALIDATORS[@]}"
|
||||
do
|
||||
kava tx staking delegate "${validator}" 300000000ukava --from dev-wallet --gas-prices 0.5ukava -y
|
||||
done
|
||||
|
6
.github/workflows/cd-seed-chain.yml
vendored
6
.github/workflows/cd-seed-chain.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.18'
|
||||
go-version: "1.18"
|
||||
check-latest: true
|
||||
cache: true
|
||||
- name: build kava binary
|
||||
@ -61,8 +61,10 @@ jobs:
|
||||
- name: compile default erc20 contracts
|
||||
run: make compile-contracts
|
||||
working-directory: kava-bridge
|
||||
- name: install jq
|
||||
run: sudo apt-get install -y jq
|
||||
- name: run seed scripts
|
||||
run: bash ${GITHUB_WORKSPACE}/.github/scripts/${SEED_SCRIPT_FILENAME}
|
||||
run: bash ${GITHUB_WORKSPACE}/.github/scripts/${SEED_SCRIPT_FILENAME}
|
||||
working-directory: kava-bridge/contract
|
||||
env:
|
||||
CHAIN_API_URL: ${{ inputs.chain-api-url }}
|
||||
|
Loading…
Reference in New Issue
Block a user